From e2f80d773b2cc9f6be1617a775b7b04115b1e87c Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 10 Apr 2025 22:22:38 +0000 Subject: [PATCH] CodeGen from PR 33838 in Azure/azure-rest-api-specs Merge 4535c5e6496038f9201fc8efb646a0f72f52d8b0 into afe8ef87df6112dc9db1248b61e46b8ac7f3a709 --- ....ResourceManager.ContainerServiceFleet.sln | 56 + .../CHANGELOG.md | 11 + .../Directory.Build.props | 6 + .../README.md | 80 ++ ...rceManager.ContainerServiceFleet.net8.0.cs | 922 ++++++++++++++ ...er.ContainerServiceFleet.netstandard2.0.cs | 922 ++++++++++++++ .../assets.json | 7 + ...nager.ContainerServiceFleet.Samples.csproj | 13 + .../Sample_AutoUpgradeProfileCollection.cs | 376 ++++++ .../Sample_AutoUpgradeProfileResource.cs | 230 ++++ .../Samples/Sample_FleetCollection.cs | 386 ++++++ .../Samples/Sample_FleetMemberCollection.cs | 376 ++++++ .../Samples/Sample_FleetMemberResource.cs | 203 ++++ .../Generated/Samples/Sample_FleetResource.cs | 268 +++++ .../Sample_FleetUpdateStrategyCollection.cs | 376 ++++++ .../Sample_FleetUpdateStrategyResource.cs | 203 ++++ .../Sample_SubscriptionResourceExtensions.cs | 81 ++ .../Samples/Sample_UpdateRunCollection.cs | 376 ++++++ .../Samples/Sample_UpdateRunResource.cs | 409 +++++++ ...sourceManager.ContainerServiceFleet.csproj | 8 + .../ArmContainerServiceFleetModelFactory.cs | 352 ++++++ .../Generated/AutoUpgradeProfileCollection.cs | 497 ++++++++ .../AutoUpgradeProfileData.Serialization.cs | 262 ++++ .../src/Generated/AutoUpgradeProfileData.cs | 119 ++ ...utoUpgradeProfileResource.Serialization.cs | 26 + .../Generated/AutoUpgradeProfileResource.cs | 433 +++++++ .../ContainerServiceFleetExtensions.cs | 295 +++++ .../MockableContainerServiceFleetArmClient.cs | 97 ++ ...tainerServiceFleetResourceGroupResource.cs | 105 ++ ...ntainerServiceFleetSubscriptionResource.cs | 102 ++ .../src/Generated/FleetCollection.cs | 498 ++++++++ .../src/Generated/FleetData.Serialization.cs | 253 ++++ .../src/Generated/FleetData.cs | 99 ++ .../src/Generated/FleetMemberCollection.cs | 497 ++++++++ .../FleetMemberData.Serialization.cs | 226 ++++ .../src/Generated/FleetMemberData.cs | 91 ++ .../FleetMemberResource.Serialization.cs | 26 + .../src/Generated/FleetMemberResource.cs | 352 ++++++ .../Generated/FleetResource.Serialization.cs | 26 + .../src/Generated/FleetResource.cs | 1063 +++++++++++++++++ .../FleetUpdateStrategyCollection.cs | 497 ++++++++ .../FleetUpdateStrategyData.Serialization.cs | 198 +++ .../src/Generated/FleetUpdateStrategyData.cs | 90 ++ ...eetUpdateStrategyResource.Serialization.cs | 26 + .../Generated/FleetUpdateStrategyResource.cs | 353 ++++++ .../src/Generated/Internal/Argument.cs | 129 ++ .../Internal/ChangeTrackingDictionary.cs | 167 +++ .../Generated/Internal/ChangeTrackingList.cs | 153 +++ .../Internal/ModelSerializationExtensions.cs | 399 +++++++ .../src/Generated/Internal/Optional.cs | 51 + .../Internal/Utf8JsonRequestContent.cs | 55 + .../AutoUpgradeProfileOperationSource.cs | 36 + .../ContainerServiceFleetArmOperation.cs | 94 ++ .../ContainerServiceFleetArmOperationOfT.cs | 100 ++ .../FleetMemberOperationSource.cs | 36 + .../FleetOperationSource.cs | 36 + .../FleetUpdateStrategyOperationSource.cs | 36 + .../UpdateRunOperationSource.cs | 36 + .../APIServerAccessProfile.Serialization.cs | 163 +++ .../Models/APIServerAccessProfile.cs | 74 ++ .../Models/AgentProfile.Serialization.cs | 144 +++ .../src/Generated/Models/AgentProfile.cs | 70 ++ .../Models/AutoUpgradeLastTriggerStatus.cs | 51 + ...UpgradeNodeImageSelection.Serialization.cs | 126 ++ .../Models/AutoUpgradeNodeImageSelection.cs | 72 ++ .../AutoUpgradeNodeImageSelectionType.cs | 51 + ...oUpgradeProfileListResult.Serialization.cs | 151 +++ .../Models/AutoUpgradeProfileListResult.cs | 80 ++ .../AutoUpgradeProfileProvisioningState.cs | 54 + .../AutoUpgradeProfileStatus.Serialization.cs | 188 +++ .../Models/AutoUpgradeProfileStatus.cs | 78 ++ .../FleetCredentialResult.Serialization.cs | 144 +++ .../Generated/Models/FleetCredentialResult.cs | 69 ++ .../FleetCredentialResults.Serialization.cs | 143 +++ .../Models/FleetCredentialResults.cs | 66 + .../Models/FleetHubProfile.Serialization.cs | 199 +++ .../src/Generated/Models/FleetHubProfile.cs | 85 ++ .../Models/FleetListResult.Serialization.cs | 151 +++ .../src/Generated/Models/FleetListResult.cs | 80 ++ .../FleetMemberListResult.Serialization.cs | 151 +++ .../Generated/Models/FleetMemberListResult.cs | 80 ++ .../Models/FleetMemberPatch.Serialization.cs | 144 +++ .../src/Generated/Models/FleetMemberPatch.cs | 65 + .../Models/FleetMemberProvisioningState.cs | 63 + .../Models/FleetMemberStatus.Serialization.cs | 144 +++ .../src/Generated/Models/FleetMemberStatus.cs | 69 ++ .../Models/FleetPatch.Serialization.cs | 159 +++ .../src/Generated/Models/FleetPatch.cs | 70 ++ .../Models/FleetProvisioningState.cs | 63 + .../Models/FleetStatus.Serialization.cs | 144 +++ .../src/Generated/Models/FleetStatus.cs | 69 ++ ...tUpdateStrategyListResult.Serialization.cs | 151 +++ .../Models/FleetUpdateStrategyListResult.cs | 80 ++ .../FleetUpdateStrategyProvisioningState.cs | 54 + .../ManagedClusterUpdate.Serialization.cs | 141 +++ .../Generated/Models/ManagedClusterUpdate.cs | 79 ++ ...ManagedClusterUpgradeSpec.Serialization.cs | 137 +++ .../Models/ManagedClusterUpgradeSpec.cs | 76 ++ .../Models/ManagedClusterUpgradeType.cs | 54 + .../ManagedServiceIdentity.Serialization.cs | 183 +++ .../Models/ManagedServiceIdentity.cs | 86 ++ .../Models/ManagedServiceIdentityType.cs | 57 + .../MemberUpdateStatus.Serialization.cs | 183 +++ .../Generated/Models/MemberUpdateStatus.cs | 81 ++ .../NodeImageSelection.Serialization.cs | 151 +++ .../Generated/Models/NodeImageSelection.cs | 77 ++ .../NodeImageSelectionStatus.Serialization.cs | 143 +++ .../Models/NodeImageSelectionStatus.cs | 66 + .../Models/NodeImageSelectionType.cs | 54 + .../Models/NodeImageVersion.Serialization.cs | 129 ++ .../src/Generated/Models/NodeImageVersion.cs | 65 + .../Models/SkipProperties.Serialization.cs | 136 +++ .../src/Generated/Models/SkipProperties.cs | 76 ++ .../Models/SkipTarget.Serialization.cs | 134 +++ .../src/Generated/Models/SkipTarget.cs | 93 ++ .../src/Generated/Models/TargetType.cs | 57 + .../Models/UpdateGroup.Serialization.cs | 126 ++ .../src/Generated/Models/UpdateGroup.cs | 84 ++ .../Models/UpdateGroupStatus.Serialization.cs | 169 +++ .../src/Generated/Models/UpdateGroupStatus.cs | 74 ++ .../UpdateRunListResult.Serialization.cs | 151 +++ .../Generated/Models/UpdateRunListResult.cs | 80 ++ .../Models/UpdateRunProvisioningState.cs | 54 + .../Models/UpdateRunStatus.Serialization.cs | 173 +++ .../src/Generated/Models/UpdateRunStatus.cs | 79 ++ .../Models/UpdateRunStrategy.Serialization.cs | 136 +++ .../src/Generated/Models/UpdateRunStrategy.cs | 84 ++ .../Models/UpdateStage.Serialization.cs | 166 +++ .../src/Generated/Models/UpdateStage.cs | 84 ++ .../Models/UpdateStageStatus.Serialization.cs | 184 +++ .../src/Generated/Models/UpdateStageStatus.cs | 78 ++ .../src/Generated/Models/UpdateState.cs | 66 + .../Models/UpdateStatus.Serialization.cs | 178 +++ .../src/Generated/Models/UpdateStatus.cs | 77 ++ .../src/Generated/Models/UpgradeChannel.cs | 57 + .../Models/WaitStatus.Serialization.cs | 148 +++ .../src/Generated/Models/WaitStatus.cs | 69 ++ .../src/Generated/ProviderConstants.cs | 16 + .../AutoUpgradeProfileRestOperations.cs | 131 ++ .../AutoUpgradeProfilesRestOperations.cs | 531 ++++++++ .../FleetMembersRestOperations.cs | 639 ++++++++++ .../FleetUpdateStrategiesRestOperations.cs | 533 +++++++++ .../RestOperations/FleetsRestOperations.cs | 843 +++++++++++++ .../UpdateRunsRestOperations.cs | 841 +++++++++++++ .../src/Generated/UpdateRunCollection.cs | 497 ++++++++ .../Generated/UpdateRunData.Serialization.cs | 262 ++++ .../src/Generated/UpdateRunData.cs | 140 +++ .../UpdateRunResource.Serialization.cs | 26 + .../src/Generated/UpdateRunResource.cs | 620 ++++++++++ .../src/Properties/AssemblyInfo.cs | 11 + ...Manager.ContainerServiceFleet.Tests.csproj | 8 + ...ContainerServiceFleetManagementTestBase.cs | 45 + ...erServiceFleetManagementTestEnvironment.cs | 11 + .../tsp-location.yaml | 4 + sdk/containerservicefleet/ci.mgmt.yml | 26 + sdk/resourcemanager/ci.mgmt.yml | 2 + sdk/storage/ci.yml | 2 + 157 files changed, 26728 insertions(+) create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/Azure.ResourceManager.ContainerServiceFleet.sln create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/CHANGELOG.md create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/Directory.Build.props create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/README.md create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/api/Azure.ResourceManager.ContainerServiceFleet.net8.0.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/api/Azure.ResourceManager.ContainerServiceFleet.netstandard2.0.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/assets.json create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/samples/Azure.ResourceManager.ContainerServiceFleet.Samples.csproj create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_AutoUpgradeProfileCollection.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_AutoUpgradeProfileResource.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_FleetCollection.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_FleetMemberCollection.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_FleetMemberResource.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_FleetResource.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_FleetUpdateStrategyCollection.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_FleetUpdateStrategyResource.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_UpdateRunCollection.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_UpdateRunResource.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Azure.ResourceManager.ContainerServiceFleet.csproj create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ArmContainerServiceFleetModelFactory.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/AutoUpgradeProfileCollection.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/AutoUpgradeProfileData.Serialization.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/AutoUpgradeProfileData.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/AutoUpgradeProfileResource.Serialization.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/AutoUpgradeProfileResource.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/ContainerServiceFleetExtensions.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/MockableContainerServiceFleetArmClient.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/MockableContainerServiceFleetResourceGroupResource.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/MockableContainerServiceFleetSubscriptionResource.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetCollection.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetData.Serialization.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetData.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetMemberCollection.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetMemberData.Serialization.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetMemberData.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetMemberResource.Serialization.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetMemberResource.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetResource.Serialization.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetResource.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetUpdateStrategyCollection.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetUpdateStrategyData.Serialization.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetUpdateStrategyData.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetUpdateStrategyResource.Serialization.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetUpdateStrategyResource.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Internal/Argument.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Internal/ChangeTrackingDictionary.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Internal/ChangeTrackingList.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Internal/ModelSerializationExtensions.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Internal/Optional.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Internal/Utf8JsonRequestContent.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/LongRunningOperation/AutoUpgradeProfileOperationSource.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/LongRunningOperation/ContainerServiceFleetArmOperation.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/LongRunningOperation/ContainerServiceFleetArmOperationOfT.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/LongRunningOperation/FleetMemberOperationSource.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/LongRunningOperation/FleetOperationSource.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/LongRunningOperation/FleetUpdateStrategyOperationSource.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/LongRunningOperation/UpdateRunOperationSource.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/APIServerAccessProfile.Serialization.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/APIServerAccessProfile.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AgentProfile.Serialization.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AgentProfile.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeLastTriggerStatus.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeNodeImageSelection.Serialization.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeNodeImageSelection.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeNodeImageSelectionType.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeProfileListResult.Serialization.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeProfileListResult.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeProfileProvisioningState.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeProfileStatus.Serialization.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeProfileStatus.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetCredentialResult.Serialization.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetCredentialResult.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetCredentialResults.Serialization.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetCredentialResults.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetHubProfile.Serialization.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetHubProfile.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetListResult.Serialization.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetListResult.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetMemberListResult.Serialization.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetMemberListResult.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetMemberPatch.Serialization.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetMemberPatch.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetMemberProvisioningState.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetMemberStatus.Serialization.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetMemberStatus.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetPatch.Serialization.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetPatch.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetProvisioningState.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetStatus.Serialization.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetStatus.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetUpdateStrategyListResult.Serialization.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetUpdateStrategyListResult.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetUpdateStrategyProvisioningState.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ManagedClusterUpdate.Serialization.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ManagedClusterUpdate.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ManagedClusterUpgradeSpec.Serialization.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ManagedClusterUpgradeSpec.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ManagedClusterUpgradeType.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ManagedServiceIdentity.Serialization.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ManagedServiceIdentity.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ManagedServiceIdentityType.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/MemberUpdateStatus.Serialization.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/MemberUpdateStatus.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/NodeImageSelection.Serialization.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/NodeImageSelection.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/NodeImageSelectionStatus.Serialization.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/NodeImageSelectionStatus.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/NodeImageSelectionType.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/NodeImageVersion.Serialization.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/NodeImageVersion.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/SkipProperties.Serialization.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/SkipProperties.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/SkipTarget.Serialization.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/SkipTarget.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/TargetType.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateGroup.Serialization.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateGroup.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateGroupStatus.Serialization.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateGroupStatus.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateRunListResult.Serialization.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateRunListResult.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateRunProvisioningState.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateRunStatus.Serialization.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateRunStatus.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateRunStrategy.Serialization.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateRunStrategy.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateStage.Serialization.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateStage.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateStageStatus.Serialization.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateStageStatus.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateState.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateStatus.Serialization.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateStatus.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpgradeChannel.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/WaitStatus.Serialization.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/WaitStatus.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ProviderConstants.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/AutoUpgradeProfileRestOperations.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/AutoUpgradeProfilesRestOperations.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/FleetMembersRestOperations.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/FleetUpdateStrategiesRestOperations.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/FleetsRestOperations.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/UpdateRunsRestOperations.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/UpdateRunCollection.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/UpdateRunData.Serialization.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/UpdateRunData.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/UpdateRunResource.Serialization.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/UpdateRunResource.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Properties/AssemblyInfo.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/tests/Azure.ResourceManager.ContainerServiceFleet.Tests.csproj create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/tests/ContainerServiceFleetManagementTestBase.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/tests/ContainerServiceFleetManagementTestEnvironment.cs create mode 100644 sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/tsp-location.yaml create mode 100644 sdk/containerservicefleet/ci.mgmt.yml diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/Azure.ResourceManager.ContainerServiceFleet.sln b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/Azure.ResourceManager.ContainerServiceFleet.sln new file mode 100644 index 000000000000..d7cda9cfdc47 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/Azure.ResourceManager.ContainerServiceFleet.sln @@ -0,0 +1,56 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29709.97 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.ResourceManager.ContainerServiceFleet.Samples", "samples\Azure.ResourceManager.ContainerServiceFleet.Samples.csproj", "{7A2DFF15-5746-49F4-BD0F-C6C35337088A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.ContainerServiceFleet", "src\Azure.ResourceManager.ContainerServiceFleet.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.ContainerServiceFleet.Tests", "tests\Azure.ResourceManager.ContainerServiceFleet.Tests.csproj", "{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU + {7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Release|Any CPU.Build.0 = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/CHANGELOG.md b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/CHANGELOG.md new file mode 100644 index 000000000000..8b33f0fedccc --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes \ No newline at end of file diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/Directory.Build.props b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/Directory.Build.props new file mode 100644 index 000000000000..63bd836ad44b --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/README.md b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/README.md new file mode 100644 index 000000000000..476a1592b629 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/README.md @@ -0,0 +1,80 @@ +# Microsoft Azure ContainerServiceFleet management client library for .NET + +**[Describe the service briefly first.]** + +This library follows the [new Azure SDK guidelines](https://azure.github.io/azure-sdk/general_introduction.html), and provides many core capabilities: + + - Support MSAL.NET, Azure.Identity is out of box for supporting MSAL.NET. + - Support [OpenTelemetry](https://opentelemetry.io/) for distributed tracing. + - HTTP pipeline with custom policies. + - Better error-handling. + - Support uniform telemetry across all languages. + +## Getting started + +### Install the package + +Install the Microsoft Azure ContainerServiceFleet management library for .NET with [NuGet](https://www.nuget.org/): + +```dotnetcli +dotnet add package Azure.ResourceManager.ContainerServiceFleet --prerelease +``` + +### Prerequisites + +* You must have an [Microsoft Azure subscription](https://azure.microsoft.com/free/dotnet/). + +### Authenticate the Client + +To create an authenticated client and start interacting with Microsoft Azure resources, see the [quickstart guide here](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). + +## Key concepts + +Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azure.github.io/azure-sdk/dotnet_introduction.html) + +## Documentation + +Documentation is available to help you learn how to use this package: + +- [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). +- [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). + +## Examples + +Code samples for using the management library for .NET can be found in the following locations +- [.NET Management Library Code Samples](https://aka.ms/azuresdk-net-mgmt-samples) + +## Troubleshooting + +- File an issue via [GitHub Issues](https://github.com/Azure/azure-sdk-for-net/issues). +- Check [previous questions](https://stackoverflow.com/questions/tagged/azure+.net) or ask new ones on Stack Overflow using Azure and .NET tags. + +## Next steps + +For more information about Microsoft Azure SDK, see [this website](https://azure.github.io/azure-sdk/). + +## Contributing + +For details on contributing to this repository, see the [contributing +guide][cg]. + +This project welcomes contributions and suggestions. Most contributions +require you to agree to a Contributor License Agreement (CLA) declaring +that you have the right to, and actually do, grant us the rights to use +your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine +whether you need to provide a CLA and decorate the PR appropriately +(for example, label, comment). Follow the instructions provided by the +bot. You'll only need to do this action once across all repositories +using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For +more information, see the [Code of Conduct FAQ][coc_faq] or contact + with any other questions or comments. + + +[cg]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ \ No newline at end of file diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/api/Azure.ResourceManager.ContainerServiceFleet.net8.0.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/api/Azure.ResourceManager.ContainerServiceFleet.net8.0.cs new file mode 100644 index 000000000000..8aba60e9f6ff --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/api/Azure.ResourceManager.ContainerServiceFleet.net8.0.cs @@ -0,0 +1,922 @@ +namespace Azure.ResourceManager.ContainerServiceFleet +{ + public partial class AutoUpgradeProfileCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected AutoUpgradeProfileCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string autoUpgradeProfileName, Azure.ResourceManager.ContainerServiceFleet.AutoUpgradeProfileData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string autoUpgradeProfileName, Azure.ResourceManager.ContainerServiceFleet.AutoUpgradeProfileData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string autoUpgradeProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string autoUpgradeProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string autoUpgradeProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string autoUpgradeProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string autoUpgradeProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string autoUpgradeProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class AutoUpgradeProfileData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AutoUpgradeProfileData() { } + public Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeProfileStatus AutoUpgradeProfileStatus { get { throw null; } set { } } + public Azure.ResourceManager.ContainerServiceFleet.Models.UpgradeChannel? Channel { get { throw null; } set { } } + public bool? Disabled { get { throw null; } set { } } + public string ETag { get { throw null; } } + public Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeNodeImageSelectionType? NodeImageSelectionType { get { throw null; } set { } } + public Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeProfileProvisioningState? ProvisioningState { get { throw null; } } + public Azure.Core.ResourceIdentifier UpdateStrategyId { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.AutoUpgradeProfileData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.AutoUpgradeProfileData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AutoUpgradeProfileResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AutoUpgradeProfileResource() { } + public virtual Azure.ResourceManager.ContainerServiceFleet.AutoUpgradeProfileData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string autoUpgradeProfileName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation GenerateUpdateRunAutoUpgradeProfileOperation(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GenerateUpdateRunAutoUpgradeProfileOperationAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ContainerServiceFleet.AutoUpgradeProfileData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.AutoUpgradeProfileData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerServiceFleet.AutoUpgradeProfileData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerServiceFleet.AutoUpgradeProfileData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public static partial class ContainerServiceFleetExtensions + { + public static Azure.ResourceManager.ContainerServiceFleet.AutoUpgradeProfileResource GetAutoUpgradeProfileResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetFleet(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetFleetAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.FleetMemberResource GetFleetMemberResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.FleetResource GetFleetResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.FleetCollection GetFleets(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetFleets(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetFleetsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.FleetUpdateStrategyResource GetFleetUpdateStrategyResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.UpdateRunResource GetUpdateRunResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class FleetCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FleetCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string fleetName, Azure.ResourceManager.ContainerServiceFleet.FleetData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string fleetName, Azure.ResourceManager.ContainerServiceFleet.FleetData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FleetData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetData(Azure.Core.AzureLocation location) { } + public string ETag { get { throw null; } } + public Azure.ResourceManager.ContainerServiceFleet.Models.FleetHubProfile HubProfile { get { throw null; } set { } } + public Azure.ResourceManager.ContainerServiceFleet.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.ContainerServiceFleet.Models.FleetProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.ContainerServiceFleet.Models.FleetStatus Status { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.FleetData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.FleetData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetMemberCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FleetMemberCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string fleetMemberName, Azure.ResourceManager.ContainerServiceFleet.FleetMemberData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string fleetMemberName, Azure.ResourceManager.ContainerServiceFleet.FleetMemberData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string fleetMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string fleetMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string fleetMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string fleetMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string fleetMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string fleetMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FleetMemberData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetMemberData() { } + public Azure.Core.ResourceIdentifier ClusterResourceId { get { throw null; } set { } } + public string ETag { get { throw null; } } + public string Group { get { throw null; } set { } } + public Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberStatus Status { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.FleetMemberData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.FleetMemberData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetMemberResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FleetMemberResource() { } + public virtual Azure.ResourceManager.ContainerServiceFleet.FleetMemberData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string fleetMemberName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ContainerServiceFleet.FleetMemberData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.FleetMemberData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberPatch patch, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberPatch patch, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class FleetResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FleetResource() { } + public virtual Azure.ResourceManager.ContainerServiceFleet.FleetData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetAutoUpgradeProfile(string autoUpgradeProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAutoUpgradeProfileAsync(string autoUpgradeProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ContainerServiceFleet.AutoUpgradeProfileCollection GetAutoUpgradeProfiles() { throw null; } + public virtual Azure.Response GetCredentials(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetCredentialsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetFleetMember(string fleetMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFleetMemberAsync(string fleetMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ContainerServiceFleet.FleetMemberCollection GetFleetMembers() { throw null; } + public virtual Azure.ResourceManager.ContainerServiceFleet.FleetUpdateStrategyCollection GetFleetUpdateStrategies() { throw null; } + public virtual Azure.Response GetFleetUpdateStrategy(string updateStrategyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFleetUpdateStrategyAsync(string updateStrategyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetUpdateRun(string updateRunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetUpdateRunAsync(string updateRunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ContainerServiceFleet.UpdateRunCollection GetUpdateRuns() { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ContainerServiceFleet.FleetData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.FleetData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerServiceFleet.Models.FleetPatch patch, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerServiceFleet.Models.FleetPatch patch, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class FleetUpdateStrategyCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FleetUpdateStrategyCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string updateStrategyName, Azure.ResourceManager.ContainerServiceFleet.FleetUpdateStrategyData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string updateStrategyName, Azure.ResourceManager.ContainerServiceFleet.FleetUpdateStrategyData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string updateStrategyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string updateStrategyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string updateStrategyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string updateStrategyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string updateStrategyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string updateStrategyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FleetUpdateStrategyData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetUpdateStrategyData() { } + public string ETag { get { throw null; } } + public Azure.ResourceManager.ContainerServiceFleet.Models.FleetUpdateStrategyProvisioningState? ProvisioningState { get { throw null; } } + public System.Collections.Generic.IList StrategyStages { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.FleetUpdateStrategyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.FleetUpdateStrategyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetUpdateStrategyResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FleetUpdateStrategyResource() { } + public virtual Azure.ResourceManager.ContainerServiceFleet.FleetUpdateStrategyData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string updateStrategyName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ContainerServiceFleet.FleetUpdateStrategyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.FleetUpdateStrategyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerServiceFleet.FleetUpdateStrategyData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerServiceFleet.FleetUpdateStrategyData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class UpdateRunCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected UpdateRunCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string updateRunName, Azure.ResourceManager.ContainerServiceFleet.UpdateRunData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string updateRunName, Azure.ResourceManager.ContainerServiceFleet.UpdateRunData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string updateRunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string updateRunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string updateRunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string updateRunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string updateRunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string updateRunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class UpdateRunData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public UpdateRunData() { } + public Azure.Core.ResourceIdentifier AutoUpgradeProfileId { get { throw null; } } + public string ETag { get { throw null; } } + public Azure.ResourceManager.ContainerServiceFleet.Models.ManagedClusterUpdate ManagedClusterUpdate { get { throw null; } set { } } + public Azure.ResourceManager.ContainerServiceFleet.Models.UpdateRunProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.ContainerServiceFleet.Models.UpdateRunStatus Status { get { throw null; } } + public System.Collections.Generic.IList StrategyStages { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier UpdateStrategyId { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.UpdateRunData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.UpdateRunData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class UpdateRunResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected UpdateRunResource() { } + public virtual Azure.ResourceManager.ContainerServiceFleet.UpdateRunData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Skip(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerServiceFleet.Models.SkipProperties body, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SkipAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerServiceFleet.Models.SkipProperties body, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Start(Azure.WaitUntil waitUntil, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> StartAsync(Azure.WaitUntil waitUntil, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Stop(Azure.WaitUntil waitUntil, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> StopAsync(Azure.WaitUntil waitUntil, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ContainerServiceFleet.UpdateRunData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.UpdateRunData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerServiceFleet.UpdateRunData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerServiceFleet.UpdateRunData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.ContainerServiceFleet.Mocking +{ + public partial class MockableContainerServiceFleetArmClient : Azure.ResourceManager.ArmResource + { + protected MockableContainerServiceFleetArmClient() { } + public virtual Azure.ResourceManager.ContainerServiceFleet.AutoUpgradeProfileResource GetAutoUpgradeProfileResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ContainerServiceFleet.FleetMemberResource GetFleetMemberResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ContainerServiceFleet.FleetResource GetFleetResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ContainerServiceFleet.FleetUpdateStrategyResource GetFleetUpdateStrategyResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ContainerServiceFleet.UpdateRunResource GetUpdateRunResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableContainerServiceFleetResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableContainerServiceFleetResourceGroupResource() { } + public virtual Azure.Response GetFleet(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFleetAsync(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ContainerServiceFleet.FleetCollection GetFleets() { throw null; } + } + public partial class MockableContainerServiceFleetSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockableContainerServiceFleetSubscriptionResource() { } + public virtual Azure.Pageable GetFleets(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetFleetsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + public partial class AgentProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AgentProfile() { } + public Azure.Core.ResourceIdentifier SubnetId { get { throw null; } set { } } + public string VmSize { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.AgentProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.AgentProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class APIServerAccessProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public APIServerAccessProfile() { } + public bool? EnablePrivateCluster { get { throw null; } set { } } + public bool? EnableVnetIntegration { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier SubnetId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.APIServerAccessProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.APIServerAccessProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public static partial class ArmContainerServiceFleetModelFactory + { + public static Azure.ResourceManager.ContainerServiceFleet.AutoUpgradeProfileData AutoUpgradeProfileData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeProfileProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeProfileProvisioningState?), Azure.Core.ResourceIdentifier updateStrategyId = null, Azure.ResourceManager.ContainerServiceFleet.Models.UpgradeChannel? channel = default(Azure.ResourceManager.ContainerServiceFleet.Models.UpgradeChannel?), Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeNodeImageSelectionType? nodeImageSelectionType = default(Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeNodeImageSelectionType?), bool? disabled = default(bool?), Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeProfileStatus autoUpgradeProfileStatus = null, string etag = null) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeProfileStatus AutoUpgradeProfileStatus(System.DateTimeOffset? lastTriggeredOn = default(System.DateTimeOffset?), Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeLastTriggerStatus? lastTriggerStatus = default(Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeLastTriggerStatus?), Azure.ResponseError lastTriggerError = null, System.Collections.Generic.IEnumerable lastTriggerUpgradeVersions = null) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetCredentialResult FleetCredentialResult(string name = null, byte[] value = null) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetCredentialResults FleetCredentialResults(System.Collections.Generic.IEnumerable kubeconfigs = null) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.FleetData FleetData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.ContainerServiceFleet.Models.FleetProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerServiceFleet.Models.FleetProvisioningState?), Azure.ResourceManager.ContainerServiceFleet.Models.FleetHubProfile hubProfile = null, Azure.ResourceManager.ContainerServiceFleet.Models.FleetStatus status = null, string etag = null, Azure.ResourceManager.ContainerServiceFleet.Models.ManagedServiceIdentity identity = null) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetHubProfile FleetHubProfile(string dnsPrefix = null, Azure.ResourceManager.ContainerServiceFleet.Models.APIServerAccessProfile apiServerAccessProfile = null, Azure.ResourceManager.ContainerServiceFleet.Models.AgentProfile agentProfile = null, string fqdn = null, string kubernetesVersion = null, string portalFqdn = null) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.FleetMemberData FleetMemberData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.ResourceIdentifier clusterResourceId = null, string group = null, Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberProvisioningState?), Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberStatus status = null, string etag = null) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberStatus FleetMemberStatus(string lastOperationId = null, Azure.ResponseError lastOperationError = null) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetStatus FleetStatus(string lastOperationId = null, Azure.ResponseError lastOperationError = null) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.FleetUpdateStrategyData FleetUpdateStrategyData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ContainerServiceFleet.Models.FleetUpdateStrategyProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerServiceFleet.Models.FleetUpdateStrategyProvisioningState?), System.Collections.Generic.IEnumerable strategyStages = null, string etag = null) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.ManagedServiceIdentity ManagedServiceIdentity(System.Guid? principalId = default(System.Guid?), System.Guid? tenantId = default(System.Guid?), Azure.ResourceManager.ContainerServiceFleet.Models.ManagedServiceIdentityType type = default(Azure.ResourceManager.ContainerServiceFleet.Models.ManagedServiceIdentityType), System.Collections.Generic.IDictionary userAssignedIdentities = null) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.MemberUpdateStatus MemberUpdateStatus(Azure.ResourceManager.ContainerServiceFleet.Models.UpdateStatus status = null, string name = null, string clusterResourceId = null, string operationId = null, string message = null) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.NodeImageVersion NodeImageVersion(string version = null) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.UpdateGroupStatus UpdateGroupStatus(Azure.ResourceManager.ContainerServiceFleet.Models.UpdateStatus status = null, string name = null, System.Collections.Generic.IEnumerable members = null) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.UpdateRunData UpdateRunData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ContainerServiceFleet.Models.UpdateRunProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerServiceFleet.Models.UpdateRunProvisioningState?), Azure.Core.ResourceIdentifier updateStrategyId = null, System.Collections.Generic.IEnumerable strategyStages = null, Azure.ResourceManager.ContainerServiceFleet.Models.ManagedClusterUpdate managedClusterUpdate = null, Azure.ResourceManager.ContainerServiceFleet.Models.UpdateRunStatus status = null, Azure.Core.ResourceIdentifier autoUpgradeProfileId = null, string etag = null) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.UpdateRunStatus UpdateRunStatus(Azure.ResourceManager.ContainerServiceFleet.Models.UpdateStatus status = null, System.Collections.Generic.IEnumerable stages = null, System.Collections.Generic.IEnumerable selectedNodeImageVersions = null) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.UpdateStageStatus UpdateStageStatus(Azure.ResourceManager.ContainerServiceFleet.Models.UpdateStatus status = null, string name = null, System.Collections.Generic.IEnumerable groups = null, Azure.ResourceManager.ContainerServiceFleet.Models.WaitStatus afterStageWaitStatus = null) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.UpdateStatus UpdateStatus(System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? completedOn = default(System.DateTimeOffset?), Azure.ResourceManager.ContainerServiceFleet.Models.UpdateState? state = default(Azure.ResourceManager.ContainerServiceFleet.Models.UpdateState?), Azure.ResponseError error = null) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.WaitStatus WaitStatus(Azure.ResourceManager.ContainerServiceFleet.Models.UpdateStatus status = null, int? waitDurationInSeconds = default(int?)) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AutoUpgradeLastTriggerStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AutoUpgradeLastTriggerStatus(string value) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeLastTriggerStatus Failed { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeLastTriggerStatus Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeLastTriggerStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeLastTriggerStatus left, Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeLastTriggerStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeLastTriggerStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeLastTriggerStatus left, Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeLastTriggerStatus right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AutoUpgradeNodeImageSelectionType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AutoUpgradeNodeImageSelectionType(string value) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeNodeImageSelectionType Consistent { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeNodeImageSelectionType Latest { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeNodeImageSelectionType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeNodeImageSelectionType left, Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeNodeImageSelectionType right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeNodeImageSelectionType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeNodeImageSelectionType left, Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeNodeImageSelectionType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AutoUpgradeProfileProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AutoUpgradeProfileProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeProfileProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeProfileProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeProfileProvisioningState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeProfileProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeProfileProvisioningState left, Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeProfileProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeProfileProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeProfileProvisioningState left, Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeProfileProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class AutoUpgradeProfileStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AutoUpgradeProfileStatus() { } + public System.DateTimeOffset? LastTriggeredOn { get { throw null; } } + public Azure.ResponseError LastTriggerError { get { throw null; } } + public Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeLastTriggerStatus? LastTriggerStatus { get { throw null; } } + public System.Collections.Generic.IReadOnlyList LastTriggerUpgradeVersions { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeProfileStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeProfileStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetCredentialResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal FleetCredentialResult() { } + public string Name { get { throw null; } } + public byte[] Value { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.FleetCredentialResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.FleetCredentialResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetCredentialResults : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal FleetCredentialResults() { } + public System.Collections.Generic.IReadOnlyList Kubeconfigs { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.FleetCredentialResults System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.FleetCredentialResults System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetHubProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetHubProfile() { } + public Azure.ResourceManager.ContainerServiceFleet.Models.AgentProfile AgentProfile { get { throw null; } set { } } + public Azure.ResourceManager.ContainerServiceFleet.Models.APIServerAccessProfile ApiServerAccessProfile { get { throw null; } set { } } + public string DnsPrefix { get { throw null; } set { } } + public string Fqdn { get { throw null; } } + public string KubernetesVersion { get { throw null; } } + public string PortalFqdn { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.FleetHubProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.FleetHubProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetMemberPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetMemberPatch() { } + public string Group { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct FleetMemberProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public FleetMemberProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberProvisioningState Joining { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberProvisioningState Leaving { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberProvisioningState left, Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberProvisioningState left, Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class FleetMemberStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal FleetMemberStatus() { } + public Azure.ResponseError LastOperationError { get { throw null; } } + public string LastOperationId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetPatch() { } + public Azure.ResourceManager.ContainerServiceFleet.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.FleetPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.FleetPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct FleetProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public FleetProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetProvisioningState Creating { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerServiceFleet.Models.FleetProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerServiceFleet.Models.FleetProvisioningState left, Azure.ResourceManager.ContainerServiceFleet.Models.FleetProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerServiceFleet.Models.FleetProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerServiceFleet.Models.FleetProvisioningState left, Azure.ResourceManager.ContainerServiceFleet.Models.FleetProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class FleetStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal FleetStatus() { } + public Azure.ResponseError LastOperationError { get { throw null; } } + public string LastOperationId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.FleetStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.FleetStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct FleetUpdateStrategyProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public FleetUpdateStrategyProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetUpdateStrategyProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetUpdateStrategyProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetUpdateStrategyProvisioningState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerServiceFleet.Models.FleetUpdateStrategyProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerServiceFleet.Models.FleetUpdateStrategyProvisioningState left, Azure.ResourceManager.ContainerServiceFleet.Models.FleetUpdateStrategyProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerServiceFleet.Models.FleetUpdateStrategyProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerServiceFleet.Models.FleetUpdateStrategyProvisioningState left, Azure.ResourceManager.ContainerServiceFleet.Models.FleetUpdateStrategyProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ManagedClusterUpdate : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ManagedClusterUpdate(Azure.ResourceManager.ContainerServiceFleet.Models.ManagedClusterUpgradeSpec upgrade) { } + public Azure.ResourceManager.ContainerServiceFleet.Models.NodeImageSelection NodeImageSelection { get { throw null; } set { } } + public Azure.ResourceManager.ContainerServiceFleet.Models.ManagedClusterUpgradeSpec Upgrade { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.ManagedClusterUpdate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.ManagedClusterUpdate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ManagedClusterUpgradeSpec : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ManagedClusterUpgradeSpec(Azure.ResourceManager.ContainerServiceFleet.Models.ManagedClusterUpgradeType type) { } + public string KubernetesVersion { get { throw null; } set { } } + public Azure.ResourceManager.ContainerServiceFleet.Models.ManagedClusterUpgradeType Type { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.ManagedClusterUpgradeSpec System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.ManagedClusterUpgradeSpec System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ManagedClusterUpgradeType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ManagedClusterUpgradeType(string value) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.ManagedClusterUpgradeType ControlPlaneOnly { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.ManagedClusterUpgradeType Full { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.ManagedClusterUpgradeType NodeImageOnly { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerServiceFleet.Models.ManagedClusterUpgradeType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerServiceFleet.Models.ManagedClusterUpgradeType left, Azure.ResourceManager.ContainerServiceFleet.Models.ManagedClusterUpgradeType right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerServiceFleet.Models.ManagedClusterUpgradeType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerServiceFleet.Models.ManagedClusterUpgradeType left, Azure.ResourceManager.ContainerServiceFleet.Models.ManagedClusterUpgradeType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ManagedServiceIdentity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ManagedServiceIdentity(Azure.ResourceManager.ContainerServiceFleet.Models.ManagedServiceIdentityType type) { } + public System.Guid? PrincipalId { get { throw null; } } + public System.Guid? TenantId { get { throw null; } } + public Azure.ResourceManager.ContainerServiceFleet.Models.ManagedServiceIdentityType Type { get { throw null; } set { } } + public System.Collections.Generic.IDictionary UserAssignedIdentities { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.ManagedServiceIdentity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.ManagedServiceIdentity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ManagedServiceIdentityType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ManagedServiceIdentityType(string value) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.ManagedServiceIdentityType None { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.ManagedServiceIdentityType SystemAndUserAssigned { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.ManagedServiceIdentityType SystemAssigned { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.ManagedServiceIdentityType UserAssigned { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerServiceFleet.Models.ManagedServiceIdentityType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerServiceFleet.Models.ManagedServiceIdentityType left, Azure.ResourceManager.ContainerServiceFleet.Models.ManagedServiceIdentityType right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerServiceFleet.Models.ManagedServiceIdentityType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerServiceFleet.Models.ManagedServiceIdentityType left, Azure.ResourceManager.ContainerServiceFleet.Models.ManagedServiceIdentityType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class MemberUpdateStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MemberUpdateStatus() { } + public string ClusterResourceId { get { throw null; } } + public string Message { get { throw null; } } + public string Name { get { throw null; } } + public string OperationId { get { throw null; } } + public Azure.ResourceManager.ContainerServiceFleet.Models.UpdateStatus Status { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.MemberUpdateStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.MemberUpdateStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NodeImageSelection : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NodeImageSelection(Azure.ResourceManager.ContainerServiceFleet.Models.NodeImageSelectionType type) { } + public System.Collections.Generic.IList CustomNodeImageVersions { get { throw null; } } + public Azure.ResourceManager.ContainerServiceFleet.Models.NodeImageSelectionType Type { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.NodeImageSelection System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.NodeImageSelection System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct NodeImageSelectionType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public NodeImageSelectionType(string value) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.NodeImageSelectionType Consistent { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.NodeImageSelectionType Custom { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.NodeImageSelectionType Latest { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerServiceFleet.Models.NodeImageSelectionType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerServiceFleet.Models.NodeImageSelectionType left, Azure.ResourceManager.ContainerServiceFleet.Models.NodeImageSelectionType right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerServiceFleet.Models.NodeImageSelectionType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerServiceFleet.Models.NodeImageSelectionType left, Azure.ResourceManager.ContainerServiceFleet.Models.NodeImageSelectionType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class NodeImageVersion : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NodeImageVersion() { } + public string Version { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.NodeImageVersion System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.NodeImageVersion System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SkipProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SkipProperties(System.Collections.Generic.IEnumerable targets) { } + public System.Collections.Generic.IList Targets { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.SkipProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.SkipProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SkipTarget : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SkipTarget(Azure.ResourceManager.ContainerServiceFleet.Models.TargetType type, string name) { } + public string Name { get { throw null; } } + public Azure.ResourceManager.ContainerServiceFleet.Models.TargetType Type { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.SkipTarget System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.SkipTarget System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct TargetType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public TargetType(string value) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.TargetType AfterStageWait { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.TargetType Group { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.TargetType Member { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.TargetType Stage { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerServiceFleet.Models.TargetType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerServiceFleet.Models.TargetType left, Azure.ResourceManager.ContainerServiceFleet.Models.TargetType right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerServiceFleet.Models.TargetType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerServiceFleet.Models.TargetType left, Azure.ResourceManager.ContainerServiceFleet.Models.TargetType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class UpdateGroup : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public UpdateGroup(string name) { } + public string Name { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.UpdateGroup System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.UpdateGroup System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class UpdateGroupStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal UpdateGroupStatus() { } + public System.Collections.Generic.IReadOnlyList Members { get { throw null; } } + public string Name { get { throw null; } } + public Azure.ResourceManager.ContainerServiceFleet.Models.UpdateStatus Status { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.UpdateGroupStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.UpdateGroupStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct UpdateRunProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public UpdateRunProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.UpdateRunProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.UpdateRunProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.UpdateRunProvisioningState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerServiceFleet.Models.UpdateRunProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerServiceFleet.Models.UpdateRunProvisioningState left, Azure.ResourceManager.ContainerServiceFleet.Models.UpdateRunProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerServiceFleet.Models.UpdateRunProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerServiceFleet.Models.UpdateRunProvisioningState left, Azure.ResourceManager.ContainerServiceFleet.Models.UpdateRunProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class UpdateRunStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal UpdateRunStatus() { } + public System.Collections.Generic.IReadOnlyList SelectedNodeImageVersions { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Stages { get { throw null; } } + public Azure.ResourceManager.ContainerServiceFleet.Models.UpdateStatus Status { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.UpdateRunStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.UpdateRunStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class UpdateStage : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public UpdateStage(string name) { } + public int? AfterStageWaitInSeconds { get { throw null; } set { } } + public System.Collections.Generic.IList Groups { get { throw null; } } + public string Name { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.UpdateStage System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.UpdateStage System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class UpdateStageStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal UpdateStageStatus() { } + public Azure.ResourceManager.ContainerServiceFleet.Models.WaitStatus AfterStageWaitStatus { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Groups { get { throw null; } } + public string Name { get { throw null; } } + public Azure.ResourceManager.ContainerServiceFleet.Models.UpdateStatus Status { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.UpdateStageStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.UpdateStageStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct UpdateState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public UpdateState(string value) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.UpdateState Completed { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.UpdateState Failed { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.UpdateState NotStarted { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.UpdateState Running { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.UpdateState Skipped { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.UpdateState Stopped { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.UpdateState Stopping { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerServiceFleet.Models.UpdateState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerServiceFleet.Models.UpdateState left, Azure.ResourceManager.ContainerServiceFleet.Models.UpdateState right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerServiceFleet.Models.UpdateState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerServiceFleet.Models.UpdateState left, Azure.ResourceManager.ContainerServiceFleet.Models.UpdateState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class UpdateStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal UpdateStatus() { } + public System.DateTimeOffset? CompletedOn { get { throw null; } } + public Azure.ResponseError Error { get { throw null; } } + public System.DateTimeOffset? StartOn { get { throw null; } } + public Azure.ResourceManager.ContainerServiceFleet.Models.UpdateState? State { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.UpdateStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.UpdateStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct UpgradeChannel : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public UpgradeChannel(string value) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.UpgradeChannel NodeImage { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.UpgradeChannel Rapid { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.UpgradeChannel Stable { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerServiceFleet.Models.UpgradeChannel other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerServiceFleet.Models.UpgradeChannel left, Azure.ResourceManager.ContainerServiceFleet.Models.UpgradeChannel right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerServiceFleet.Models.UpgradeChannel (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerServiceFleet.Models.UpgradeChannel left, Azure.ResourceManager.ContainerServiceFleet.Models.UpgradeChannel right) { throw null; } + public override string ToString() { throw null; } + } + public partial class WaitStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal WaitStatus() { } + public Azure.ResourceManager.ContainerServiceFleet.Models.UpdateStatus Status { get { throw null; } } + public int? WaitDurationInSeconds { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.WaitStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.WaitStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/api/Azure.ResourceManager.ContainerServiceFleet.netstandard2.0.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/api/Azure.ResourceManager.ContainerServiceFleet.netstandard2.0.cs new file mode 100644 index 000000000000..8aba60e9f6ff --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/api/Azure.ResourceManager.ContainerServiceFleet.netstandard2.0.cs @@ -0,0 +1,922 @@ +namespace Azure.ResourceManager.ContainerServiceFleet +{ + public partial class AutoUpgradeProfileCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected AutoUpgradeProfileCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string autoUpgradeProfileName, Azure.ResourceManager.ContainerServiceFleet.AutoUpgradeProfileData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string autoUpgradeProfileName, Azure.ResourceManager.ContainerServiceFleet.AutoUpgradeProfileData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string autoUpgradeProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string autoUpgradeProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string autoUpgradeProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string autoUpgradeProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string autoUpgradeProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string autoUpgradeProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class AutoUpgradeProfileData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AutoUpgradeProfileData() { } + public Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeProfileStatus AutoUpgradeProfileStatus { get { throw null; } set { } } + public Azure.ResourceManager.ContainerServiceFleet.Models.UpgradeChannel? Channel { get { throw null; } set { } } + public bool? Disabled { get { throw null; } set { } } + public string ETag { get { throw null; } } + public Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeNodeImageSelectionType? NodeImageSelectionType { get { throw null; } set { } } + public Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeProfileProvisioningState? ProvisioningState { get { throw null; } } + public Azure.Core.ResourceIdentifier UpdateStrategyId { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.AutoUpgradeProfileData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.AutoUpgradeProfileData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AutoUpgradeProfileResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AutoUpgradeProfileResource() { } + public virtual Azure.ResourceManager.ContainerServiceFleet.AutoUpgradeProfileData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string autoUpgradeProfileName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation GenerateUpdateRunAutoUpgradeProfileOperation(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GenerateUpdateRunAutoUpgradeProfileOperationAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ContainerServiceFleet.AutoUpgradeProfileData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.AutoUpgradeProfileData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerServiceFleet.AutoUpgradeProfileData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerServiceFleet.AutoUpgradeProfileData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public static partial class ContainerServiceFleetExtensions + { + public static Azure.ResourceManager.ContainerServiceFleet.AutoUpgradeProfileResource GetAutoUpgradeProfileResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetFleet(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetFleetAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.FleetMemberResource GetFleetMemberResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.FleetResource GetFleetResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.FleetCollection GetFleets(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetFleets(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetFleetsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.FleetUpdateStrategyResource GetFleetUpdateStrategyResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.UpdateRunResource GetUpdateRunResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class FleetCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FleetCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string fleetName, Azure.ResourceManager.ContainerServiceFleet.FleetData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string fleetName, Azure.ResourceManager.ContainerServiceFleet.FleetData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FleetData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetData(Azure.Core.AzureLocation location) { } + public string ETag { get { throw null; } } + public Azure.ResourceManager.ContainerServiceFleet.Models.FleetHubProfile HubProfile { get { throw null; } set { } } + public Azure.ResourceManager.ContainerServiceFleet.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.ContainerServiceFleet.Models.FleetProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.ContainerServiceFleet.Models.FleetStatus Status { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.FleetData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.FleetData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetMemberCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FleetMemberCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string fleetMemberName, Azure.ResourceManager.ContainerServiceFleet.FleetMemberData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string fleetMemberName, Azure.ResourceManager.ContainerServiceFleet.FleetMemberData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string fleetMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string fleetMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string fleetMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string fleetMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string fleetMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string fleetMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FleetMemberData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetMemberData() { } + public Azure.Core.ResourceIdentifier ClusterResourceId { get { throw null; } set { } } + public string ETag { get { throw null; } } + public string Group { get { throw null; } set { } } + public Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberStatus Status { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.FleetMemberData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.FleetMemberData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetMemberResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FleetMemberResource() { } + public virtual Azure.ResourceManager.ContainerServiceFleet.FleetMemberData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string fleetMemberName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ContainerServiceFleet.FleetMemberData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.FleetMemberData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberPatch patch, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberPatch patch, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class FleetResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FleetResource() { } + public virtual Azure.ResourceManager.ContainerServiceFleet.FleetData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetAutoUpgradeProfile(string autoUpgradeProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAutoUpgradeProfileAsync(string autoUpgradeProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ContainerServiceFleet.AutoUpgradeProfileCollection GetAutoUpgradeProfiles() { throw null; } + public virtual Azure.Response GetCredentials(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetCredentialsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetFleetMember(string fleetMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFleetMemberAsync(string fleetMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ContainerServiceFleet.FleetMemberCollection GetFleetMembers() { throw null; } + public virtual Azure.ResourceManager.ContainerServiceFleet.FleetUpdateStrategyCollection GetFleetUpdateStrategies() { throw null; } + public virtual Azure.Response GetFleetUpdateStrategy(string updateStrategyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFleetUpdateStrategyAsync(string updateStrategyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetUpdateRun(string updateRunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetUpdateRunAsync(string updateRunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ContainerServiceFleet.UpdateRunCollection GetUpdateRuns() { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ContainerServiceFleet.FleetData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.FleetData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerServiceFleet.Models.FleetPatch patch, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerServiceFleet.Models.FleetPatch patch, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class FleetUpdateStrategyCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FleetUpdateStrategyCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string updateStrategyName, Azure.ResourceManager.ContainerServiceFleet.FleetUpdateStrategyData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string updateStrategyName, Azure.ResourceManager.ContainerServiceFleet.FleetUpdateStrategyData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string updateStrategyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string updateStrategyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string updateStrategyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string updateStrategyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string updateStrategyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string updateStrategyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FleetUpdateStrategyData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetUpdateStrategyData() { } + public string ETag { get { throw null; } } + public Azure.ResourceManager.ContainerServiceFleet.Models.FleetUpdateStrategyProvisioningState? ProvisioningState { get { throw null; } } + public System.Collections.Generic.IList StrategyStages { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.FleetUpdateStrategyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.FleetUpdateStrategyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetUpdateStrategyResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FleetUpdateStrategyResource() { } + public virtual Azure.ResourceManager.ContainerServiceFleet.FleetUpdateStrategyData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string updateStrategyName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ContainerServiceFleet.FleetUpdateStrategyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.FleetUpdateStrategyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerServiceFleet.FleetUpdateStrategyData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerServiceFleet.FleetUpdateStrategyData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class UpdateRunCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected UpdateRunCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string updateRunName, Azure.ResourceManager.ContainerServiceFleet.UpdateRunData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string updateRunName, Azure.ResourceManager.ContainerServiceFleet.UpdateRunData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string updateRunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string updateRunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string updateRunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string updateRunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string updateRunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string updateRunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class UpdateRunData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public UpdateRunData() { } + public Azure.Core.ResourceIdentifier AutoUpgradeProfileId { get { throw null; } } + public string ETag { get { throw null; } } + public Azure.ResourceManager.ContainerServiceFleet.Models.ManagedClusterUpdate ManagedClusterUpdate { get { throw null; } set { } } + public Azure.ResourceManager.ContainerServiceFleet.Models.UpdateRunProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.ContainerServiceFleet.Models.UpdateRunStatus Status { get { throw null; } } + public System.Collections.Generic.IList StrategyStages { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier UpdateStrategyId { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.UpdateRunData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.UpdateRunData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class UpdateRunResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected UpdateRunResource() { } + public virtual Azure.ResourceManager.ContainerServiceFleet.UpdateRunData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Skip(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerServiceFleet.Models.SkipProperties body, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SkipAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerServiceFleet.Models.SkipProperties body, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Start(Azure.WaitUntil waitUntil, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> StartAsync(Azure.WaitUntil waitUntil, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Stop(Azure.WaitUntil waitUntil, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> StopAsync(Azure.WaitUntil waitUntil, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ContainerServiceFleet.UpdateRunData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.UpdateRunData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerServiceFleet.UpdateRunData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerServiceFleet.UpdateRunData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.ContainerServiceFleet.Mocking +{ + public partial class MockableContainerServiceFleetArmClient : Azure.ResourceManager.ArmResource + { + protected MockableContainerServiceFleetArmClient() { } + public virtual Azure.ResourceManager.ContainerServiceFleet.AutoUpgradeProfileResource GetAutoUpgradeProfileResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ContainerServiceFleet.FleetMemberResource GetFleetMemberResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ContainerServiceFleet.FleetResource GetFleetResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ContainerServiceFleet.FleetUpdateStrategyResource GetFleetUpdateStrategyResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ContainerServiceFleet.UpdateRunResource GetUpdateRunResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableContainerServiceFleetResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableContainerServiceFleetResourceGroupResource() { } + public virtual Azure.Response GetFleet(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFleetAsync(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ContainerServiceFleet.FleetCollection GetFleets() { throw null; } + } + public partial class MockableContainerServiceFleetSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockableContainerServiceFleetSubscriptionResource() { } + public virtual Azure.Pageable GetFleets(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetFleetsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + public partial class AgentProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AgentProfile() { } + public Azure.Core.ResourceIdentifier SubnetId { get { throw null; } set { } } + public string VmSize { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.AgentProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.AgentProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class APIServerAccessProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public APIServerAccessProfile() { } + public bool? EnablePrivateCluster { get { throw null; } set { } } + public bool? EnableVnetIntegration { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier SubnetId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.APIServerAccessProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.APIServerAccessProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public static partial class ArmContainerServiceFleetModelFactory + { + public static Azure.ResourceManager.ContainerServiceFleet.AutoUpgradeProfileData AutoUpgradeProfileData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeProfileProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeProfileProvisioningState?), Azure.Core.ResourceIdentifier updateStrategyId = null, Azure.ResourceManager.ContainerServiceFleet.Models.UpgradeChannel? channel = default(Azure.ResourceManager.ContainerServiceFleet.Models.UpgradeChannel?), Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeNodeImageSelectionType? nodeImageSelectionType = default(Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeNodeImageSelectionType?), bool? disabled = default(bool?), Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeProfileStatus autoUpgradeProfileStatus = null, string etag = null) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeProfileStatus AutoUpgradeProfileStatus(System.DateTimeOffset? lastTriggeredOn = default(System.DateTimeOffset?), Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeLastTriggerStatus? lastTriggerStatus = default(Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeLastTriggerStatus?), Azure.ResponseError lastTriggerError = null, System.Collections.Generic.IEnumerable lastTriggerUpgradeVersions = null) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetCredentialResult FleetCredentialResult(string name = null, byte[] value = null) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetCredentialResults FleetCredentialResults(System.Collections.Generic.IEnumerable kubeconfigs = null) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.FleetData FleetData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.ContainerServiceFleet.Models.FleetProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerServiceFleet.Models.FleetProvisioningState?), Azure.ResourceManager.ContainerServiceFleet.Models.FleetHubProfile hubProfile = null, Azure.ResourceManager.ContainerServiceFleet.Models.FleetStatus status = null, string etag = null, Azure.ResourceManager.ContainerServiceFleet.Models.ManagedServiceIdentity identity = null) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetHubProfile FleetHubProfile(string dnsPrefix = null, Azure.ResourceManager.ContainerServiceFleet.Models.APIServerAccessProfile apiServerAccessProfile = null, Azure.ResourceManager.ContainerServiceFleet.Models.AgentProfile agentProfile = null, string fqdn = null, string kubernetesVersion = null, string portalFqdn = null) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.FleetMemberData FleetMemberData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.ResourceIdentifier clusterResourceId = null, string group = null, Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberProvisioningState?), Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberStatus status = null, string etag = null) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberStatus FleetMemberStatus(string lastOperationId = null, Azure.ResponseError lastOperationError = null) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetStatus FleetStatus(string lastOperationId = null, Azure.ResponseError lastOperationError = null) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.FleetUpdateStrategyData FleetUpdateStrategyData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ContainerServiceFleet.Models.FleetUpdateStrategyProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerServiceFleet.Models.FleetUpdateStrategyProvisioningState?), System.Collections.Generic.IEnumerable strategyStages = null, string etag = null) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.ManagedServiceIdentity ManagedServiceIdentity(System.Guid? principalId = default(System.Guid?), System.Guid? tenantId = default(System.Guid?), Azure.ResourceManager.ContainerServiceFleet.Models.ManagedServiceIdentityType type = default(Azure.ResourceManager.ContainerServiceFleet.Models.ManagedServiceIdentityType), System.Collections.Generic.IDictionary userAssignedIdentities = null) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.MemberUpdateStatus MemberUpdateStatus(Azure.ResourceManager.ContainerServiceFleet.Models.UpdateStatus status = null, string name = null, string clusterResourceId = null, string operationId = null, string message = null) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.NodeImageVersion NodeImageVersion(string version = null) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.UpdateGroupStatus UpdateGroupStatus(Azure.ResourceManager.ContainerServiceFleet.Models.UpdateStatus status = null, string name = null, System.Collections.Generic.IEnumerable members = null) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.UpdateRunData UpdateRunData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ContainerServiceFleet.Models.UpdateRunProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerServiceFleet.Models.UpdateRunProvisioningState?), Azure.Core.ResourceIdentifier updateStrategyId = null, System.Collections.Generic.IEnumerable strategyStages = null, Azure.ResourceManager.ContainerServiceFleet.Models.ManagedClusterUpdate managedClusterUpdate = null, Azure.ResourceManager.ContainerServiceFleet.Models.UpdateRunStatus status = null, Azure.Core.ResourceIdentifier autoUpgradeProfileId = null, string etag = null) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.UpdateRunStatus UpdateRunStatus(Azure.ResourceManager.ContainerServiceFleet.Models.UpdateStatus status = null, System.Collections.Generic.IEnumerable stages = null, System.Collections.Generic.IEnumerable selectedNodeImageVersions = null) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.UpdateStageStatus UpdateStageStatus(Azure.ResourceManager.ContainerServiceFleet.Models.UpdateStatus status = null, string name = null, System.Collections.Generic.IEnumerable groups = null, Azure.ResourceManager.ContainerServiceFleet.Models.WaitStatus afterStageWaitStatus = null) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.UpdateStatus UpdateStatus(System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? completedOn = default(System.DateTimeOffset?), Azure.ResourceManager.ContainerServiceFleet.Models.UpdateState? state = default(Azure.ResourceManager.ContainerServiceFleet.Models.UpdateState?), Azure.ResponseError error = null) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.WaitStatus WaitStatus(Azure.ResourceManager.ContainerServiceFleet.Models.UpdateStatus status = null, int? waitDurationInSeconds = default(int?)) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AutoUpgradeLastTriggerStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AutoUpgradeLastTriggerStatus(string value) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeLastTriggerStatus Failed { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeLastTriggerStatus Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeLastTriggerStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeLastTriggerStatus left, Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeLastTriggerStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeLastTriggerStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeLastTriggerStatus left, Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeLastTriggerStatus right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AutoUpgradeNodeImageSelectionType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AutoUpgradeNodeImageSelectionType(string value) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeNodeImageSelectionType Consistent { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeNodeImageSelectionType Latest { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeNodeImageSelectionType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeNodeImageSelectionType left, Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeNodeImageSelectionType right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeNodeImageSelectionType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeNodeImageSelectionType left, Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeNodeImageSelectionType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AutoUpgradeProfileProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AutoUpgradeProfileProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeProfileProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeProfileProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeProfileProvisioningState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeProfileProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeProfileProvisioningState left, Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeProfileProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeProfileProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeProfileProvisioningState left, Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeProfileProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class AutoUpgradeProfileStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AutoUpgradeProfileStatus() { } + public System.DateTimeOffset? LastTriggeredOn { get { throw null; } } + public Azure.ResponseError LastTriggerError { get { throw null; } } + public Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeLastTriggerStatus? LastTriggerStatus { get { throw null; } } + public System.Collections.Generic.IReadOnlyList LastTriggerUpgradeVersions { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeProfileStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeProfileStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetCredentialResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal FleetCredentialResult() { } + public string Name { get { throw null; } } + public byte[] Value { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.FleetCredentialResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.FleetCredentialResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetCredentialResults : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal FleetCredentialResults() { } + public System.Collections.Generic.IReadOnlyList Kubeconfigs { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.FleetCredentialResults System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.FleetCredentialResults System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetHubProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetHubProfile() { } + public Azure.ResourceManager.ContainerServiceFleet.Models.AgentProfile AgentProfile { get { throw null; } set { } } + public Azure.ResourceManager.ContainerServiceFleet.Models.APIServerAccessProfile ApiServerAccessProfile { get { throw null; } set { } } + public string DnsPrefix { get { throw null; } set { } } + public string Fqdn { get { throw null; } } + public string KubernetesVersion { get { throw null; } } + public string PortalFqdn { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.FleetHubProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.FleetHubProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetMemberPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetMemberPatch() { } + public string Group { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct FleetMemberProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public FleetMemberProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberProvisioningState Joining { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberProvisioningState Leaving { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberProvisioningState left, Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberProvisioningState left, Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class FleetMemberStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal FleetMemberStatus() { } + public Azure.ResponseError LastOperationError { get { throw null; } } + public string LastOperationId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetPatch() { } + public Azure.ResourceManager.ContainerServiceFleet.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.FleetPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.FleetPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct FleetProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public FleetProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetProvisioningState Creating { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerServiceFleet.Models.FleetProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerServiceFleet.Models.FleetProvisioningState left, Azure.ResourceManager.ContainerServiceFleet.Models.FleetProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerServiceFleet.Models.FleetProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerServiceFleet.Models.FleetProvisioningState left, Azure.ResourceManager.ContainerServiceFleet.Models.FleetProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class FleetStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal FleetStatus() { } + public Azure.ResponseError LastOperationError { get { throw null; } } + public string LastOperationId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.FleetStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.FleetStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct FleetUpdateStrategyProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public FleetUpdateStrategyProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetUpdateStrategyProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetUpdateStrategyProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetUpdateStrategyProvisioningState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerServiceFleet.Models.FleetUpdateStrategyProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerServiceFleet.Models.FleetUpdateStrategyProvisioningState left, Azure.ResourceManager.ContainerServiceFleet.Models.FleetUpdateStrategyProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerServiceFleet.Models.FleetUpdateStrategyProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerServiceFleet.Models.FleetUpdateStrategyProvisioningState left, Azure.ResourceManager.ContainerServiceFleet.Models.FleetUpdateStrategyProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ManagedClusterUpdate : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ManagedClusterUpdate(Azure.ResourceManager.ContainerServiceFleet.Models.ManagedClusterUpgradeSpec upgrade) { } + public Azure.ResourceManager.ContainerServiceFleet.Models.NodeImageSelection NodeImageSelection { get { throw null; } set { } } + public Azure.ResourceManager.ContainerServiceFleet.Models.ManagedClusterUpgradeSpec Upgrade { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.ManagedClusterUpdate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.ManagedClusterUpdate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ManagedClusterUpgradeSpec : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ManagedClusterUpgradeSpec(Azure.ResourceManager.ContainerServiceFleet.Models.ManagedClusterUpgradeType type) { } + public string KubernetesVersion { get { throw null; } set { } } + public Azure.ResourceManager.ContainerServiceFleet.Models.ManagedClusterUpgradeType Type { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.ManagedClusterUpgradeSpec System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.ManagedClusterUpgradeSpec System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ManagedClusterUpgradeType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ManagedClusterUpgradeType(string value) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.ManagedClusterUpgradeType ControlPlaneOnly { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.ManagedClusterUpgradeType Full { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.ManagedClusterUpgradeType NodeImageOnly { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerServiceFleet.Models.ManagedClusterUpgradeType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerServiceFleet.Models.ManagedClusterUpgradeType left, Azure.ResourceManager.ContainerServiceFleet.Models.ManagedClusterUpgradeType right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerServiceFleet.Models.ManagedClusterUpgradeType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerServiceFleet.Models.ManagedClusterUpgradeType left, Azure.ResourceManager.ContainerServiceFleet.Models.ManagedClusterUpgradeType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ManagedServiceIdentity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ManagedServiceIdentity(Azure.ResourceManager.ContainerServiceFleet.Models.ManagedServiceIdentityType type) { } + public System.Guid? PrincipalId { get { throw null; } } + public System.Guid? TenantId { get { throw null; } } + public Azure.ResourceManager.ContainerServiceFleet.Models.ManagedServiceIdentityType Type { get { throw null; } set { } } + public System.Collections.Generic.IDictionary UserAssignedIdentities { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.ManagedServiceIdentity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.ManagedServiceIdentity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ManagedServiceIdentityType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ManagedServiceIdentityType(string value) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.ManagedServiceIdentityType None { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.ManagedServiceIdentityType SystemAndUserAssigned { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.ManagedServiceIdentityType SystemAssigned { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.ManagedServiceIdentityType UserAssigned { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerServiceFleet.Models.ManagedServiceIdentityType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerServiceFleet.Models.ManagedServiceIdentityType left, Azure.ResourceManager.ContainerServiceFleet.Models.ManagedServiceIdentityType right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerServiceFleet.Models.ManagedServiceIdentityType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerServiceFleet.Models.ManagedServiceIdentityType left, Azure.ResourceManager.ContainerServiceFleet.Models.ManagedServiceIdentityType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class MemberUpdateStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MemberUpdateStatus() { } + public string ClusterResourceId { get { throw null; } } + public string Message { get { throw null; } } + public string Name { get { throw null; } } + public string OperationId { get { throw null; } } + public Azure.ResourceManager.ContainerServiceFleet.Models.UpdateStatus Status { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.MemberUpdateStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.MemberUpdateStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NodeImageSelection : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NodeImageSelection(Azure.ResourceManager.ContainerServiceFleet.Models.NodeImageSelectionType type) { } + public System.Collections.Generic.IList CustomNodeImageVersions { get { throw null; } } + public Azure.ResourceManager.ContainerServiceFleet.Models.NodeImageSelectionType Type { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.NodeImageSelection System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.NodeImageSelection System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct NodeImageSelectionType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public NodeImageSelectionType(string value) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.NodeImageSelectionType Consistent { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.NodeImageSelectionType Custom { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.NodeImageSelectionType Latest { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerServiceFleet.Models.NodeImageSelectionType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerServiceFleet.Models.NodeImageSelectionType left, Azure.ResourceManager.ContainerServiceFleet.Models.NodeImageSelectionType right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerServiceFleet.Models.NodeImageSelectionType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerServiceFleet.Models.NodeImageSelectionType left, Azure.ResourceManager.ContainerServiceFleet.Models.NodeImageSelectionType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class NodeImageVersion : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NodeImageVersion() { } + public string Version { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.NodeImageVersion System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.NodeImageVersion System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SkipProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SkipProperties(System.Collections.Generic.IEnumerable targets) { } + public System.Collections.Generic.IList Targets { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.SkipProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.SkipProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SkipTarget : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SkipTarget(Azure.ResourceManager.ContainerServiceFleet.Models.TargetType type, string name) { } + public string Name { get { throw null; } } + public Azure.ResourceManager.ContainerServiceFleet.Models.TargetType Type { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.SkipTarget System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.SkipTarget System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct TargetType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public TargetType(string value) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.TargetType AfterStageWait { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.TargetType Group { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.TargetType Member { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.TargetType Stage { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerServiceFleet.Models.TargetType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerServiceFleet.Models.TargetType left, Azure.ResourceManager.ContainerServiceFleet.Models.TargetType right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerServiceFleet.Models.TargetType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerServiceFleet.Models.TargetType left, Azure.ResourceManager.ContainerServiceFleet.Models.TargetType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class UpdateGroup : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public UpdateGroup(string name) { } + public string Name { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.UpdateGroup System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.UpdateGroup System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class UpdateGroupStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal UpdateGroupStatus() { } + public System.Collections.Generic.IReadOnlyList Members { get { throw null; } } + public string Name { get { throw null; } } + public Azure.ResourceManager.ContainerServiceFleet.Models.UpdateStatus Status { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.UpdateGroupStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.UpdateGroupStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct UpdateRunProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public UpdateRunProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.UpdateRunProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.UpdateRunProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.UpdateRunProvisioningState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerServiceFleet.Models.UpdateRunProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerServiceFleet.Models.UpdateRunProvisioningState left, Azure.ResourceManager.ContainerServiceFleet.Models.UpdateRunProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerServiceFleet.Models.UpdateRunProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerServiceFleet.Models.UpdateRunProvisioningState left, Azure.ResourceManager.ContainerServiceFleet.Models.UpdateRunProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class UpdateRunStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal UpdateRunStatus() { } + public System.Collections.Generic.IReadOnlyList SelectedNodeImageVersions { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Stages { get { throw null; } } + public Azure.ResourceManager.ContainerServiceFleet.Models.UpdateStatus Status { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.UpdateRunStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.UpdateRunStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class UpdateStage : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public UpdateStage(string name) { } + public int? AfterStageWaitInSeconds { get { throw null; } set { } } + public System.Collections.Generic.IList Groups { get { throw null; } } + public string Name { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.UpdateStage System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.UpdateStage System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class UpdateStageStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal UpdateStageStatus() { } + public Azure.ResourceManager.ContainerServiceFleet.Models.WaitStatus AfterStageWaitStatus { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Groups { get { throw null; } } + public string Name { get { throw null; } } + public Azure.ResourceManager.ContainerServiceFleet.Models.UpdateStatus Status { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.UpdateStageStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.UpdateStageStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct UpdateState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public UpdateState(string value) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.UpdateState Completed { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.UpdateState Failed { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.UpdateState NotStarted { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.UpdateState Running { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.UpdateState Skipped { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.UpdateState Stopped { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.UpdateState Stopping { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerServiceFleet.Models.UpdateState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerServiceFleet.Models.UpdateState left, Azure.ResourceManager.ContainerServiceFleet.Models.UpdateState right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerServiceFleet.Models.UpdateState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerServiceFleet.Models.UpdateState left, Azure.ResourceManager.ContainerServiceFleet.Models.UpdateState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class UpdateStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal UpdateStatus() { } + public System.DateTimeOffset? CompletedOn { get { throw null; } } + public Azure.ResponseError Error { get { throw null; } } + public System.DateTimeOffset? StartOn { get { throw null; } } + public Azure.ResourceManager.ContainerServiceFleet.Models.UpdateState? State { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.UpdateStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.UpdateStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct UpgradeChannel : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public UpgradeChannel(string value) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.UpgradeChannel NodeImage { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.UpgradeChannel Rapid { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.UpgradeChannel Stable { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerServiceFleet.Models.UpgradeChannel other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerServiceFleet.Models.UpgradeChannel left, Azure.ResourceManager.ContainerServiceFleet.Models.UpgradeChannel right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerServiceFleet.Models.UpgradeChannel (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerServiceFleet.Models.UpgradeChannel left, Azure.ResourceManager.ContainerServiceFleet.Models.UpgradeChannel right) { throw null; } + public override string ToString() { throw null; } + } + public partial class WaitStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal WaitStatus() { } + public Azure.ResourceManager.ContainerServiceFleet.Models.UpdateStatus Status { get { throw null; } } + public int? WaitDurationInSeconds { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.WaitStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.WaitStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/assets.json b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/assets.json new file mode 100644 index 000000000000..042d219548c0 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/assets.json @@ -0,0 +1,7 @@ + +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "net", + "TagPrefix": "net/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet", + "Tag": "" +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/samples/Azure.ResourceManager.ContainerServiceFleet.Samples.csproj b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/samples/Azure.ResourceManager.ContainerServiceFleet.Samples.csproj new file mode 100644 index 000000000000..8d3155157077 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/samples/Azure.ResourceManager.ContainerServiceFleet.Samples.csproj @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_AutoUpgradeProfileCollection.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_AutoUpgradeProfileCollection.cs new file mode 100644 index 000000000000..1a2b376addcc --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_AutoUpgradeProfileCollection.cs @@ -0,0 +1,376 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.ContainerServiceFleet.Samples +{ + public partial class Sample_AutoUpgradeProfileCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateAnAutoUpgradeProfile() + { + // Generated from example definition: 2025-03-01/AutoUpgradeProfiles_CreateOrUpdate.json + // this example is just showing the usage of "AutoUpgradeProfile_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this AutoUpgradeProfileResource + AutoUpgradeProfileCollection collection = fleet.GetAutoUpgradeProfiles(); + + // invoke the operation + string autoUpgradeProfileName = "autoupgradeprofile1"; + AutoUpgradeProfileData data = new AutoUpgradeProfileData(); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, autoUpgradeProfileName, data); + AutoUpgradeProfileResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AutoUpgradeProfileData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateAnAutoUpgradeProfileGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-01/AutoUpgradeProfiles_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "AutoUpgradeProfile_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgfleets"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this AutoUpgradeProfileResource + AutoUpgradeProfileCollection collection = fleet.GetAutoUpgradeProfiles(); + + // invoke the operation + string autoUpgradeProfileName = "autoupgradeprofile1"; + AutoUpgradeProfileData data = new AutoUpgradeProfileData(); + string ifMatch = "teikqmg"; + string ifNoneMatch = "ghfmmyrekxincsxklbldnvhqd"; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, autoUpgradeProfileName, data, ifMatch: ifMatch, ifNoneMatch: ifNoneMatch); + AutoUpgradeProfileResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AutoUpgradeProfileData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsAnAutoUpgradeProfileResource() + { + // Generated from example definition: 2025-03-01/AutoUpgradeProfiles_Get.json + // this example is just showing the usage of "AutoUpgradeProfile_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this AutoUpgradeProfileResource + AutoUpgradeProfileCollection collection = fleet.GetAutoUpgradeProfiles(); + + // invoke the operation + string autoUpgradeProfileName = "autoupgradeprofile1"; + AutoUpgradeProfileResource result = await collection.GetAsync(autoUpgradeProfileName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AutoUpgradeProfileData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsAnAutoUpgradeProfileResourceGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-01/AutoUpgradeProfiles_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AutoUpgradeProfile_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgfleets"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this AutoUpgradeProfileResource + AutoUpgradeProfileCollection collection = fleet.GetAutoUpgradeProfiles(); + + // invoke the operation + string autoUpgradeProfileName = "autoupgradeprofile1"; + AutoUpgradeProfileResource result = await collection.GetAsync(autoUpgradeProfileName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AutoUpgradeProfileData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListsTheAutoUpgradeProfileResourcesByFleet() + { + // Generated from example definition: 2025-03-01/AutoUpgradeProfiles_ListByFleet.json + // this example is just showing the usage of "AutoUpgradeProfile_ListByFleet" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this AutoUpgradeProfileResource + AutoUpgradeProfileCollection collection = fleet.GetAutoUpgradeProfiles(); + + // invoke the operation and iterate over the result + await foreach (AutoUpgradeProfileResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AutoUpgradeProfileData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListsTheAutoUpgradeProfileResourcesByFleetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-01/AutoUpgradeProfiles_ListByFleet_MaximumSet_Gen.json + // this example is just showing the usage of "AutoUpgradeProfile_ListByFleet" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgfleets"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this AutoUpgradeProfileResource + AutoUpgradeProfileCollection collection = fleet.GetAutoUpgradeProfiles(); + + // invoke the operation and iterate over the result + await foreach (AutoUpgradeProfileResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AutoUpgradeProfileData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetsAnAutoUpgradeProfileResource() + { + // Generated from example definition: 2025-03-01/AutoUpgradeProfiles_Get.json + // this example is just showing the usage of "AutoUpgradeProfile_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this AutoUpgradeProfileResource + AutoUpgradeProfileCollection collection = fleet.GetAutoUpgradeProfiles(); + + // invoke the operation + string autoUpgradeProfileName = "autoupgradeprofile1"; + bool result = await collection.ExistsAsync(autoUpgradeProfileName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetsAnAutoUpgradeProfileResourceGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-01/AutoUpgradeProfiles_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AutoUpgradeProfile_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgfleets"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this AutoUpgradeProfileResource + AutoUpgradeProfileCollection collection = fleet.GetAutoUpgradeProfiles(); + + // invoke the operation + string autoUpgradeProfileName = "autoupgradeprofile1"; + bool result = await collection.ExistsAsync(autoUpgradeProfileName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetsAnAutoUpgradeProfileResource() + { + // Generated from example definition: 2025-03-01/AutoUpgradeProfiles_Get.json + // this example is just showing the usage of "AutoUpgradeProfile_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this AutoUpgradeProfileResource + AutoUpgradeProfileCollection collection = fleet.GetAutoUpgradeProfiles(); + + // invoke the operation + string autoUpgradeProfileName = "autoupgradeprofile1"; + NullableResponse response = await collection.GetIfExistsAsync(autoUpgradeProfileName); + AutoUpgradeProfileResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AutoUpgradeProfileData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetsAnAutoUpgradeProfileResourceGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-01/AutoUpgradeProfiles_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AutoUpgradeProfile_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgfleets"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this AutoUpgradeProfileResource + AutoUpgradeProfileCollection collection = fleet.GetAutoUpgradeProfiles(); + + // invoke the operation + string autoUpgradeProfileName = "autoupgradeprofile1"; + NullableResponse response = await collection.GetIfExistsAsync(autoUpgradeProfileName); + AutoUpgradeProfileResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AutoUpgradeProfileData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_AutoUpgradeProfileResource.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_AutoUpgradeProfileResource.cs new file mode 100644 index 000000000000..1b578b5223d0 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_AutoUpgradeProfileResource.cs @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.ContainerServiceFleet.Samples +{ + public partial class Sample_AutoUpgradeProfileResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsAnAutoUpgradeProfileResource() + { + // Generated from example definition: 2025-03-01/AutoUpgradeProfiles_Get.json + // this example is just showing the usage of "AutoUpgradeProfile_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AutoUpgradeProfileResource created on azure + // for more information of creating AutoUpgradeProfileResource, please refer to the document of AutoUpgradeProfileResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + string autoUpgradeProfileName = "autoupgradeprofile1"; + ResourceIdentifier autoUpgradeProfileResourceId = AutoUpgradeProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, autoUpgradeProfileName); + AutoUpgradeProfileResource autoUpgradeProfile = client.GetAutoUpgradeProfileResource(autoUpgradeProfileResourceId); + + // invoke the operation + AutoUpgradeProfileResource result = await autoUpgradeProfile.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AutoUpgradeProfileData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsAnAutoUpgradeProfileResourceGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-01/AutoUpgradeProfiles_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AutoUpgradeProfile_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AutoUpgradeProfileResource created on azure + // for more information of creating AutoUpgradeProfileResource, please refer to the document of AutoUpgradeProfileResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgfleets"; + string fleetName = "fleet1"; + string autoUpgradeProfileName = "autoupgradeprofile1"; + ResourceIdentifier autoUpgradeProfileResourceId = AutoUpgradeProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, autoUpgradeProfileName); + AutoUpgradeProfileResource autoUpgradeProfile = client.GetAutoUpgradeProfileResource(autoUpgradeProfileResourceId); + + // invoke the operation + AutoUpgradeProfileResource result = await autoUpgradeProfile.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AutoUpgradeProfileData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeleteAnAutoUpgradeProfileResource() + { + // Generated from example definition: 2025-03-01/AutoUpgradeProfiles_Delete.json + // this example is just showing the usage of "AutoUpgradeProfile_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AutoUpgradeProfileResource created on azure + // for more information of creating AutoUpgradeProfileResource, please refer to the document of AutoUpgradeProfileResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + string autoUpgradeProfileName = "autoupgradeprofile1"; + ResourceIdentifier autoUpgradeProfileResourceId = AutoUpgradeProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, autoUpgradeProfileName); + AutoUpgradeProfileResource autoUpgradeProfile = client.GetAutoUpgradeProfileResource(autoUpgradeProfileResourceId); + + // invoke the operation + await autoUpgradeProfile.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeleteAnAutoUpgradeProfileResourceGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-01/AutoUpgradeProfiles_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "AutoUpgradeProfile_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AutoUpgradeProfileResource created on azure + // for more information of creating AutoUpgradeProfileResource, please refer to the document of AutoUpgradeProfileResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgfleets"; + string fleetName = "fleet1"; + string autoUpgradeProfileName = "autoupgradeprofile1"; + ResourceIdentifier autoUpgradeProfileResourceId = AutoUpgradeProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, autoUpgradeProfileName); + AutoUpgradeProfileResource autoUpgradeProfile = client.GetAutoUpgradeProfileResource(autoUpgradeProfileResourceId); + + // invoke the operation + string ifMatch = "qmdsmmawj"; + await autoUpgradeProfile.DeleteAsync(WaitUntil.Completed, ifMatch: ifMatch); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CreateAnAutoUpgradeProfile() + { + // Generated from example definition: 2025-03-01/AutoUpgradeProfiles_CreateOrUpdate.json + // this example is just showing the usage of "AutoUpgradeProfile_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AutoUpgradeProfileResource created on azure + // for more information of creating AutoUpgradeProfileResource, please refer to the document of AutoUpgradeProfileResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + string autoUpgradeProfileName = "autoupgradeprofile1"; + ResourceIdentifier autoUpgradeProfileResourceId = AutoUpgradeProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, autoUpgradeProfileName); + AutoUpgradeProfileResource autoUpgradeProfile = client.GetAutoUpgradeProfileResource(autoUpgradeProfileResourceId); + + // invoke the operation + AutoUpgradeProfileData data = new AutoUpgradeProfileData(); + ArmOperation lro = await autoUpgradeProfile.UpdateAsync(WaitUntil.Completed, data); + AutoUpgradeProfileResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AutoUpgradeProfileData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CreateAnAutoUpgradeProfileGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-01/AutoUpgradeProfiles_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "AutoUpgradeProfile_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AutoUpgradeProfileResource created on azure + // for more information of creating AutoUpgradeProfileResource, please refer to the document of AutoUpgradeProfileResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgfleets"; + string fleetName = "fleet1"; + string autoUpgradeProfileName = "autoupgradeprofile1"; + ResourceIdentifier autoUpgradeProfileResourceId = AutoUpgradeProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, autoUpgradeProfileName); + AutoUpgradeProfileResource autoUpgradeProfile = client.GetAutoUpgradeProfileResource(autoUpgradeProfileResourceId); + + // invoke the operation + AutoUpgradeProfileData data = new AutoUpgradeProfileData(); + string ifMatch = "teikqmg"; + string ifNoneMatch = "ghfmmyrekxincsxklbldnvhqd"; + ArmOperation lro = await autoUpgradeProfile.UpdateAsync(WaitUntil.Completed, data, ifMatch: ifMatch, ifNoneMatch: ifNoneMatch); + AutoUpgradeProfileResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AutoUpgradeProfileData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GenerateUpdateRunAutoUpgradeProfileOperation_AutoUpgradeProfileOperationsGenerateUpdateRunMaximumSet() + { + // Generated from example definition: 2025-03-01/AutoUpgradeProfileOperations_GenerateUpdateRun_MaximumSet_Gen.json + // this example is just showing the usage of "AutoUpgradeProfileOperations_GenerateUpdateRun" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AutoUpgradeProfileResource created on azure + // for more information of creating AutoUpgradeProfileResource, please refer to the document of AutoUpgradeProfileResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgfleets"; + string fleetName = "fleet1"; + string autoUpgradeProfileName = "aup1"; + ResourceIdentifier autoUpgradeProfileResourceId = AutoUpgradeProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, autoUpgradeProfileName); + AutoUpgradeProfileResource autoUpgradeProfile = client.GetAutoUpgradeProfileResource(autoUpgradeProfileResourceId); + + // invoke the operation + await autoUpgradeProfile.GenerateUpdateRunAutoUpgradeProfileOperationAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_FleetCollection.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_FleetCollection.cs new file mode 100644 index 000000000000..6be9c7e715ba --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_FleetCollection.cs @@ -0,0 +1,386 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.ContainerServiceFleet.Models; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.ContainerServiceFleet.Samples +{ + public partial class Sample_FleetCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreatesAFleetResourceWithALongRunningOperation() + { + // Generated from example definition: 2025-03-01/Fleets_CreateOrUpdate.json + // this example is just showing the usage of "Fleet_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this FleetResource + FleetCollection collection = resourceGroupResource.GetFleets(); + + // invoke the operation + string fleetName = "fleet1"; + FleetData data = new FleetData(new AzureLocation("East US")) + { + Tags = +{ +["tier"] = "production", +["archv2"] = "" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, fleetName, data); + FleetResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreatesAFleetResourceWithALongRunningOperationGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-01/Fleets_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "Fleet_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgfleets"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this FleetResource + FleetCollection collection = resourceGroupResource.GetFleets(); + + // invoke the operation + string fleetName = "fleet1"; + FleetData data = new FleetData(new AzureLocation("East US")) + { + Identity = new Models.ManagedServiceIdentity(Models.ManagedServiceIdentityType.None) + { + UserAssignedIdentities = +{ +["key126"] = new UserAssignedIdentity() +}, + }, + Tags = { }, + }; + string ifMatch = "jzlrwaylijhsnzp"; + string ifNoneMatch = "cqpzdjshmggwolagomzxfy"; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, fleetName, data, ifMatch: ifMatch, ifNoneMatch: ifNoneMatch); + FleetResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsAFleetResource() + { + // Generated from example definition: 2025-03-01/Fleets_Get.json + // this example is just showing the usage of "Fleet_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this FleetResource + FleetCollection collection = resourceGroupResource.GetFleets(); + + // invoke the operation + string fleetName = "fleet1"; + FleetResource result = await collection.GetAsync(fleetName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsAFleetResourceGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-01/Fleets_Get_MaximumSet_Gen.json + // this example is just showing the usage of "Fleet_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgfleets"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this FleetResource + FleetCollection collection = resourceGroupResource.GetFleets(); + + // invoke the operation + string fleetName = "fleet1"; + FleetResource result = await collection.GetAsync(fleetName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListsTheFleetResourcesInAResourceGroup() + { + // Generated from example definition: 2025-03-01/Fleets_ListByResourceGroup.json + // this example is just showing the usage of "Fleet_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this FleetResource + FleetCollection collection = resourceGroupResource.GetFleets(); + + // invoke the operation and iterate over the result + await foreach (FleetResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListsTheFleetResourcesInAResourceGroupGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-01/Fleets_ListByResourceGroup_MaximumSet_Gen.json + // this example is just showing the usage of "Fleet_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgfleets"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this FleetResource + FleetCollection collection = resourceGroupResource.GetFleets(); + + // invoke the operation and iterate over the result + await foreach (FleetResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetsAFleetResource() + { + // Generated from example definition: 2025-03-01/Fleets_Get.json + // this example is just showing the usage of "Fleet_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this FleetResource + FleetCollection collection = resourceGroupResource.GetFleets(); + + // invoke the operation + string fleetName = "fleet1"; + bool result = await collection.ExistsAsync(fleetName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetsAFleetResourceGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-01/Fleets_Get_MaximumSet_Gen.json + // this example is just showing the usage of "Fleet_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgfleets"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this FleetResource + FleetCollection collection = resourceGroupResource.GetFleets(); + + // invoke the operation + string fleetName = "fleet1"; + bool result = await collection.ExistsAsync(fleetName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetsAFleetResource() + { + // Generated from example definition: 2025-03-01/Fleets_Get.json + // this example is just showing the usage of "Fleet_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this FleetResource + FleetCollection collection = resourceGroupResource.GetFleets(); + + // invoke the operation + string fleetName = "fleet1"; + NullableResponse response = await collection.GetIfExistsAsync(fleetName); + FleetResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetsAFleetResourceGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-01/Fleets_Get_MaximumSet_Gen.json + // this example is just showing the usage of "Fleet_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgfleets"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this FleetResource + FleetCollection collection = resourceGroupResource.GetFleets(); + + // invoke the operation + string fleetName = "fleet1"; + NullableResponse response = await collection.GetIfExistsAsync(fleetName); + FleetResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_FleetMemberCollection.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_FleetMemberCollection.cs new file mode 100644 index 000000000000..72ede85c6d06 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_FleetMemberCollection.cs @@ -0,0 +1,376 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.ContainerServiceFleet.Samples +{ + public partial class Sample_FleetMemberCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreatesAFleetMemberResourceWithALongRunningOperation() + { + // Generated from example definition: 2025-03-01/FleetMembers_Create.json + // this example is just showing the usage of "FleetMember_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetMemberResource + FleetMemberCollection collection = fleet.GetFleetMembers(); + + // invoke the operation + string fleetMemberName = "member-1"; + FleetMemberData data = new FleetMemberData(); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, fleetMemberName, data); + FleetMemberResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetMemberData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreatesAFleetMemberResourceWithALongRunningOperationGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-01/FleetMembers_Create_MaximumSet_Gen.json + // this example is just showing the usage of "FleetMember_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgfleets"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetMemberResource + FleetMemberCollection collection = fleet.GetFleetMembers(); + + // invoke the operation + string fleetMemberName = "fleet1"; + FleetMemberData data = new FleetMemberData(); + string ifMatch = "amkttadbw"; + string ifNoneMatch = "zoljoccbcg"; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, fleetMemberName, data, ifMatch: ifMatch, ifNoneMatch: ifNoneMatch); + FleetMemberResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetMemberData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsAFleetMemberResource() + { + // Generated from example definition: 2025-03-01/FleetMembers_Get.json + // this example is just showing the usage of "FleetMember_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetMemberResource + FleetMemberCollection collection = fleet.GetFleetMembers(); + + // invoke the operation + string fleetMemberName = "member-1"; + FleetMemberResource result = await collection.GetAsync(fleetMemberName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetMemberData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsAFleetMemberResourceGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-01/FleetMembers_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FleetMember_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgfleets"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetMemberResource + FleetMemberCollection collection = fleet.GetFleetMembers(); + + // invoke the operation + string fleetMemberName = "fleet1"; + FleetMemberResource result = await collection.GetAsync(fleetMemberName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetMemberData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListsTheMembersOfAFleet() + { + // Generated from example definition: 2025-03-01/FleetMembers_ListByFleet.json + // this example is just showing the usage of "FleetMember_ListByFleet" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetMemberResource + FleetMemberCollection collection = fleet.GetFleetMembers(); + + // invoke the operation and iterate over the result + await foreach (FleetMemberResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetMemberData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListsTheMembersOfAFleetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-01/FleetMembers_ListByFleet_MaximumSet_Gen.json + // this example is just showing the usage of "FleetMember_ListByFleet" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgfleets"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetMemberResource + FleetMemberCollection collection = fleet.GetFleetMembers(); + + // invoke the operation and iterate over the result + await foreach (FleetMemberResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetMemberData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetsAFleetMemberResource() + { + // Generated from example definition: 2025-03-01/FleetMembers_Get.json + // this example is just showing the usage of "FleetMember_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetMemberResource + FleetMemberCollection collection = fleet.GetFleetMembers(); + + // invoke the operation + string fleetMemberName = "member-1"; + bool result = await collection.ExistsAsync(fleetMemberName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetsAFleetMemberResourceGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-01/FleetMembers_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FleetMember_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgfleets"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetMemberResource + FleetMemberCollection collection = fleet.GetFleetMembers(); + + // invoke the operation + string fleetMemberName = "fleet1"; + bool result = await collection.ExistsAsync(fleetMemberName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetsAFleetMemberResource() + { + // Generated from example definition: 2025-03-01/FleetMembers_Get.json + // this example is just showing the usage of "FleetMember_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetMemberResource + FleetMemberCollection collection = fleet.GetFleetMembers(); + + // invoke the operation + string fleetMemberName = "member-1"; + NullableResponse response = await collection.GetIfExistsAsync(fleetMemberName); + FleetMemberResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetMemberData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetsAFleetMemberResourceGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-01/FleetMembers_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FleetMember_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgfleets"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetMemberResource + FleetMemberCollection collection = fleet.GetFleetMembers(); + + // invoke the operation + string fleetMemberName = "fleet1"; + NullableResponse response = await collection.GetIfExistsAsync(fleetMemberName); + FleetMemberResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetMemberData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_FleetMemberResource.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_FleetMemberResource.cs new file mode 100644 index 000000000000..bc3feb24154c --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_FleetMemberResource.cs @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.ContainerServiceFleet.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.ContainerServiceFleet.Samples +{ + public partial class Sample_FleetMemberResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsAFleetMemberResource() + { + // Generated from example definition: 2025-03-01/FleetMembers_Get.json + // this example is just showing the usage of "FleetMember_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetMemberResource created on azure + // for more information of creating FleetMemberResource, please refer to the document of FleetMemberResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + string fleetMemberName = "member-1"; + ResourceIdentifier fleetMemberResourceId = FleetMemberResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetMemberName); + FleetMemberResource fleetMember = client.GetFleetMemberResource(fleetMemberResourceId); + + // invoke the operation + FleetMemberResource result = await fleetMember.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetMemberData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsAFleetMemberResourceGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-01/FleetMembers_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FleetMember_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetMemberResource created on azure + // for more information of creating FleetMemberResource, please refer to the document of FleetMemberResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgfleets"; + string fleetName = "fleet1"; + string fleetMemberName = "fleet1"; + ResourceIdentifier fleetMemberResourceId = FleetMemberResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetMemberName); + FleetMemberResource fleetMember = client.GetFleetMemberResource(fleetMemberResourceId); + + // invoke the operation + FleetMemberResource result = await fleetMember.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetMemberData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeletesAFleetMemberResourceAsynchronouslyWithALongRunningOperation() + { + // Generated from example definition: 2025-03-01/FleetMembers_Delete.json + // this example is just showing the usage of "FleetMember_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetMemberResource created on azure + // for more information of creating FleetMemberResource, please refer to the document of FleetMemberResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + string fleetMemberName = "member-1"; + ResourceIdentifier fleetMemberResourceId = FleetMemberResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetMemberName); + FleetMemberResource fleetMember = client.GetFleetMemberResource(fleetMemberResourceId); + + // invoke the operation + await fleetMember.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeletesAFleetMemberResourceAsynchronouslyWithALongRunningOperationGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-01/FleetMembers_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "FleetMember_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetMemberResource created on azure + // for more information of creating FleetMemberResource, please refer to the document of FleetMemberResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgfleets"; + string fleetName = "fleet1"; + string fleetMemberName = "fleet1"; + ResourceIdentifier fleetMemberResourceId = FleetMemberResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetMemberName); + FleetMemberResource fleetMember = client.GetFleetMemberResource(fleetMemberResourceId); + + // invoke the operation + string ifMatch = "klroqfozx"; + await fleetMember.DeleteAsync(WaitUntil.Completed, ifMatch: ifMatch); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_UpdatesAFleetMemberResourceSynchronously() + { + // Generated from example definition: 2025-03-01/FleetMembers_Update.json + // this example is just showing the usage of "FleetMember_UpdateAsync" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetMemberResource created on azure + // for more information of creating FleetMemberResource, please refer to the document of FleetMemberResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + string fleetMemberName = "member-1"; + ResourceIdentifier fleetMemberResourceId = FleetMemberResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetMemberName); + FleetMemberResource fleetMember = client.GetFleetMemberResource(fleetMemberResourceId); + + // invoke the operation + FleetMemberPatch patch = new FleetMemberPatch(); + ArmOperation lro = await fleetMember.UpdateAsync(WaitUntil.Completed, patch); + FleetMemberResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetMemberData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_UpdatesAFleetMemberResourceSynchronouslyGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-01/FleetMembers_Update_MaximumSet_Gen.json + // this example is just showing the usage of "FleetMember_UpdateAsync" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetMemberResource created on azure + // for more information of creating FleetMemberResource, please refer to the document of FleetMemberResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgfleets"; + string fleetName = "fleet1"; + string fleetMemberName = "fleet1"; + ResourceIdentifier fleetMemberResourceId = FleetMemberResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetMemberName); + FleetMemberResource fleetMember = client.GetFleetMemberResource(fleetMemberResourceId); + + // invoke the operation + FleetMemberPatch patch = new FleetMemberPatch(); + string ifMatch = "bjyjzzxvbs"; + ArmOperation lro = await fleetMember.UpdateAsync(WaitUntil.Completed, patch, ifMatch: ifMatch); + FleetMemberResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetMemberData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_FleetResource.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_FleetResource.cs new file mode 100644 index 000000000000..5118c888b703 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_FleetResource.cs @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.ContainerServiceFleet.Models; +using Azure.ResourceManager.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.ContainerServiceFleet.Samples +{ + public partial class Sample_FleetResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsAFleetResource() + { + // Generated from example definition: 2025-03-01/Fleets_Get.json + // this example is just showing the usage of "Fleet_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // invoke the operation + FleetResource result = await fleet.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsAFleetResourceGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-01/Fleets_Get_MaximumSet_Gen.json + // this example is just showing the usage of "Fleet_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgfleets"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // invoke the operation + FleetResource result = await fleet.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeletesAFleetResourceAsynchronouslyWithALongRunningOperation() + { + // Generated from example definition: 2025-03-01/Fleets_Delete.json + // this example is just showing the usage of "Fleet_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // invoke the operation + await fleet.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeletesAFleetResourceAsynchronouslyWithALongRunningOperationGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-01/Fleets_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "Fleet_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgfleets"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // invoke the operation + string ifMatch = "crsgokrdxddjsvqxpplerummnmzav"; + await fleet.DeleteAsync(WaitUntil.Completed, ifMatch: ifMatch); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_UpdateAFleet() + { + // Generated from example definition: 2025-03-01/Fleets_PatchTags.json + // this example is just showing the usage of "Fleet_UpdateAsync" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // invoke the operation + FleetPatch patch = new FleetPatch + { + Tags = +{ +["tier"] = "secure", +["env"] = "prod" +}, + }; + string ifMatch = "dfjkwelr7384"; + ArmOperation lro = await fleet.UpdateAsync(WaitUntil.Completed, patch, ifMatch: ifMatch); + FleetResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_UpdateAFleetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-01/Fleets_Update_MaximumSet_Gen.json + // this example is just showing the usage of "Fleet_UpdateAsync" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgfleets"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // invoke the operation + FleetPatch patch = new FleetPatch + { + Tags = { }, + Identity = new Models.ManagedServiceIdentity(Models.ManagedServiceIdentityType.None) + { + UserAssignedIdentities = +{ +["key126"] = new UserAssignedIdentity() +}, + }, + }; + string ifMatch = "lgoeir"; + ArmOperation lro = await fleet.UpdateAsync(WaitUntil.Completed, patch, ifMatch: ifMatch); + FleetResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetCredentials_ListsTheUserCredentialsOfAFleet() + { + // Generated from example definition: 2025-03-01/Fleets_ListCredentialsResult.json + // this example is just showing the usage of "Fleets_ListCredentials" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // invoke the operation + FleetCredentialResults result = await fleet.GetCredentialsAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetCredentials_ListsTheUserCredentialsOfAFleetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-01/Fleets_ListCredentials_MaximumSet_Gen.json + // this example is just showing the usage of "Fleets_ListCredentials" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgfleets"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // invoke the operation + FleetCredentialResults result = await fleet.GetCredentialsAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_FleetUpdateStrategyCollection.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_FleetUpdateStrategyCollection.cs new file mode 100644 index 000000000000..0788e5ec4b21 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_FleetUpdateStrategyCollection.cs @@ -0,0 +1,376 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.ContainerServiceFleet.Samples +{ + public partial class Sample_FleetUpdateStrategyCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateAFleetUpdateStrategyGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-01/FleetUpdateStrategies_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "FleetUpdateStrategy_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgfleets"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetUpdateStrategyResource + FleetUpdateStrategyCollection collection = fleet.GetFleetUpdateStrategies(); + + // invoke the operation + string updateStrategyName = "fleet1"; + FleetUpdateStrategyData data = new FleetUpdateStrategyData(); + string ifMatch = "bttptpmhheves"; + string ifNoneMatch = "tlx"; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, updateStrategyName, data, ifMatch: ifMatch, ifNoneMatch: ifNoneMatch); + FleetUpdateStrategyResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetUpdateStrategyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateAFleetUpdateStrategy() + { + // Generated from example definition: 2025-03-01/UpdateStrategies_CreateOrUpdate.json + // this example is just showing the usage of "FleetUpdateStrategy_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetUpdateStrategyResource + FleetUpdateStrategyCollection collection = fleet.GetFleetUpdateStrategies(); + + // invoke the operation + string updateStrategyName = "strartegy1"; + FleetUpdateStrategyData data = new FleetUpdateStrategyData(); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, updateStrategyName, data); + FleetUpdateStrategyResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetUpdateStrategyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetAFleetUpdateStrategyResourceGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-01/FleetUpdateStrategies_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FleetUpdateStrategy_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgfleets"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetUpdateStrategyResource + FleetUpdateStrategyCollection collection = fleet.GetFleetUpdateStrategies(); + + // invoke the operation + string updateStrategyName = "fleet1"; + FleetUpdateStrategyResource result = await collection.GetAsync(updateStrategyName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetUpdateStrategyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetAFleetUpdateStrategyResource() + { + // Generated from example definition: 2025-03-01/UpdateStrategies_Get.json + // this example is just showing the usage of "FleetUpdateStrategy_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetUpdateStrategyResource + FleetUpdateStrategyCollection collection = fleet.GetFleetUpdateStrategies(); + + // invoke the operation + string updateStrategyName = "strategy1"; + FleetUpdateStrategyResource result = await collection.GetAsync(updateStrategyName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetUpdateStrategyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListTheFleetUpdateStrategyResourcesByFleetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-01/FleetUpdateStrategies_ListByFleet_MaximumSet_Gen.json + // this example is just showing the usage of "FleetUpdateStrategy_ListByFleet" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgfleets"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetUpdateStrategyResource + FleetUpdateStrategyCollection collection = fleet.GetFleetUpdateStrategies(); + + // invoke the operation and iterate over the result + await foreach (FleetUpdateStrategyResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetUpdateStrategyData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListTheFleetUpdateStrategyResourcesByFleet() + { + // Generated from example definition: 2025-03-01/UpdateStrategies_ListByFleet.json + // this example is just showing the usage of "FleetUpdateStrategy_ListByFleet" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetUpdateStrategyResource + FleetUpdateStrategyCollection collection = fleet.GetFleetUpdateStrategies(); + + // invoke the operation and iterate over the result + await foreach (FleetUpdateStrategyResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetUpdateStrategyData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetAFleetUpdateStrategyResourceGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-01/FleetUpdateStrategies_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FleetUpdateStrategy_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgfleets"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetUpdateStrategyResource + FleetUpdateStrategyCollection collection = fleet.GetFleetUpdateStrategies(); + + // invoke the operation + string updateStrategyName = "fleet1"; + bool result = await collection.ExistsAsync(updateStrategyName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetAFleetUpdateStrategyResource() + { + // Generated from example definition: 2025-03-01/UpdateStrategies_Get.json + // this example is just showing the usage of "FleetUpdateStrategy_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetUpdateStrategyResource + FleetUpdateStrategyCollection collection = fleet.GetFleetUpdateStrategies(); + + // invoke the operation + string updateStrategyName = "strategy1"; + bool result = await collection.ExistsAsync(updateStrategyName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetAFleetUpdateStrategyResourceGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-01/FleetUpdateStrategies_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FleetUpdateStrategy_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgfleets"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetUpdateStrategyResource + FleetUpdateStrategyCollection collection = fleet.GetFleetUpdateStrategies(); + + // invoke the operation + string updateStrategyName = "fleet1"; + NullableResponse response = await collection.GetIfExistsAsync(updateStrategyName); + FleetUpdateStrategyResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetUpdateStrategyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetAFleetUpdateStrategyResource() + { + // Generated from example definition: 2025-03-01/UpdateStrategies_Get.json + // this example is just showing the usage of "FleetUpdateStrategy_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetUpdateStrategyResource + FleetUpdateStrategyCollection collection = fleet.GetFleetUpdateStrategies(); + + // invoke the operation + string updateStrategyName = "strategy1"; + NullableResponse response = await collection.GetIfExistsAsync(updateStrategyName); + FleetUpdateStrategyResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetUpdateStrategyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_FleetUpdateStrategyResource.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_FleetUpdateStrategyResource.cs new file mode 100644 index 000000000000..1215d9b6545a --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_FleetUpdateStrategyResource.cs @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.ContainerServiceFleet.Samples +{ + public partial class Sample_FleetUpdateStrategyResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetAFleetUpdateStrategyResourceGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-01/FleetUpdateStrategies_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FleetUpdateStrategy_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetUpdateStrategyResource created on azure + // for more information of creating FleetUpdateStrategyResource, please refer to the document of FleetUpdateStrategyResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgfleets"; + string fleetName = "fleet1"; + string updateStrategyName = "fleet1"; + ResourceIdentifier fleetUpdateStrategyResourceId = FleetUpdateStrategyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, updateStrategyName); + FleetUpdateStrategyResource fleetUpdateStrategy = client.GetFleetUpdateStrategyResource(fleetUpdateStrategyResourceId); + + // invoke the operation + FleetUpdateStrategyResource result = await fleetUpdateStrategy.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetUpdateStrategyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetAFleetUpdateStrategyResource() + { + // Generated from example definition: 2025-03-01/UpdateStrategies_Get.json + // this example is just showing the usage of "FleetUpdateStrategy_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetUpdateStrategyResource created on azure + // for more information of creating FleetUpdateStrategyResource, please refer to the document of FleetUpdateStrategyResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + string updateStrategyName = "strategy1"; + ResourceIdentifier fleetUpdateStrategyResourceId = FleetUpdateStrategyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, updateStrategyName); + FleetUpdateStrategyResource fleetUpdateStrategy = client.GetFleetUpdateStrategyResource(fleetUpdateStrategyResourceId); + + // invoke the operation + FleetUpdateStrategyResource result = await fleetUpdateStrategy.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetUpdateStrategyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeleteAFleetUpdateStrategyResourceGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-01/FleetUpdateStrategies_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "FleetUpdateStrategy_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetUpdateStrategyResource created on azure + // for more information of creating FleetUpdateStrategyResource, please refer to the document of FleetUpdateStrategyResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgfleets"; + string fleetName = "fleet1"; + string updateStrategyName = "fleet1"; + ResourceIdentifier fleetUpdateStrategyResourceId = FleetUpdateStrategyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, updateStrategyName); + FleetUpdateStrategyResource fleetUpdateStrategy = client.GetFleetUpdateStrategyResource(fleetUpdateStrategyResourceId); + + // invoke the operation + string ifMatch = "saqprswlk"; + await fleetUpdateStrategy.DeleteAsync(WaitUntil.Completed, ifMatch: ifMatch); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeleteAFleetUpdateStrategyResource() + { + // Generated from example definition: 2025-03-01/UpdateStrategies_Delete.json + // this example is just showing the usage of "FleetUpdateStrategy_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetUpdateStrategyResource created on azure + // for more information of creating FleetUpdateStrategyResource, please refer to the document of FleetUpdateStrategyResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + string updateStrategyName = "strategy1"; + ResourceIdentifier fleetUpdateStrategyResourceId = FleetUpdateStrategyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, updateStrategyName); + FleetUpdateStrategyResource fleetUpdateStrategy = client.GetFleetUpdateStrategyResource(fleetUpdateStrategyResourceId); + + // invoke the operation + await fleetUpdateStrategy.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CreateAFleetUpdateStrategyGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-01/FleetUpdateStrategies_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "FleetUpdateStrategy_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetUpdateStrategyResource created on azure + // for more information of creating FleetUpdateStrategyResource, please refer to the document of FleetUpdateStrategyResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgfleets"; + string fleetName = "fleet1"; + string updateStrategyName = "fleet1"; + ResourceIdentifier fleetUpdateStrategyResourceId = FleetUpdateStrategyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, updateStrategyName); + FleetUpdateStrategyResource fleetUpdateStrategy = client.GetFleetUpdateStrategyResource(fleetUpdateStrategyResourceId); + + // invoke the operation + FleetUpdateStrategyData data = new FleetUpdateStrategyData(); + string ifMatch = "bttptpmhheves"; + string ifNoneMatch = "tlx"; + ArmOperation lro = await fleetUpdateStrategy.UpdateAsync(WaitUntil.Completed, data, ifMatch: ifMatch, ifNoneMatch: ifNoneMatch); + FleetUpdateStrategyResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetUpdateStrategyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CreateAFleetUpdateStrategy() + { + // Generated from example definition: 2025-03-01/UpdateStrategies_CreateOrUpdate.json + // this example is just showing the usage of "FleetUpdateStrategy_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetUpdateStrategyResource created on azure + // for more information of creating FleetUpdateStrategyResource, please refer to the document of FleetUpdateStrategyResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + string updateStrategyName = "strartegy1"; + ResourceIdentifier fleetUpdateStrategyResourceId = FleetUpdateStrategyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, updateStrategyName); + FleetUpdateStrategyResource fleetUpdateStrategy = client.GetFleetUpdateStrategyResource(fleetUpdateStrategyResourceId); + + // invoke the operation + FleetUpdateStrategyData data = new FleetUpdateStrategyData(); + ArmOperation lro = await fleetUpdateStrategy.UpdateAsync(WaitUntil.Completed, data); + FleetUpdateStrategyResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetUpdateStrategyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs new file mode 100644 index 000000000000..75b35dc2dea2 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.ContainerServiceFleet.Samples +{ + public partial class Sample_SubscriptionResourceExtensions + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetFleets_ListsTheFleetResourcesInASubscription() + { + // Generated from example definition: 2025-03-01/Fleets_ListBySub.json + // this example is just showing the usage of "Fleet_ListBySubscription" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (FleetResource item in subscriptionResource.GetFleetsAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetFleets_ListsTheFleetResourcesInASubscriptionGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-01/Fleets_ListBySubscription_MaximumSet_Gen.json + // this example is just showing the usage of "Fleet_ListBySubscription" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (FleetResource item in subscriptionResource.GetFleetsAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_UpdateRunCollection.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_UpdateRunCollection.cs new file mode 100644 index 000000000000..9e65a2a3cfa9 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_UpdateRunCollection.cs @@ -0,0 +1,376 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.ContainerServiceFleet.Samples +{ + public partial class Sample_UpdateRunCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateAnUpdateRun() + { + // Generated from example definition: 2025-03-01/UpdateRuns_CreateOrUpdate.json + // this example is just showing the usage of "UpdateRun_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this UpdateRunResource + UpdateRunCollection collection = fleet.GetUpdateRuns(); + + // invoke the operation + string updateRunName = "run1"; + UpdateRunData data = new UpdateRunData(); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, updateRunName, data); + UpdateRunResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + UpdateRunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateAnUpdateRunGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-01/UpdateRuns_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "UpdateRun_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgfleets"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this UpdateRunResource + UpdateRunCollection collection = fleet.GetUpdateRuns(); + + // invoke the operation + string updateRunName = "fleet1"; + UpdateRunData data = new UpdateRunData(); + string ifMatch = "wyolpuaxgybeygcbz"; + string ifNoneMatch = "rwrhonlormgshamadufoo"; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, updateRunName, data, ifMatch: ifMatch, ifNoneMatch: ifNoneMatch); + UpdateRunResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + UpdateRunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsAnUpdateRunResource() + { + // Generated from example definition: 2025-03-01/UpdateRuns_Get.json + // this example is just showing the usage of "UpdateRun_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this UpdateRunResource + UpdateRunCollection collection = fleet.GetUpdateRuns(); + + // invoke the operation + string updateRunName = "run1"; + UpdateRunResource result = await collection.GetAsync(updateRunName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + UpdateRunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsAnUpdateRunResourceGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-01/UpdateRuns_Get_MaximumSet_Gen.json + // this example is just showing the usage of "UpdateRun_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgfleets"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this UpdateRunResource + UpdateRunCollection collection = fleet.GetUpdateRuns(); + + // invoke the operation + string updateRunName = "fleet1"; + UpdateRunResource result = await collection.GetAsync(updateRunName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + UpdateRunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListsTheUpdateRunResourcesByFleet() + { + // Generated from example definition: 2025-03-01/UpdateRuns_ListByFleet.json + // this example is just showing the usage of "UpdateRun_ListByFleet" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this UpdateRunResource + UpdateRunCollection collection = fleet.GetUpdateRuns(); + + // invoke the operation and iterate over the result + await foreach (UpdateRunResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + UpdateRunData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListsTheUpdateRunResourcesByFleetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-01/UpdateRuns_ListByFleet_MaximumSet_Gen.json + // this example is just showing the usage of "UpdateRun_ListByFleet" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgfleets"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this UpdateRunResource + UpdateRunCollection collection = fleet.GetUpdateRuns(); + + // invoke the operation and iterate over the result + await foreach (UpdateRunResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + UpdateRunData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetsAnUpdateRunResource() + { + // Generated from example definition: 2025-03-01/UpdateRuns_Get.json + // this example is just showing the usage of "UpdateRun_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this UpdateRunResource + UpdateRunCollection collection = fleet.GetUpdateRuns(); + + // invoke the operation + string updateRunName = "run1"; + bool result = await collection.ExistsAsync(updateRunName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetsAnUpdateRunResourceGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-01/UpdateRuns_Get_MaximumSet_Gen.json + // this example is just showing the usage of "UpdateRun_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgfleets"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this UpdateRunResource + UpdateRunCollection collection = fleet.GetUpdateRuns(); + + // invoke the operation + string updateRunName = "fleet1"; + bool result = await collection.ExistsAsync(updateRunName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetsAnUpdateRunResource() + { + // Generated from example definition: 2025-03-01/UpdateRuns_Get.json + // this example is just showing the usage of "UpdateRun_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this UpdateRunResource + UpdateRunCollection collection = fleet.GetUpdateRuns(); + + // invoke the operation + string updateRunName = "run1"; + NullableResponse response = await collection.GetIfExistsAsync(updateRunName); + UpdateRunResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + UpdateRunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetsAnUpdateRunResourceGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-01/UpdateRuns_Get_MaximumSet_Gen.json + // this example is just showing the usage of "UpdateRun_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgfleets"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this UpdateRunResource + UpdateRunCollection collection = fleet.GetUpdateRuns(); + + // invoke the operation + string updateRunName = "fleet1"; + NullableResponse response = await collection.GetIfExistsAsync(updateRunName); + UpdateRunResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + UpdateRunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_UpdateRunResource.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_UpdateRunResource.cs new file mode 100644 index 000000000000..9f14d67a358f --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_UpdateRunResource.cs @@ -0,0 +1,409 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.ContainerServiceFleet.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.ContainerServiceFleet.Samples +{ + public partial class Sample_UpdateRunResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsAnUpdateRunResource() + { + // Generated from example definition: 2025-03-01/UpdateRuns_Get.json + // this example is just showing the usage of "UpdateRun_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this UpdateRunResource created on azure + // for more information of creating UpdateRunResource, please refer to the document of UpdateRunResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + string updateRunName = "run1"; + ResourceIdentifier updateRunResourceId = UpdateRunResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, updateRunName); + UpdateRunResource updateRun = client.GetUpdateRunResource(updateRunResourceId); + + // invoke the operation + UpdateRunResource result = await updateRun.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + UpdateRunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsAnUpdateRunResourceGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-01/UpdateRuns_Get_MaximumSet_Gen.json + // this example is just showing the usage of "UpdateRun_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this UpdateRunResource created on azure + // for more information of creating UpdateRunResource, please refer to the document of UpdateRunResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgfleets"; + string fleetName = "fleet1"; + string updateRunName = "fleet1"; + ResourceIdentifier updateRunResourceId = UpdateRunResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, updateRunName); + UpdateRunResource updateRun = client.GetUpdateRunResource(updateRunResourceId); + + // invoke the operation + UpdateRunResource result = await updateRun.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + UpdateRunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeleteAnUpdateRunResource() + { + // Generated from example definition: 2025-03-01/UpdateRuns_Delete.json + // this example is just showing the usage of "UpdateRun_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this UpdateRunResource created on azure + // for more information of creating UpdateRunResource, please refer to the document of UpdateRunResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + string updateRunName = "run1"; + ResourceIdentifier updateRunResourceId = UpdateRunResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, updateRunName); + UpdateRunResource updateRun = client.GetUpdateRunResource(updateRunResourceId); + + // invoke the operation + await updateRun.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeleteAnUpdateRunResourceGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-01/UpdateRuns_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "UpdateRun_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this UpdateRunResource created on azure + // for more information of creating UpdateRunResource, please refer to the document of UpdateRunResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgfleets"; + string fleetName = "fleet1"; + string updateRunName = "fleet1"; + ResourceIdentifier updateRunResourceId = UpdateRunResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, updateRunName); + UpdateRunResource updateRun = client.GetUpdateRunResource(updateRunResourceId); + + // invoke the operation + string ifMatch = "xnbwucfeufeagpa"; + await updateRun.DeleteAsync(WaitUntil.Completed, ifMatch: ifMatch); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CreateAnUpdateRun() + { + // Generated from example definition: 2025-03-01/UpdateRuns_CreateOrUpdate.json + // this example is just showing the usage of "UpdateRun_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this UpdateRunResource created on azure + // for more information of creating UpdateRunResource, please refer to the document of UpdateRunResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + string updateRunName = "run1"; + ResourceIdentifier updateRunResourceId = UpdateRunResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, updateRunName); + UpdateRunResource updateRun = client.GetUpdateRunResource(updateRunResourceId); + + // invoke the operation + UpdateRunData data = new UpdateRunData(); + ArmOperation lro = await updateRun.UpdateAsync(WaitUntil.Completed, data); + UpdateRunResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + UpdateRunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CreateAnUpdateRunGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-01/UpdateRuns_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "UpdateRun_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this UpdateRunResource created on azure + // for more information of creating UpdateRunResource, please refer to the document of UpdateRunResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgfleets"; + string fleetName = "fleet1"; + string updateRunName = "fleet1"; + ResourceIdentifier updateRunResourceId = UpdateRunResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, updateRunName); + UpdateRunResource updateRun = client.GetUpdateRunResource(updateRunResourceId); + + // invoke the operation + UpdateRunData data = new UpdateRunData(); + string ifMatch = "wyolpuaxgybeygcbz"; + string ifNoneMatch = "rwrhonlormgshamadufoo"; + ArmOperation lro = await updateRun.UpdateAsync(WaitUntil.Completed, data, ifMatch: ifMatch, ifNoneMatch: ifNoneMatch); + UpdateRunResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + UpdateRunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Start_StartsAnUpdateRun() + { + // Generated from example definition: 2025-03-01/UpdateRuns_Start.json + // this example is just showing the usage of "UpdateRuns_Start" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this UpdateRunResource created on azure + // for more information of creating UpdateRunResource, please refer to the document of UpdateRunResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + string updateRunName = "run1"; + ResourceIdentifier updateRunResourceId = UpdateRunResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, updateRunName); + UpdateRunResource updateRun = client.GetUpdateRunResource(updateRunResourceId); + + // invoke the operation + ArmOperation lro = await updateRun.StartAsync(WaitUntil.Completed); + UpdateRunResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + UpdateRunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Start_StartsAnUpdateRunGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-01/UpdateRuns_Start_MaximumSet_Gen.json + // this example is just showing the usage of "UpdateRuns_Start" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this UpdateRunResource created on azure + // for more information of creating UpdateRunResource, please refer to the document of UpdateRunResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgfleets"; + string fleetName = "fleet1"; + string updateRunName = "fleet1"; + ResourceIdentifier updateRunResourceId = UpdateRunResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, updateRunName); + UpdateRunResource updateRun = client.GetUpdateRunResource(updateRunResourceId); + + // invoke the operation + string ifMatch = "bvhjlqeindkmljbbiypbqiaqgtkhlu"; + ArmOperation lro = await updateRun.StartAsync(WaitUntil.Completed, ifMatch: ifMatch); + UpdateRunResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + UpdateRunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Stop_StopsAnUpdateRun() + { + // Generated from example definition: 2025-03-01/UpdateRuns_Stop.json + // this example is just showing the usage of "UpdateRuns_Stop" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this UpdateRunResource created on azure + // for more information of creating UpdateRunResource, please refer to the document of UpdateRunResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + string updateRunName = "run1"; + ResourceIdentifier updateRunResourceId = UpdateRunResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, updateRunName); + UpdateRunResource updateRun = client.GetUpdateRunResource(updateRunResourceId); + + // invoke the operation + ArmOperation lro = await updateRun.StopAsync(WaitUntil.Completed); + UpdateRunResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + UpdateRunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Stop_StopsAnUpdateRunGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-01/UpdateRuns_Stop_MaximumSet_Gen.json + // this example is just showing the usage of "UpdateRuns_Stop" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this UpdateRunResource created on azure + // for more information of creating UpdateRunResource, please refer to the document of UpdateRunResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgfleets"; + string fleetName = "fleet1"; + string updateRunName = "fleet1"; + ResourceIdentifier updateRunResourceId = UpdateRunResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, updateRunName); + UpdateRunResource updateRun = client.GetUpdateRunResource(updateRunResourceId); + + // invoke the operation + string ifMatch = "jb"; + ArmOperation lro = await updateRun.StopAsync(WaitUntil.Completed, ifMatch: ifMatch); + UpdateRunResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + UpdateRunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Skip_SkipsOneOrMoreMemberGroupStageAfterStageWaitSOfAnUpdateRun() + { + // Generated from example definition: 2025-03-01/UpdateRuns_Skip.json + // this example is just showing the usage of "UpdateRuns_Skip" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this UpdateRunResource created on azure + // for more information of creating UpdateRunResource, please refer to the document of UpdateRunResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + string updateRunName = "run1"; + ResourceIdentifier updateRunResourceId = UpdateRunResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, updateRunName); + UpdateRunResource updateRun = client.GetUpdateRunResource(updateRunResourceId); + + // invoke the operation + SkipProperties body = new SkipProperties(new SkipTarget[] + { +new SkipTarget(TargetType.Member, "member-one"), +new SkipTarget(TargetType.AfterStageWait, "stage1") + }); + ArmOperation lro = await updateRun.SkipAsync(WaitUntil.Completed, body); + UpdateRunResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + UpdateRunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Skip_SkipsOneOrMoreMemberGroupStageAfterStageWaitSOfAnUpdateRunGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-01/UpdateRuns_Skip_MaximumSet_Gen.json + // this example is just showing the usage of "UpdateRuns_Skip" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this UpdateRunResource created on azure + // for more information of creating UpdateRunResource, please refer to the document of UpdateRunResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgfleets"; + string fleetName = "fleet1"; + string updateRunName = "fleet1"; + ResourceIdentifier updateRunResourceId = UpdateRunResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, updateRunName); + UpdateRunResource updateRun = client.GetUpdateRunResource(updateRunResourceId); + + // invoke the operation + SkipProperties body = new SkipProperties(new SkipTarget[] + { +new SkipTarget(TargetType.Member, "member-one"), +new SkipTarget(TargetType.AfterStageWait, "stage1") + }); + string ifMatch = "rncfubdzrhcihvpqflbsjvoau"; + ArmOperation lro = await updateRun.SkipAsync(WaitUntil.Completed, body, ifMatch: ifMatch); + UpdateRunResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + UpdateRunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Azure.ResourceManager.ContainerServiceFleet.csproj b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Azure.ResourceManager.ContainerServiceFleet.csproj new file mode 100644 index 000000000000..330db38c90e1 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Azure.ResourceManager.ContainerServiceFleet.csproj @@ -0,0 +1,8 @@ + + + Azure Resource Manager client SDK for Azure resource provider ContainerServiceFleet. + 1.0.0-beta.1 + azure;management;arm;resource manager;containerservicefleet + Azure.ResourceManager.ContainerServiceFleet + + diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ArmContainerServiceFleetModelFactory.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ArmContainerServiceFleetModelFactory.cs new file mode 100644 index 000000000000..d822d2d56d99 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ArmContainerServiceFleetModelFactory.cs @@ -0,0 +1,352 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// Model factory for models. + public static partial class ArmContainerServiceFleetModelFactory + { + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The status of the last operation. + /// The FleetHubProfile configures the Fleet's hub. + /// Status information for the fleet. + /// 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. + /// Managed identity. + /// A new instance for mocking. + public static FleetData FleetData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, FleetProvisioningState? provisioningState = null, FleetHubProfile hubProfile = null, FleetStatus status = null, string etag = null, ManagedServiceIdentity identity = null) + { + tags ??= new Dictionary(); + + return new FleetData( + id, + name, + resourceType, + systemData, + tags, + location, + provisioningState, + hubProfile, + status, + etag, + identity, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// DNS prefix used to create the FQDN for the Fleet hub. + /// The access profile for the Fleet hub API server. + /// The agent profile for the Fleet hub. + /// The FQDN of the Fleet hub. + /// The Kubernetes version of the Fleet hub. + /// The Azure Portal FQDN of the Fleet hub. + /// A new instance for mocking. + public static FleetHubProfile FleetHubProfile(string dnsPrefix = null, APIServerAccessProfile apiServerAccessProfile = null, AgentProfile agentProfile = null, string fqdn = null, string kubernetesVersion = null, string portalFqdn = null) + { + return new FleetHubProfile( + dnsPrefix, + apiServerAccessProfile, + agentProfile, + fqdn, + kubernetesVersion, + portalFqdn, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The last operation ID for the fleet. + /// The last operation error for the fleet. + /// A new instance for mocking. + public static FleetStatus FleetStatus(string lastOperationId = null, ResponseError lastOperationError = null) + { + return new FleetStatus(lastOperationId, lastOperationError, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. + /// The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. + /// The type of managed identity assigned to this resource. + /// The identities assigned to this resource by the user. + /// A new instance for mocking. + public static ManagedServiceIdentity ManagedServiceIdentity(Guid? principalId = null, Guid? tenantId = null, ManagedServiceIdentityType type = default, IDictionary userAssignedIdentities = null) + { + userAssignedIdentities ??= new Dictionary(); + + return new ManagedServiceIdentity(principalId, tenantId, type, userAssignedIdentities, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Array of base64-encoded Kubernetes configuration files. + /// A new instance for mocking. + public static FleetCredentialResults FleetCredentialResults(IEnumerable kubeconfigs = null) + { + kubeconfigs ??= new List(); + + return new FleetCredentialResults(kubeconfigs?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The name of the credential. + /// Base64-encoded Kubernetes configuration file. + /// A new instance for mocking. + public static FleetCredentialResult FleetCredentialResult(string name = null, byte[] value = null) + { + return new FleetCredentialResult(name, value, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The ARM resource id of the cluster that joins the Fleet. Must be a valid Azure resource id. e.g.: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{clusterName}'. + /// The group this member belongs to for multi-cluster update management. + /// The status of the last operation. + /// Status information of the last operation for fleet member. + /// 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. + /// A new instance for mocking. + public static FleetMemberData FleetMemberData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ResourceIdentifier clusterResourceId = null, string group = null, FleetMemberProvisioningState? provisioningState = null, FleetMemberStatus status = null, string etag = null) + { + return new FleetMemberData( + id, + name, + resourceType, + systemData, + clusterResourceId, + group, + provisioningState, + status, + etag, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The last operation ID for the fleet member. + /// The last operation error of the fleet member. + /// A new instance for mocking. + public static FleetMemberStatus FleetMemberStatus(string lastOperationId = null, ResponseError lastOperationError = null) + { + return new FleetMemberStatus(lastOperationId, lastOperationError, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The provisioning state of the UpdateRun resource. + /// + /// The resource id of the FleetUpdateStrategy resource to reference. + /// + /// When creating a new run, there are three ways to define a strategy for the run: + /// 1. Define a new strategy in place: Set the "strategy" field. + /// 2. Use an existing strategy: Set the "updateStrategyId" field. (since 2023-08-15-preview) + /// 3. Use the default strategy to update all the members one by one: Leave both "updateStrategyId" and "strategy" unset. (since 2023-08-15-preview) + /// + /// Setting both "updateStrategyId" and "strategy" is invalid. + /// + /// UpdateRuns created by "updateStrategyId" snapshot the referenced UpdateStrategy at the time of creation and store it in the "strategy" field. + /// Subsequent changes to the referenced FleetUpdateStrategy resource do not propagate. + /// UpdateRunStrategy changes can be made directly on the "strategy" field before launching the UpdateRun. + /// + /// + /// The strategy defines the order in which the clusters will be updated. + /// If not set, all members will be updated sequentially. The UpdateRun status will show a single UpdateStage and a single UpdateGroup targeting all members. + /// The strategy of the UpdateRun can be modified until the run is started. + /// + /// The update to be applied to all clusters in the UpdateRun. The managedClusterUpdate can be modified until the run is started. + /// The status of the UpdateRun. + /// AutoUpgradeProfileId is the id of an auto upgrade profile resource. + /// 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. + /// A new instance for mocking. + public static UpdateRunData UpdateRunData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, UpdateRunProvisioningState? provisioningState = null, ResourceIdentifier updateStrategyId = null, IEnumerable strategyStages = null, ManagedClusterUpdate managedClusterUpdate = null, UpdateRunStatus status = null, ResourceIdentifier autoUpgradeProfileId = null, string etag = null) + { + strategyStages ??= new List(); + + return new UpdateRunData( + id, + name, + resourceType, + systemData, + provisioningState, + updateStrategyId, + strategyStages != null ? new UpdateRunStrategy(strategyStages?.ToList(), serializedAdditionalRawData: null) : null, + managedClusterUpdate, + status, + autoUpgradeProfileId, + etag, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The image version to upgrade the nodes to (e.g., 'AKSUbuntu-1804gen2containerd-2022.12.13'). + /// A new instance for mocking. + public static NodeImageVersion NodeImageVersion(string version = null) + { + return new NodeImageVersion(version, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The status of the UpdateRun. + /// The stages composing an update run. Stages are run sequentially withing an UpdateRun. + /// The node image upgrade specs for the update run. It is only set in update run when `NodeImageSelection.type` is `Consistent`. + /// A new instance for mocking. + public static UpdateRunStatus UpdateRunStatus(UpdateStatus status = null, IEnumerable stages = null, IEnumerable selectedNodeImageVersions = null) + { + stages ??= new List(); + selectedNodeImageVersions ??= new List(); + + return new UpdateRunStatus(status, stages?.ToList(), selectedNodeImageVersions != null ? new NodeImageSelectionStatus(selectedNodeImageVersions?.ToList(), serializedAdditionalRawData: null) : null, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The time the operation or group was started. + /// The time the operation or group was completed. + /// The State of the operation or group. + /// The error details when a failure is encountered. + /// A new instance for mocking. + public static UpdateStatus UpdateStatus(DateTimeOffset? startOn = null, DateTimeOffset? completedOn = null, UpdateState? state = null, ResponseError error = null) + { + return new UpdateStatus(startOn, completedOn, state, error, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The status of the UpdateStage. + /// The name of the UpdateStage. + /// The list of groups to be updated as part of this UpdateStage. + /// The status of the wait period configured on the UpdateStage. + /// A new instance for mocking. + public static UpdateStageStatus UpdateStageStatus(UpdateStatus status = null, string name = null, IEnumerable groups = null, WaitStatus afterStageWaitStatus = null) + { + groups ??= new List(); + + return new UpdateStageStatus(status, name, groups?.ToList(), afterStageWaitStatus, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The status of the UpdateGroup. + /// The name of the UpdateGroup. + /// The list of member this UpdateGroup updates. + /// A new instance for mocking. + public static UpdateGroupStatus UpdateGroupStatus(UpdateStatus status = null, string name = null, IEnumerable members = null) + { + members ??= new List(); + + return new UpdateGroupStatus(status, name, members?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The status of the MemberUpdate operation. + /// The name of the FleetMember. + /// The Azure resource id of the target Kubernetes cluster. + /// The operation resource id of the latest attempt to perform the operation. + /// The status message after processing the member update operation. + /// A new instance for mocking. + public static MemberUpdateStatus MemberUpdateStatus(UpdateStatus status = null, string name = null, string clusterResourceId = null, string operationId = null, string message = null) + { + return new MemberUpdateStatus( + status, + name, + clusterResourceId, + operationId, + message, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The status of the wait duration. + /// The wait duration configured in seconds. + /// A new instance for mocking. + public static WaitStatus WaitStatus(UpdateStatus status = null, int? waitDurationInSeconds = null) + { + return new WaitStatus(status, waitDurationInSeconds, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The provisioning state of the UpdateStrategy resource. + /// Defines the update sequence of the clusters. + /// 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. + /// A new instance for mocking. + public static FleetUpdateStrategyData FleetUpdateStrategyData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, FleetUpdateStrategyProvisioningState? provisioningState = null, IEnumerable strategyStages = null, string etag = null) + { + strategyStages ??= new List(); + + return new FleetUpdateStrategyData( + id, + name, + resourceType, + systemData, + provisioningState, + strategyStages != null ? new UpdateRunStrategy(strategyStages?.ToList(), serializedAdditionalRawData: null) : null, + etag, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The provisioning state of the AutoUpgradeProfile resource. + /// The resource id of the UpdateStrategy resource to reference. If not specified, the auto upgrade will run on all clusters which are members of the fleet. + /// Configures how auto-upgrade will be run. + /// The node image upgrade to be applied to the target clusters in auto upgrade. + /// + /// If set to False: the auto upgrade has effect - target managed clusters will be upgraded on schedule. + /// If set to True: the auto upgrade has no effect - no upgrade will be run on the target managed clusters. + /// This is a boolean and not an enum because enabled/disabled are all available states of the auto upgrade profile. + /// By default, this is set to False. + /// + /// The status of the auto upgrade profile. + /// 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. + /// A new instance for mocking. + public static AutoUpgradeProfileData AutoUpgradeProfileData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, AutoUpgradeProfileProvisioningState? provisioningState = null, ResourceIdentifier updateStrategyId = null, UpgradeChannel? channel = null, AutoUpgradeNodeImageSelectionType? nodeImageSelectionType = null, bool? disabled = null, AutoUpgradeProfileStatus autoUpgradeProfileStatus = null, string etag = null) + { + return new AutoUpgradeProfileData( + id, + name, + resourceType, + systemData, + provisioningState, + updateStrategyId, + channel, + nodeImageSelectionType.HasValue ? new AutoUpgradeNodeImageSelection(nodeImageSelectionType.Value, serializedAdditionalRawData: null) : null, + disabled, + autoUpgradeProfileStatus, + etag, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The UTC time of the last attempt to automatically create and start an UpdateRun as triggered by the release of new versions. + /// The status of the last AutoUpgrade trigger. + /// The error details of the last trigger. + /// The target Kubernetes version or node image versions of the last trigger. + /// A new instance for mocking. + public static AutoUpgradeProfileStatus AutoUpgradeProfileStatus(DateTimeOffset? lastTriggeredOn = null, AutoUpgradeLastTriggerStatus? lastTriggerStatus = null, ResponseError lastTriggerError = null, IEnumerable lastTriggerUpgradeVersions = null) + { + lastTriggerUpgradeVersions ??= new List(); + + return new AutoUpgradeProfileStatus(lastTriggeredOn, lastTriggerStatus, lastTriggerError, lastTriggerUpgradeVersions?.ToList(), serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/AutoUpgradeProfileCollection.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/AutoUpgradeProfileCollection.cs new file mode 100644 index 000000000000..35a1a5bf80d6 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/AutoUpgradeProfileCollection.cs @@ -0,0 +1,497 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetAutoUpgradeProfiles method from an instance of . + /// + public partial class AutoUpgradeProfileCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _autoUpgradeProfileClientDiagnostics; + private readonly AutoUpgradeProfilesRestOperations _autoUpgradeProfileRestClient; + + /// Initializes a new instance of the class for mocking. + protected AutoUpgradeProfileCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal AutoUpgradeProfileCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _autoUpgradeProfileClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerServiceFleet", AutoUpgradeProfileResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(AutoUpgradeProfileResource.ResourceType, out string autoUpgradeProfileApiVersion); + _autoUpgradeProfileRestClient = new AutoUpgradeProfilesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, autoUpgradeProfileApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != FleetResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, FleetResource.ResourceType), nameof(id)); + } + + /// + /// Create a AutoUpgradeProfile + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/autoUpgradeProfiles/{autoUpgradeProfileName} + /// + /// + /// Operation Id + /// AutoUpgradeProfile_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the AutoUpgradeProfile resource. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string autoUpgradeProfileName, AutoUpgradeProfileData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(autoUpgradeProfileName, nameof(autoUpgradeProfileName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _autoUpgradeProfileClientDiagnostics.CreateScope("AutoUpgradeProfileCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _autoUpgradeProfileRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, autoUpgradeProfileName, data, ifMatch, ifNoneMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceFleetArmOperation(new AutoUpgradeProfileOperationSource(Client), _autoUpgradeProfileClientDiagnostics, Pipeline, _autoUpgradeProfileRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, autoUpgradeProfileName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a AutoUpgradeProfile + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/autoUpgradeProfiles/{autoUpgradeProfileName} + /// + /// + /// Operation Id + /// AutoUpgradeProfile_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the AutoUpgradeProfile resource. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string autoUpgradeProfileName, AutoUpgradeProfileData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(autoUpgradeProfileName, nameof(autoUpgradeProfileName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _autoUpgradeProfileClientDiagnostics.CreateScope("AutoUpgradeProfileCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _autoUpgradeProfileRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, autoUpgradeProfileName, data, ifMatch, ifNoneMatch, cancellationToken); + var operation = new ContainerServiceFleetArmOperation(new AutoUpgradeProfileOperationSource(Client), _autoUpgradeProfileClientDiagnostics, Pipeline, _autoUpgradeProfileRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, autoUpgradeProfileName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a AutoUpgradeProfile + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/autoUpgradeProfiles/{autoUpgradeProfileName} + /// + /// + /// Operation Id + /// AutoUpgradeProfile_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the AutoUpgradeProfile resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string autoUpgradeProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(autoUpgradeProfileName, nameof(autoUpgradeProfileName)); + + using var scope = _autoUpgradeProfileClientDiagnostics.CreateScope("AutoUpgradeProfileCollection.Get"); + scope.Start(); + try + { + var response = await _autoUpgradeProfileRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, autoUpgradeProfileName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AutoUpgradeProfileResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a AutoUpgradeProfile + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/autoUpgradeProfiles/{autoUpgradeProfileName} + /// + /// + /// Operation Id + /// AutoUpgradeProfile_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the AutoUpgradeProfile resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string autoUpgradeProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(autoUpgradeProfileName, nameof(autoUpgradeProfileName)); + + using var scope = _autoUpgradeProfileClientDiagnostics.CreateScope("AutoUpgradeProfileCollection.Get"); + scope.Start(); + try + { + var response = _autoUpgradeProfileRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, autoUpgradeProfileName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AutoUpgradeProfileResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List AutoUpgradeProfile resources by Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/autoUpgradeProfiles + /// + /// + /// Operation Id + /// AutoUpgradeProfile_ListByFleet + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _autoUpgradeProfileRestClient.CreateListByFleetRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _autoUpgradeProfileRestClient.CreateListByFleetNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AutoUpgradeProfileResource(Client, AutoUpgradeProfileData.DeserializeAutoUpgradeProfileData(e)), _autoUpgradeProfileClientDiagnostics, Pipeline, "AutoUpgradeProfileCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List AutoUpgradeProfile resources by Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/autoUpgradeProfiles + /// + /// + /// Operation Id + /// AutoUpgradeProfile_ListByFleet + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _autoUpgradeProfileRestClient.CreateListByFleetRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _autoUpgradeProfileRestClient.CreateListByFleetNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AutoUpgradeProfileResource(Client, AutoUpgradeProfileData.DeserializeAutoUpgradeProfileData(e)), _autoUpgradeProfileClientDiagnostics, Pipeline, "AutoUpgradeProfileCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/autoUpgradeProfiles/{autoUpgradeProfileName} + /// + /// + /// Operation Id + /// AutoUpgradeProfile_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the AutoUpgradeProfile resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string autoUpgradeProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(autoUpgradeProfileName, nameof(autoUpgradeProfileName)); + + using var scope = _autoUpgradeProfileClientDiagnostics.CreateScope("AutoUpgradeProfileCollection.Exists"); + scope.Start(); + try + { + var response = await _autoUpgradeProfileRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, autoUpgradeProfileName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/autoUpgradeProfiles/{autoUpgradeProfileName} + /// + /// + /// Operation Id + /// AutoUpgradeProfile_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the AutoUpgradeProfile resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string autoUpgradeProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(autoUpgradeProfileName, nameof(autoUpgradeProfileName)); + + using var scope = _autoUpgradeProfileClientDiagnostics.CreateScope("AutoUpgradeProfileCollection.Exists"); + scope.Start(); + try + { + var response = _autoUpgradeProfileRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, autoUpgradeProfileName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/autoUpgradeProfiles/{autoUpgradeProfileName} + /// + /// + /// Operation Id + /// AutoUpgradeProfile_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the AutoUpgradeProfile resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string autoUpgradeProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(autoUpgradeProfileName, nameof(autoUpgradeProfileName)); + + using var scope = _autoUpgradeProfileClientDiagnostics.CreateScope("AutoUpgradeProfileCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _autoUpgradeProfileRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, autoUpgradeProfileName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AutoUpgradeProfileResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/autoUpgradeProfiles/{autoUpgradeProfileName} + /// + /// + /// Operation Id + /// AutoUpgradeProfile_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the AutoUpgradeProfile resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string autoUpgradeProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(autoUpgradeProfileName, nameof(autoUpgradeProfileName)); + + using var scope = _autoUpgradeProfileClientDiagnostics.CreateScope("AutoUpgradeProfileCollection.GetIfExists"); + scope.Start(); + try + { + var response = _autoUpgradeProfileRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, autoUpgradeProfileName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AutoUpgradeProfileResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/AutoUpgradeProfileData.Serialization.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/AutoUpgradeProfileData.Serialization.cs new file mode 100644 index 000000000000..c75ff57cd561 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/AutoUpgradeProfileData.Serialization.cs @@ -0,0 +1,262 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.ContainerServiceFleet.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + public partial class AutoUpgradeProfileData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AutoUpgradeProfileData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (options.Format != "W" && Optional.IsDefined(ETag)) + { + writer.WritePropertyName("eTag"u8); + writer.WriteStringValue(ETag); + } + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(UpdateStrategyId)) + { + writer.WritePropertyName("updateStrategyId"u8); + writer.WriteStringValue(UpdateStrategyId); + } + if (Optional.IsDefined(Channel)) + { + writer.WritePropertyName("channel"u8); + writer.WriteStringValue(Channel.Value.ToString()); + } + if (Optional.IsDefined(NodeImageSelection)) + { + writer.WritePropertyName("nodeImageSelection"u8); + writer.WriteObjectValue(NodeImageSelection, options); + } + if (Optional.IsDefined(Disabled)) + { + writer.WritePropertyName("disabled"u8); + writer.WriteBooleanValue(Disabled.Value); + } + if (Optional.IsDefined(AutoUpgradeProfileStatus)) + { + writer.WritePropertyName("autoUpgradeProfileStatus"u8); + writer.WriteObjectValue(AutoUpgradeProfileStatus, options); + } + writer.WriteEndObject(); + } + + AutoUpgradeProfileData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AutoUpgradeProfileData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAutoUpgradeProfileData(document.RootElement, options); + } + + internal static AutoUpgradeProfileData DeserializeAutoUpgradeProfileData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string etag = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + AutoUpgradeProfileProvisioningState? provisioningState = default; + ResourceIdentifier updateStrategyId = default; + UpgradeChannel? channel = default; + AutoUpgradeNodeImageSelection nodeImageSelection = default; + bool? disabled = default; + AutoUpgradeProfileStatus autoUpgradeProfileStatus = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("eTag"u8)) + { + etag = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new AutoUpgradeProfileProvisioningState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("updateStrategyId"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + updateStrategyId = new ResourceIdentifier(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("channel"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + channel = new UpgradeChannel(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("nodeImageSelection"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nodeImageSelection = AutoUpgradeNodeImageSelection.DeserializeAutoUpgradeNodeImageSelection(property0.Value, options); + continue; + } + if (property0.NameEquals("disabled"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + disabled = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("autoUpgradeProfileStatus"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + autoUpgradeProfileStatus = AutoUpgradeProfileStatus.DeserializeAutoUpgradeProfileStatus(property0.Value, options); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AutoUpgradeProfileData( + id, + name, + type, + systemData, + provisioningState, + updateStrategyId, + channel, + nodeImageSelection, + disabled, + autoUpgradeProfileStatus, + etag, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AutoUpgradeProfileData)} does not support writing '{options.Format}' format."); + } + } + + AutoUpgradeProfileData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAutoUpgradeProfileData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AutoUpgradeProfileData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/AutoUpgradeProfileData.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/AutoUpgradeProfileData.cs new file mode 100644 index 000000000000..3ce2079e561b --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/AutoUpgradeProfileData.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.ContainerServiceFleet.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + /// + /// A class representing the AutoUpgradeProfile data model. + /// The AutoUpgradeProfile resource. + /// + public partial class AutoUpgradeProfileData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public AutoUpgradeProfileData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The provisioning state of the AutoUpgradeProfile resource. + /// The resource id of the UpdateStrategy resource to reference. If not specified, the auto upgrade will run on all clusters which are members of the fleet. + /// Configures how auto-upgrade will be run. + /// The node image upgrade to be applied to the target clusters in auto upgrade. + /// + /// If set to False: the auto upgrade has effect - target managed clusters will be upgraded on schedule. + /// If set to True: the auto upgrade has no effect - no upgrade will be run on the target managed clusters. + /// This is a boolean and not an enum because enabled/disabled are all available states of the auto upgrade profile. + /// By default, this is set to False. + /// + /// The status of the auto upgrade profile. + /// 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. + /// Keeps track of any properties unknown to the library. + internal AutoUpgradeProfileData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, AutoUpgradeProfileProvisioningState? provisioningState, ResourceIdentifier updateStrategyId, UpgradeChannel? channel, AutoUpgradeNodeImageSelection nodeImageSelection, bool? disabled, AutoUpgradeProfileStatus autoUpgradeProfileStatus, string etag, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + ProvisioningState = provisioningState; + UpdateStrategyId = updateStrategyId; + Channel = channel; + NodeImageSelection = nodeImageSelection; + Disabled = disabled; + AutoUpgradeProfileStatus = autoUpgradeProfileStatus; + ETag = etag; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The provisioning state of the AutoUpgradeProfile resource. + public AutoUpgradeProfileProvisioningState? ProvisioningState { get; } + /// The resource id of the UpdateStrategy resource to reference. If not specified, the auto upgrade will run on all clusters which are members of the fleet. + public ResourceIdentifier UpdateStrategyId { get; set; } + /// Configures how auto-upgrade will be run. + public UpgradeChannel? Channel { get; set; } + /// The node image upgrade to be applied to the target clusters in auto upgrade. + internal AutoUpgradeNodeImageSelection NodeImageSelection { get; set; } + /// The node image upgrade type. + public AutoUpgradeNodeImageSelectionType? NodeImageSelectionType + { + get => NodeImageSelection is null ? default(AutoUpgradeNodeImageSelectionType?) : NodeImageSelection.Type; + set + { + NodeImageSelection = value.HasValue ? new AutoUpgradeNodeImageSelection(value.Value) : null; + } + } + + /// + /// If set to False: the auto upgrade has effect - target managed clusters will be upgraded on schedule. + /// If set to True: the auto upgrade has no effect - no upgrade will be run on the target managed clusters. + /// This is a boolean and not an enum because enabled/disabled are all available states of the auto upgrade profile. + /// By default, this is set to False. + /// + public bool? Disabled { get; set; } + /// The status of the auto upgrade profile. + public AutoUpgradeProfileStatus AutoUpgradeProfileStatus { get; set; } + /// 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. + public string ETag { get; } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/AutoUpgradeProfileResource.Serialization.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/AutoUpgradeProfileResource.Serialization.cs new file mode 100644 index 000000000000..9df7a8401d6f --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/AutoUpgradeProfileResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + public partial class AutoUpgradeProfileResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + AutoUpgradeProfileData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + AutoUpgradeProfileData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/AutoUpgradeProfileResource.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/AutoUpgradeProfileResource.cs new file mode 100644 index 000000000000..b87d8e786c1e --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/AutoUpgradeProfileResource.cs @@ -0,0 +1,433 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + /// + /// A Class representing an AutoUpgradeProfile along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetAutoUpgradeProfileResource method. + /// Otherwise you can get one from its parent resource using the GetAutoUpgradeProfile method. + /// + public partial class AutoUpgradeProfileResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The fleetName. + /// The autoUpgradeProfileName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string autoUpgradeProfileName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/autoUpgradeProfiles/{autoUpgradeProfileName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _autoUpgradeProfileClientDiagnostics; + private readonly AutoUpgradeProfilesRestOperations _autoUpgradeProfileRestClient; + private readonly ClientDiagnostics _autoUpgradeProfileOperationsClientDiagnostics; + private readonly AutoUpgradeProfileRestOperations _autoUpgradeProfileOperationsRestClient; + private readonly AutoUpgradeProfileData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.ContainerService/fleets/autoUpgradeProfiles"; + + /// Initializes a new instance of the class for mocking. + protected AutoUpgradeProfileResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal AutoUpgradeProfileResource(ArmClient client, AutoUpgradeProfileData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal AutoUpgradeProfileResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _autoUpgradeProfileClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerServiceFleet", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string autoUpgradeProfileApiVersion); + _autoUpgradeProfileRestClient = new AutoUpgradeProfilesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, autoUpgradeProfileApiVersion); + _autoUpgradeProfileOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerServiceFleet", ProviderConstants.DefaultProviderNamespace, Diagnostics); + _autoUpgradeProfileOperationsRestClient = new AutoUpgradeProfileRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual AutoUpgradeProfileData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a AutoUpgradeProfile + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/autoUpgradeProfiles/{autoUpgradeProfileName} + /// + /// + /// Operation Id + /// AutoUpgradeProfile_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _autoUpgradeProfileClientDiagnostics.CreateScope("AutoUpgradeProfileResource.Get"); + scope.Start(); + try + { + var response = await _autoUpgradeProfileRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AutoUpgradeProfileResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a AutoUpgradeProfile + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/autoUpgradeProfiles/{autoUpgradeProfileName} + /// + /// + /// Operation Id + /// AutoUpgradeProfile_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _autoUpgradeProfileClientDiagnostics.CreateScope("AutoUpgradeProfileResource.Get"); + scope.Start(); + try + { + var response = _autoUpgradeProfileRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AutoUpgradeProfileResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a AutoUpgradeProfile + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/autoUpgradeProfiles/{autoUpgradeProfileName} + /// + /// + /// Operation Id + /// AutoUpgradeProfile_Delete + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, string ifMatch = null, CancellationToken cancellationToken = default) + { + using var scope = _autoUpgradeProfileClientDiagnostics.CreateScope("AutoUpgradeProfileResource.Delete"); + scope.Start(); + try + { + var response = await _autoUpgradeProfileRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceFleetArmOperation(_autoUpgradeProfileClientDiagnostics, Pipeline, _autoUpgradeProfileRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a AutoUpgradeProfile + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/autoUpgradeProfiles/{autoUpgradeProfileName} + /// + /// + /// Operation Id + /// AutoUpgradeProfile_Delete + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, string ifMatch = null, CancellationToken cancellationToken = default) + { + using var scope = _autoUpgradeProfileClientDiagnostics.CreateScope("AutoUpgradeProfileResource.Delete"); + scope.Start(); + try + { + var response = _autoUpgradeProfileRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch, cancellationToken); + var operation = new ContainerServiceFleetArmOperation(_autoUpgradeProfileClientDiagnostics, Pipeline, _autoUpgradeProfileRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a AutoUpgradeProfile + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/autoUpgradeProfiles/{autoUpgradeProfileName} + /// + /// + /// Operation Id + /// AutoUpgradeProfile_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, AutoUpgradeProfileData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _autoUpgradeProfileClientDiagnostics.CreateScope("AutoUpgradeProfileResource.Update"); + scope.Start(); + try + { + var response = await _autoUpgradeProfileRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceFleetArmOperation(new AutoUpgradeProfileOperationSource(Client), _autoUpgradeProfileClientDiagnostics, Pipeline, _autoUpgradeProfileRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a AutoUpgradeProfile + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/autoUpgradeProfiles/{autoUpgradeProfileName} + /// + /// + /// Operation Id + /// AutoUpgradeProfile_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, AutoUpgradeProfileData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _autoUpgradeProfileClientDiagnostics.CreateScope("AutoUpgradeProfileResource.Update"); + scope.Start(); + try + { + var response = _autoUpgradeProfileRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch, cancellationToken); + var operation = new ContainerServiceFleetArmOperation(new AutoUpgradeProfileOperationSource(Client), _autoUpgradeProfileClientDiagnostics, Pipeline, _autoUpgradeProfileRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Generates an update run for a given auto upgrade profile. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/autoUpgradeProfiles/{autoUpgradeProfileName}/generateUpdateRun + /// + /// + /// Operation Id + /// AutoUpgradeProfileOperations_GenerateUpdateRun + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task GenerateUpdateRunAutoUpgradeProfileOperationAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _autoUpgradeProfileOperationsClientDiagnostics.CreateScope("AutoUpgradeProfileResource.GenerateUpdateRunAutoUpgradeProfileOperation"); + scope.Start(); + try + { + var response = await _autoUpgradeProfileOperationsRestClient.GenerateUpdateRunAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceFleetArmOperation(_autoUpgradeProfileOperationsClientDiagnostics, Pipeline, _autoUpgradeProfileOperationsRestClient.CreateGenerateUpdateRunRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Generates an update run for a given auto upgrade profile. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/autoUpgradeProfiles/{autoUpgradeProfileName}/generateUpdateRun + /// + /// + /// Operation Id + /// AutoUpgradeProfileOperations_GenerateUpdateRun + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation GenerateUpdateRunAutoUpgradeProfileOperation(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _autoUpgradeProfileOperationsClientDiagnostics.CreateScope("AutoUpgradeProfileResource.GenerateUpdateRunAutoUpgradeProfileOperation"); + scope.Start(); + try + { + var response = _autoUpgradeProfileOperationsRestClient.GenerateUpdateRun(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new ContainerServiceFleetArmOperation(_autoUpgradeProfileOperationsClientDiagnostics, Pipeline, _autoUpgradeProfileOperationsRestClient.CreateGenerateUpdateRunRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/ContainerServiceFleetExtensions.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/ContainerServiceFleetExtensions.cs new file mode 100644 index 000000000000..182dd3489b5d --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/ContainerServiceFleetExtensions.cs @@ -0,0 +1,295 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.ResourceManager.ContainerServiceFleet.Mocking; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + /// A class to add extension methods to Azure.ResourceManager.ContainerServiceFleet. + public static partial class ContainerServiceFleetExtensions + { + private static MockableContainerServiceFleetArmClient GetMockableContainerServiceFleetArmClient(ArmClient client) + { + return client.GetCachedClient(client0 => new MockableContainerServiceFleetArmClient(client0)); + } + + private static MockableContainerServiceFleetResourceGroupResource GetMockableContainerServiceFleetResourceGroupResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableContainerServiceFleetResourceGroupResource(client, resource.Id)); + } + + private static MockableContainerServiceFleetSubscriptionResource GetMockableContainerServiceFleetSubscriptionResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableContainerServiceFleetSubscriptionResource(client, resource.Id)); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static FleetResource GetFleetResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableContainerServiceFleetArmClient(client).GetFleetResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static FleetMemberResource GetFleetMemberResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableContainerServiceFleetArmClient(client).GetFleetMemberResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static UpdateRunResource GetUpdateRunResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableContainerServiceFleetArmClient(client).GetUpdateRunResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static FleetUpdateStrategyResource GetFleetUpdateStrategyResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableContainerServiceFleetArmClient(client).GetFleetUpdateStrategyResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static AutoUpgradeProfileResource GetAutoUpgradeProfileResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableContainerServiceFleetArmClient(client).GetAutoUpgradeProfileResource(id); + } + + /// + /// Gets a collection of FleetResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// is null. + /// An object representing collection of FleetResources and their operations over a FleetResource. + public static FleetCollection GetFleets(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableContainerServiceFleetResourceGroupResource(resourceGroupResource).GetFleets(); + } + + /// + /// Gets a Fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Fleet resource. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetFleetAsync(this ResourceGroupResource resourceGroupResource, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableContainerServiceFleetResourceGroupResource(resourceGroupResource).GetFleetAsync(fleetName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a Fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Fleet resource. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetFleet(this ResourceGroupResource resourceGroupResource, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableContainerServiceFleetResourceGroupResource(resourceGroupResource).GetFleet(fleetName, cancellationToken); + } + + /// + /// Lists fleets in the specified subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/fleets + /// + /// + /// Operation Id + /// Fleet_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetFleetsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableContainerServiceFleetSubscriptionResource(subscriptionResource).GetFleetsAsync(cancellationToken); + } + + /// + /// Lists fleets in the specified subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/fleets + /// + /// + /// Operation Id + /// Fleet_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetFleets(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableContainerServiceFleetSubscriptionResource(subscriptionResource).GetFleets(cancellationToken); + } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/MockableContainerServiceFleetArmClient.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/MockableContainerServiceFleetArmClient.cs new file mode 100644 index 000000000000..fa6847c37109 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/MockableContainerServiceFleetArmClient.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class MockableContainerServiceFleetArmClient : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableContainerServiceFleetArmClient() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MockableContainerServiceFleetArmClient(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal MockableContainerServiceFleetArmClient(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual FleetResource GetFleetResource(ResourceIdentifier id) + { + FleetResource.ValidateResourceId(id); + return new FleetResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual FleetMemberResource GetFleetMemberResource(ResourceIdentifier id) + { + FleetMemberResource.ValidateResourceId(id); + return new FleetMemberResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual UpdateRunResource GetUpdateRunResource(ResourceIdentifier id) + { + UpdateRunResource.ValidateResourceId(id); + return new UpdateRunResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual FleetUpdateStrategyResource GetFleetUpdateStrategyResource(ResourceIdentifier id) + { + FleetUpdateStrategyResource.ValidateResourceId(id); + return new FleetUpdateStrategyResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AutoUpgradeProfileResource GetAutoUpgradeProfileResource(ResourceIdentifier id) + { + AutoUpgradeProfileResource.ValidateResourceId(id); + return new AutoUpgradeProfileResource(Client, id); + } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/MockableContainerServiceFleetResourceGroupResource.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/MockableContainerServiceFleetResourceGroupResource.cs new file mode 100644 index 000000000000..d7a49a43baf7 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/MockableContainerServiceFleetResourceGroupResource.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class MockableContainerServiceFleetResourceGroupResource : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableContainerServiceFleetResourceGroupResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MockableContainerServiceFleetResourceGroupResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of FleetResources in the ResourceGroupResource. + /// An object representing collection of FleetResources and their operations over a FleetResource. + public virtual FleetCollection GetFleets() + { + return GetCachedClient(client => new FleetCollection(client, Id)); + } + + /// + /// Gets a Fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Fleet resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetFleetAsync(string fleetName, CancellationToken cancellationToken = default) + { + return await GetFleets().GetAsync(fleetName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a Fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Fleet resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetFleet(string fleetName, CancellationToken cancellationToken = default) + { + return GetFleets().Get(fleetName, cancellationToken); + } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/MockableContainerServiceFleetSubscriptionResource.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/MockableContainerServiceFleetSubscriptionResource.cs new file mode 100644 index 000000000000..4125b86534a9 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/MockableContainerServiceFleetSubscriptionResource.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ContainerServiceFleet.Mocking +{ + /// A class to add extension methods to SubscriptionResource. + public partial class MockableContainerServiceFleetSubscriptionResource : ArmResource + { + private ClientDiagnostics _fleetClientDiagnostics; + private FleetsRestOperations _fleetRestClient; + + /// Initializes a new instance of the class for mocking. + protected MockableContainerServiceFleetSubscriptionResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MockableContainerServiceFleetSubscriptionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics FleetClientDiagnostics => _fleetClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ContainerServiceFleet", FleetResource.ResourceType.Namespace, Diagnostics); + private FleetsRestOperations FleetRestClient => _fleetRestClient ??= new FleetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(FleetResource.ResourceType)); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Lists fleets in the specified subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/fleets + /// + /// + /// Operation Id + /// Fleet_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetFleetsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => FleetRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => FleetRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FleetResource(Client, FleetData.DeserializeFleetData(e)), FleetClientDiagnostics, Pipeline, "MockableContainerServiceFleetSubscriptionResource.GetFleets", "value", "nextLink", cancellationToken); + } + + /// + /// Lists fleets in the specified subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/fleets + /// + /// + /// Operation Id + /// Fleet_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetFleets(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => FleetRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => FleetRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FleetResource(Client, FleetData.DeserializeFleetData(e)), FleetClientDiagnostics, Pipeline, "MockableContainerServiceFleetSubscriptionResource.GetFleets", "value", "nextLink", cancellationToken); + } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetCollection.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetCollection.cs new file mode 100644 index 000000000000..8019932a52a6 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetCollection.cs @@ -0,0 +1,498 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetFleets method from an instance of . + /// + public partial class FleetCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _fleetClientDiagnostics; + private readonly FleetsRestOperations _fleetRestClient; + + /// Initializes a new instance of the class for mocking. + protected FleetCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal FleetCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fleetClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerServiceFleet", FleetResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(FleetResource.ResourceType, out string fleetApiVersion); + _fleetRestClient = new FleetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceGroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); + } + + /// + /// Creates or updates a Fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Create + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the Fleet resource. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string fleetName, FleetData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _fleetRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, fleetName, data, ifMatch, ifNoneMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceFleetArmOperation(new FleetOperationSource(Client), _fleetClientDiagnostics, Pipeline, _fleetRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, fleetName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates a Fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Create + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the Fleet resource. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string fleetName, FleetData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _fleetRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, fleetName, data, ifMatch, ifNoneMatch, cancellationToken); + var operation = new ContainerServiceFleetArmOperation(new FleetOperationSource(Client), _fleetClientDiagnostics, Pipeline, _fleetRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, fleetName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a Fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Fleet resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetCollection.Get"); + scope.Start(); + try + { + var response = await _fleetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a Fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Fleet resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetCollection.Get"); + scope.Start(); + try + { + var response = _fleetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists fleets in the specified subscription and resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets + /// + /// + /// Operation Id + /// Fleet_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fleetRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fleetRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FleetResource(Client, FleetData.DeserializeFleetData(e)), _fleetClientDiagnostics, Pipeline, "FleetCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Lists fleets in the specified subscription and resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets + /// + /// + /// Operation Id + /// Fleet_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fleetRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fleetRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FleetResource(Client, FleetData.DeserializeFleetData(e)), _fleetClientDiagnostics, Pipeline, "FleetCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Fleet resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetCollection.Exists"); + scope.Start(); + try + { + var response = await _fleetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Fleet resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetCollection.Exists"); + scope.Start(); + try + { + var response = _fleetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Fleet resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _fleetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FleetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Fleet resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetCollection.GetIfExists"); + scope.Start(); + try + { + var response = _fleetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FleetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetData.Serialization.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetData.Serialization.cs new file mode 100644 index 000000000000..e57209838763 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetData.Serialization.cs @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.ContainerServiceFleet.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + public partial class FleetData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (options.Format != "W" && Optional.IsDefined(ETag)) + { + writer.WritePropertyName("eTag"u8); + writer.WriteStringValue(ETag); + } + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + writer.WriteObjectValue(Identity, options); + } + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(HubProfile)) + { + writer.WritePropertyName("hubProfile"u8); + writer.WriteObjectValue(HubProfile, options); + } + if (options.Format != "W" && Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteObjectValue(Status, options); + } + writer.WriteEndObject(); + } + + FleetData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetData(document.RootElement, options); + } + + internal static FleetData DeserializeFleetData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string etag = default; + Models.ManagedServiceIdentity identity = default; + IDictionary tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + FleetProvisioningState? provisioningState = default; + FleetHubProfile hubProfile = default; + FleetStatus status = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("eTag"u8)) + { + etag = property.Value.GetString(); + continue; + } + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identity = Models.ManagedServiceIdentity.DeserializeManagedServiceIdentity(property.Value, options); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new FleetProvisioningState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("hubProfile"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + hubProfile = FleetHubProfile.DeserializeFleetHubProfile(property0.Value, options); + continue; + } + if (property0.NameEquals("status"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = FleetStatus.DeserializeFleetStatus(property0.Value, options); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + provisioningState, + hubProfile, + status, + etag, + identity, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FleetData)} does not support writing '{options.Format}' format."); + } + } + + FleetData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFleetData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetData.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetData.cs new file mode 100644 index 000000000000..3163c815fe28 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetData.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.ContainerServiceFleet.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + /// + /// A class representing the Fleet data model. + /// The Fleet resource. + /// + public partial class FleetData : TrackedResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The location. + public FleetData(AzureLocation location) : base(location) + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The status of the last operation. + /// The FleetHubProfile configures the Fleet's hub. + /// Status information for the fleet. + /// 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. + /// Managed identity. + /// Keeps track of any properties unknown to the library. + internal FleetData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, FleetProvisioningState? provisioningState, FleetHubProfile hubProfile, FleetStatus status, string etag, Models.ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + ProvisioningState = provisioningState; + HubProfile = hubProfile; + Status = status; + ETag = etag; + Identity = identity; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FleetData() + { + } + + /// The status of the last operation. + public FleetProvisioningState? ProvisioningState { get; } + /// The FleetHubProfile configures the Fleet's hub. + public FleetHubProfile HubProfile { get; set; } + /// Status information for the fleet. + public FleetStatus Status { get; } + /// 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. + public string ETag { get; } + /// Managed identity. + public Models.ManagedServiceIdentity Identity { get; set; } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetMemberCollection.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetMemberCollection.cs new file mode 100644 index 000000000000..3a1e1d9ce49b --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetMemberCollection.cs @@ -0,0 +1,497 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetFleetMembers method from an instance of . + /// + public partial class FleetMemberCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _fleetMemberClientDiagnostics; + private readonly FleetMembersRestOperations _fleetMemberRestClient; + + /// Initializes a new instance of the class for mocking. + protected FleetMemberCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal FleetMemberCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fleetMemberClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerServiceFleet", FleetMemberResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(FleetMemberResource.ResourceType, out string fleetMemberApiVersion); + _fleetMemberRestClient = new FleetMembersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetMemberApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != FleetResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, FleetResource.ResourceType), nameof(id)); + } + + /// + /// Create a FleetMember + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName} + /// + /// + /// Operation Id + /// FleetMember_Create + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the Fleet member resource. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string fleetMemberName, FleetMemberData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetMemberName, nameof(fleetMemberName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetMemberClientDiagnostics.CreateScope("FleetMemberCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _fleetMemberRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetMemberName, data, ifMatch, ifNoneMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceFleetArmOperation(new FleetMemberOperationSource(Client), _fleetMemberClientDiagnostics, Pipeline, _fleetMemberRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetMemberName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a FleetMember + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName} + /// + /// + /// Operation Id + /// FleetMember_Create + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the Fleet member resource. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string fleetMemberName, FleetMemberData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetMemberName, nameof(fleetMemberName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetMemberClientDiagnostics.CreateScope("FleetMemberCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _fleetMemberRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetMemberName, data, ifMatch, ifNoneMatch, cancellationToken); + var operation = new ContainerServiceFleetArmOperation(new FleetMemberOperationSource(Client), _fleetMemberClientDiagnostics, Pipeline, _fleetMemberRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetMemberName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a FleetMember + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName} + /// + /// + /// Operation Id + /// FleetMember_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Fleet member resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string fleetMemberName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetMemberName, nameof(fleetMemberName)); + + using var scope = _fleetMemberClientDiagnostics.CreateScope("FleetMemberCollection.Get"); + scope.Start(); + try + { + var response = await _fleetMemberRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetMemberName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetMemberResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a FleetMember + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName} + /// + /// + /// Operation Id + /// FleetMember_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Fleet member resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string fleetMemberName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetMemberName, nameof(fleetMemberName)); + + using var scope = _fleetMemberClientDiagnostics.CreateScope("FleetMemberCollection.Get"); + scope.Start(); + try + { + var response = _fleetMemberRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetMemberName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetMemberResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List FleetMember resources by Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members + /// + /// + /// Operation Id + /// FleetMember_ListByFleet + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fleetMemberRestClient.CreateListByFleetRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fleetMemberRestClient.CreateListByFleetNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FleetMemberResource(Client, FleetMemberData.DeserializeFleetMemberData(e)), _fleetMemberClientDiagnostics, Pipeline, "FleetMemberCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List FleetMember resources by Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members + /// + /// + /// Operation Id + /// FleetMember_ListByFleet + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fleetMemberRestClient.CreateListByFleetRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fleetMemberRestClient.CreateListByFleetNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FleetMemberResource(Client, FleetMemberData.DeserializeFleetMemberData(e)), _fleetMemberClientDiagnostics, Pipeline, "FleetMemberCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName} + /// + /// + /// Operation Id + /// FleetMember_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Fleet member resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string fleetMemberName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetMemberName, nameof(fleetMemberName)); + + using var scope = _fleetMemberClientDiagnostics.CreateScope("FleetMemberCollection.Exists"); + scope.Start(); + try + { + var response = await _fleetMemberRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetMemberName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName} + /// + /// + /// Operation Id + /// FleetMember_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Fleet member resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string fleetMemberName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetMemberName, nameof(fleetMemberName)); + + using var scope = _fleetMemberClientDiagnostics.CreateScope("FleetMemberCollection.Exists"); + scope.Start(); + try + { + var response = _fleetMemberRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetMemberName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName} + /// + /// + /// Operation Id + /// FleetMember_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Fleet member resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string fleetMemberName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetMemberName, nameof(fleetMemberName)); + + using var scope = _fleetMemberClientDiagnostics.CreateScope("FleetMemberCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _fleetMemberRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetMemberName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FleetMemberResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName} + /// + /// + /// Operation Id + /// FleetMember_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Fleet member resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string fleetMemberName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetMemberName, nameof(fleetMemberName)); + + using var scope = _fleetMemberClientDiagnostics.CreateScope("FleetMemberCollection.GetIfExists"); + scope.Start(); + try + { + var response = _fleetMemberRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetMemberName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FleetMemberResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetMemberData.Serialization.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetMemberData.Serialization.cs new file mode 100644 index 000000000000..a8357be6932f --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetMemberData.Serialization.cs @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.ContainerServiceFleet.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + public partial class FleetMemberData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetMemberData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (options.Format != "W" && Optional.IsDefined(ETag)) + { + writer.WritePropertyName("eTag"u8); + writer.WriteStringValue(ETag); + } + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(ClusterResourceId)) + { + writer.WritePropertyName("clusterResourceId"u8); + writer.WriteStringValue(ClusterResourceId); + } + if (Optional.IsDefined(Group)) + { + writer.WritePropertyName("group"u8); + writer.WriteStringValue(Group); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteObjectValue(Status, options); + } + writer.WriteEndObject(); + } + + FleetMemberData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetMemberData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetMemberData(document.RootElement, options); + } + + internal static FleetMemberData DeserializeFleetMemberData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string etag = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + ResourceIdentifier clusterResourceId = default; + string group = default; + FleetMemberProvisioningState? provisioningState = default; + FleetMemberStatus status = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("eTag"u8)) + { + etag = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("clusterResourceId"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + clusterResourceId = new ResourceIdentifier(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("group"u8)) + { + group = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new FleetMemberProvisioningState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("status"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = FleetMemberStatus.DeserializeFleetMemberStatus(property0.Value, options); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetMemberData( + id, + name, + type, + systemData, + clusterResourceId, + group, + provisioningState, + status, + etag, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FleetMemberData)} does not support writing '{options.Format}' format."); + } + } + + FleetMemberData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFleetMemberData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetMemberData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetMemberData.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetMemberData.cs new file mode 100644 index 000000000000..1b5cfee43cde --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetMemberData.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.ContainerServiceFleet.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + /// + /// A class representing the FleetMember data model. + /// A member of the Fleet. It contains a reference to an existing Kubernetes cluster on Azure. + /// + public partial class FleetMemberData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public FleetMemberData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The ARM resource id of the cluster that joins the Fleet. Must be a valid Azure resource id. e.g.: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{clusterName}'. + /// The group this member belongs to for multi-cluster update management. + /// The status of the last operation. + /// Status information of the last operation for fleet member. + /// 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. + /// Keeps track of any properties unknown to the library. + internal FleetMemberData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ResourceIdentifier clusterResourceId, string group, FleetMemberProvisioningState? provisioningState, FleetMemberStatus status, string etag, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + ClusterResourceId = clusterResourceId; + Group = group; + ProvisioningState = provisioningState; + Status = status; + ETag = etag; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The ARM resource id of the cluster that joins the Fleet. Must be a valid Azure resource id. e.g.: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{clusterName}'. + public ResourceIdentifier ClusterResourceId { get; set; } + /// The group this member belongs to for multi-cluster update management. + public string Group { get; set; } + /// The status of the last operation. + public FleetMemberProvisioningState? ProvisioningState { get; } + /// Status information of the last operation for fleet member. + public FleetMemberStatus Status { get; } + /// 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. + public string ETag { get; } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetMemberResource.Serialization.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetMemberResource.Serialization.cs new file mode 100644 index 000000000000..f200c9f84370 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetMemberResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + public partial class FleetMemberResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + FleetMemberData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + FleetMemberData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetMemberResource.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetMemberResource.cs new file mode 100644 index 000000000000..d61eb53fac62 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetMemberResource.cs @@ -0,0 +1,352 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ContainerServiceFleet.Models; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + /// + /// A Class representing a FleetMember along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetFleetMemberResource method. + /// Otherwise you can get one from its parent resource using the GetFleetMember method. + /// + public partial class FleetMemberResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The fleetName. + /// The fleetMemberName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string fleetMemberName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _fleetMemberClientDiagnostics; + private readonly FleetMembersRestOperations _fleetMemberRestClient; + private readonly FleetMemberData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.ContainerService/fleets/members"; + + /// Initializes a new instance of the class for mocking. + protected FleetMemberResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal FleetMemberResource(ArmClient client, FleetMemberData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal FleetMemberResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fleetMemberClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerServiceFleet", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string fleetMemberApiVersion); + _fleetMemberRestClient = new FleetMembersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetMemberApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual FleetMemberData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a FleetMember + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName} + /// + /// + /// Operation Id + /// FleetMember_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _fleetMemberClientDiagnostics.CreateScope("FleetMemberResource.Get"); + scope.Start(); + try + { + var response = await _fleetMemberRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetMemberResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a FleetMember + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName} + /// + /// + /// Operation Id + /// FleetMember_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _fleetMemberClientDiagnostics.CreateScope("FleetMemberResource.Get"); + scope.Start(); + try + { + var response = _fleetMemberRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetMemberResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a FleetMember + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName} + /// + /// + /// Operation Id + /// FleetMember_Delete + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, string ifMatch = null, CancellationToken cancellationToken = default) + { + using var scope = _fleetMemberClientDiagnostics.CreateScope("FleetMemberResource.Delete"); + scope.Start(); + try + { + var response = await _fleetMemberRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceFleetArmOperation(_fleetMemberClientDiagnostics, Pipeline, _fleetMemberRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a FleetMember + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName} + /// + /// + /// Operation Id + /// FleetMember_Delete + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, string ifMatch = null, CancellationToken cancellationToken = default) + { + using var scope = _fleetMemberClientDiagnostics.CreateScope("FleetMemberResource.Delete"); + scope.Start(); + try + { + var response = _fleetMemberRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch, cancellationToken); + var operation = new ContainerServiceFleetArmOperation(_fleetMemberClientDiagnostics, Pipeline, _fleetMemberRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a FleetMember + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName} + /// + /// + /// Operation Id + /// FleetMember_UpdateAsync + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The resource properties to be updated. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, FleetMemberPatch patch, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _fleetMemberClientDiagnostics.CreateScope("FleetMemberResource.Update"); + scope.Start(); + try + { + var response = await _fleetMemberRestClient.UpdateAsyncAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, ifMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceFleetArmOperation(new FleetMemberOperationSource(Client), _fleetMemberClientDiagnostics, Pipeline, _fleetMemberRestClient.CreateUpdateAsyncRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a FleetMember + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName} + /// + /// + /// Operation Id + /// FleetMember_UpdateAsync + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The resource properties to be updated. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, FleetMemberPatch patch, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _fleetMemberClientDiagnostics.CreateScope("FleetMemberResource.Update"); + scope.Start(); + try + { + var response = _fleetMemberRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, ifMatch, cancellationToken); + var operation = new ContainerServiceFleetArmOperation(new FleetMemberOperationSource(Client), _fleetMemberClientDiagnostics, Pipeline, _fleetMemberRestClient.CreateUpdateAsyncRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetResource.Serialization.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetResource.Serialization.cs new file mode 100644 index 000000000000..ebb14900d8d2 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + public partial class FleetResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + FleetData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + FleetData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetResource.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetResource.cs new file mode 100644 index 000000000000..6cb150a4a199 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetResource.cs @@ -0,0 +1,1063 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ContainerServiceFleet.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + /// + /// A Class representing a Fleet along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetFleetResource method. + /// Otherwise you can get one from its parent resource using the GetFleet method. + /// + public partial class FleetResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The fleetName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _fleetClientDiagnostics; + private readonly FleetsRestOperations _fleetRestClient; + private readonly FleetData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.ContainerService/fleets"; + + /// Initializes a new instance of the class for mocking. + protected FleetResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal FleetResource(ArmClient client, FleetData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal FleetResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fleetClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerServiceFleet", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string fleetApiVersion); + _fleetRestClient = new FleetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual FleetData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// Gets a collection of FleetMemberResources in the Fleet. + /// An object representing collection of FleetMemberResources and their operations over a FleetMemberResource. + public virtual FleetMemberCollection GetFleetMembers() + { + return GetCachedClient(client => new FleetMemberCollection(client, Id)); + } + + /// + /// Get a FleetMember + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName} + /// + /// + /// Operation Id + /// FleetMember_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Fleet member resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetFleetMemberAsync(string fleetMemberName, CancellationToken cancellationToken = default) + { + return await GetFleetMembers().GetAsync(fleetMemberName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a FleetMember + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName} + /// + /// + /// Operation Id + /// FleetMember_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Fleet member resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetFleetMember(string fleetMemberName, CancellationToken cancellationToken = default) + { + return GetFleetMembers().Get(fleetMemberName, cancellationToken); + } + + /// Gets a collection of UpdateRunResources in the Fleet. + /// An object representing collection of UpdateRunResources and their operations over a UpdateRunResource. + public virtual UpdateRunCollection GetUpdateRuns() + { + return GetCachedClient(client => new UpdateRunCollection(client, Id)); + } + + /// + /// Get a UpdateRun + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName} + /// + /// + /// Operation Id + /// UpdateRun_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the UpdateRun resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetUpdateRunAsync(string updateRunName, CancellationToken cancellationToken = default) + { + return await GetUpdateRuns().GetAsync(updateRunName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a UpdateRun + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName} + /// + /// + /// Operation Id + /// UpdateRun_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the UpdateRun resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetUpdateRun(string updateRunName, CancellationToken cancellationToken = default) + { + return GetUpdateRuns().Get(updateRunName, cancellationToken); + } + + /// Gets a collection of FleetUpdateStrategyResources in the Fleet. + /// An object representing collection of FleetUpdateStrategyResources and their operations over a FleetUpdateStrategyResource. + public virtual FleetUpdateStrategyCollection GetFleetUpdateStrategies() + { + return GetCachedClient(client => new FleetUpdateStrategyCollection(client, Id)); + } + + /// + /// Get a FleetUpdateStrategy + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} + /// + /// + /// Operation Id + /// FleetUpdateStrategy_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the UpdateStrategy resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetFleetUpdateStrategyAsync(string updateStrategyName, CancellationToken cancellationToken = default) + { + return await GetFleetUpdateStrategies().GetAsync(updateStrategyName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a FleetUpdateStrategy + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} + /// + /// + /// Operation Id + /// FleetUpdateStrategy_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the UpdateStrategy resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetFleetUpdateStrategy(string updateStrategyName, CancellationToken cancellationToken = default) + { + return GetFleetUpdateStrategies().Get(updateStrategyName, cancellationToken); + } + + /// Gets a collection of AutoUpgradeProfileResources in the Fleet. + /// An object representing collection of AutoUpgradeProfileResources and their operations over a AutoUpgradeProfileResource. + public virtual AutoUpgradeProfileCollection GetAutoUpgradeProfiles() + { + return GetCachedClient(client => new AutoUpgradeProfileCollection(client, Id)); + } + + /// + /// Get a AutoUpgradeProfile + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/autoUpgradeProfiles/{autoUpgradeProfileName} + /// + /// + /// Operation Id + /// AutoUpgradeProfile_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the AutoUpgradeProfile resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAutoUpgradeProfileAsync(string autoUpgradeProfileName, CancellationToken cancellationToken = default) + { + return await GetAutoUpgradeProfiles().GetAsync(autoUpgradeProfileName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a AutoUpgradeProfile + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/autoUpgradeProfiles/{autoUpgradeProfileName} + /// + /// + /// Operation Id + /// AutoUpgradeProfile_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the AutoUpgradeProfile resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAutoUpgradeProfile(string autoUpgradeProfileName, CancellationToken cancellationToken = default) + { + return GetAutoUpgradeProfiles().Get(autoUpgradeProfileName, cancellationToken); + } + + /// + /// Gets a Fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.Get"); + scope.Start(); + try + { + var response = await _fleetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a Fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.Get"); + scope.Start(); + try + { + var response = _fleetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Delete + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, string ifMatch = null, CancellationToken cancellationToken = default) + { + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.Delete"); + scope.Start(); + try + { + var response = await _fleetRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, ifMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceFleetArmOperation(_fleetClientDiagnostics, Pipeline, _fleetRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Delete + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, string ifMatch = null, CancellationToken cancellationToken = default) + { + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.Delete"); + scope.Start(); + try + { + var response = _fleetRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, ifMatch, cancellationToken); + var operation = new ContainerServiceFleetArmOperation(_fleetClientDiagnostics, Pipeline, _fleetRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_UpdateAsync + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The resource properties to be updated. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, FleetPatch patch, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.Update"); + scope.Start(); + try + { + var response = await _fleetRestClient.UpdateAsyncAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceFleetArmOperation(new FleetOperationSource(Client), _fleetClientDiagnostics, Pipeline, _fleetRestClient.CreateUpdateAsyncRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_UpdateAsync + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The resource properties to be updated. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, FleetPatch patch, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.Update"); + scope.Start(); + try + { + var response = _fleetRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch, cancellationToken); + var operation = new ContainerServiceFleetArmOperation(new FleetOperationSource(Client), _fleetClientDiagnostics, Pipeline, _fleetRestClient.CreateUpdateAsyncRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists the user credentials of a Fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/listCredentials + /// + /// + /// Operation Id + /// Fleets_ListCredentials + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetCredentialsAsync(CancellationToken cancellationToken = default) + { + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.GetCredentials"); + scope.Start(); + try + { + var response = await _fleetRestClient.ListCredentialsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists the user credentials of a Fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/listCredentials + /// + /// + /// Operation Id + /// Fleets_ListCredentials + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response GetCredentials(CancellationToken cancellationToken = default) + { + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.GetCredentials"); + scope.Start(); + try + { + var response = _fleetRestClient.ListCredentials(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _fleetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new FleetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new FleetPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _fleetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new FleetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new FleetPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _fleetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new FleetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new FleetPatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _fleetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new FleetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new FleetPatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _fleetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new FleetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new FleetPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _fleetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new FleetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new FleetPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetUpdateStrategyCollection.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetUpdateStrategyCollection.cs new file mode 100644 index 000000000000..bab80368f6f5 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetUpdateStrategyCollection.cs @@ -0,0 +1,497 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetFleetUpdateStrategies method from an instance of . + /// + public partial class FleetUpdateStrategyCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _fleetUpdateStrategyClientDiagnostics; + private readonly FleetUpdateStrategiesRestOperations _fleetUpdateStrategyRestClient; + + /// Initializes a new instance of the class for mocking. + protected FleetUpdateStrategyCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal FleetUpdateStrategyCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fleetUpdateStrategyClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerServiceFleet", FleetUpdateStrategyResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(FleetUpdateStrategyResource.ResourceType, out string fleetUpdateStrategyApiVersion); + _fleetUpdateStrategyRestClient = new FleetUpdateStrategiesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetUpdateStrategyApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != FleetResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, FleetResource.ResourceType), nameof(id)); + } + + /// + /// Create a FleetUpdateStrategy + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} + /// + /// + /// Operation Id + /// FleetUpdateStrategy_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the UpdateStrategy resource. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string updateStrategyName, FleetUpdateStrategyData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(updateStrategyName, nameof(updateStrategyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetUpdateStrategyClientDiagnostics.CreateScope("FleetUpdateStrategyCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _fleetUpdateStrategyRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateStrategyName, data, ifMatch, ifNoneMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceFleetArmOperation(new FleetUpdateStrategyOperationSource(Client), _fleetUpdateStrategyClientDiagnostics, Pipeline, _fleetUpdateStrategyRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateStrategyName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a FleetUpdateStrategy + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} + /// + /// + /// Operation Id + /// FleetUpdateStrategy_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the UpdateStrategy resource. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string updateStrategyName, FleetUpdateStrategyData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(updateStrategyName, nameof(updateStrategyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetUpdateStrategyClientDiagnostics.CreateScope("FleetUpdateStrategyCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _fleetUpdateStrategyRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateStrategyName, data, ifMatch, ifNoneMatch, cancellationToken); + var operation = new ContainerServiceFleetArmOperation(new FleetUpdateStrategyOperationSource(Client), _fleetUpdateStrategyClientDiagnostics, Pipeline, _fleetUpdateStrategyRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateStrategyName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a FleetUpdateStrategy + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} + /// + /// + /// Operation Id + /// FleetUpdateStrategy_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the UpdateStrategy resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string updateStrategyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(updateStrategyName, nameof(updateStrategyName)); + + using var scope = _fleetUpdateStrategyClientDiagnostics.CreateScope("FleetUpdateStrategyCollection.Get"); + scope.Start(); + try + { + var response = await _fleetUpdateStrategyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateStrategyName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetUpdateStrategyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a FleetUpdateStrategy + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} + /// + /// + /// Operation Id + /// FleetUpdateStrategy_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the UpdateStrategy resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string updateStrategyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(updateStrategyName, nameof(updateStrategyName)); + + using var scope = _fleetUpdateStrategyClientDiagnostics.CreateScope("FleetUpdateStrategyCollection.Get"); + scope.Start(); + try + { + var response = _fleetUpdateStrategyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateStrategyName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetUpdateStrategyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List FleetUpdateStrategy resources by Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies + /// + /// + /// Operation Id + /// FleetUpdateStrategy_ListByFleet + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fleetUpdateStrategyRestClient.CreateListByFleetRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fleetUpdateStrategyRestClient.CreateListByFleetNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FleetUpdateStrategyResource(Client, FleetUpdateStrategyData.DeserializeFleetUpdateStrategyData(e)), _fleetUpdateStrategyClientDiagnostics, Pipeline, "FleetUpdateStrategyCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List FleetUpdateStrategy resources by Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies + /// + /// + /// Operation Id + /// FleetUpdateStrategy_ListByFleet + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fleetUpdateStrategyRestClient.CreateListByFleetRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fleetUpdateStrategyRestClient.CreateListByFleetNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FleetUpdateStrategyResource(Client, FleetUpdateStrategyData.DeserializeFleetUpdateStrategyData(e)), _fleetUpdateStrategyClientDiagnostics, Pipeline, "FleetUpdateStrategyCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} + /// + /// + /// Operation Id + /// FleetUpdateStrategy_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the UpdateStrategy resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string updateStrategyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(updateStrategyName, nameof(updateStrategyName)); + + using var scope = _fleetUpdateStrategyClientDiagnostics.CreateScope("FleetUpdateStrategyCollection.Exists"); + scope.Start(); + try + { + var response = await _fleetUpdateStrategyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateStrategyName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} + /// + /// + /// Operation Id + /// FleetUpdateStrategy_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the UpdateStrategy resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string updateStrategyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(updateStrategyName, nameof(updateStrategyName)); + + using var scope = _fleetUpdateStrategyClientDiagnostics.CreateScope("FleetUpdateStrategyCollection.Exists"); + scope.Start(); + try + { + var response = _fleetUpdateStrategyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateStrategyName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} + /// + /// + /// Operation Id + /// FleetUpdateStrategy_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the UpdateStrategy resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string updateStrategyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(updateStrategyName, nameof(updateStrategyName)); + + using var scope = _fleetUpdateStrategyClientDiagnostics.CreateScope("FleetUpdateStrategyCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _fleetUpdateStrategyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateStrategyName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FleetUpdateStrategyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} + /// + /// + /// Operation Id + /// FleetUpdateStrategy_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the UpdateStrategy resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string updateStrategyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(updateStrategyName, nameof(updateStrategyName)); + + using var scope = _fleetUpdateStrategyClientDiagnostics.CreateScope("FleetUpdateStrategyCollection.GetIfExists"); + scope.Start(); + try + { + var response = _fleetUpdateStrategyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateStrategyName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FleetUpdateStrategyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetUpdateStrategyData.Serialization.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetUpdateStrategyData.Serialization.cs new file mode 100644 index 000000000000..f74509c505f6 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetUpdateStrategyData.Serialization.cs @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.ContainerServiceFleet.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + public partial class FleetUpdateStrategyData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetUpdateStrategyData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (options.Format != "W" && Optional.IsDefined(ETag)) + { + writer.WritePropertyName("eTag"u8); + writer.WriteStringValue(ETag); + } + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(Strategy)) + { + writer.WritePropertyName("strategy"u8); + writer.WriteObjectValue(Strategy, options); + } + writer.WriteEndObject(); + } + + FleetUpdateStrategyData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetUpdateStrategyData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetUpdateStrategyData(document.RootElement, options); + } + + internal static FleetUpdateStrategyData DeserializeFleetUpdateStrategyData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string etag = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + FleetUpdateStrategyProvisioningState? provisioningState = default; + UpdateRunStrategy strategy = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("eTag"u8)) + { + etag = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new FleetUpdateStrategyProvisioningState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("strategy"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + strategy = UpdateRunStrategy.DeserializeUpdateRunStrategy(property0.Value, options); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetUpdateStrategyData( + id, + name, + type, + systemData, + provisioningState, + strategy, + etag, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FleetUpdateStrategyData)} does not support writing '{options.Format}' format."); + } + } + + FleetUpdateStrategyData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFleetUpdateStrategyData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetUpdateStrategyData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetUpdateStrategyData.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetUpdateStrategyData.cs new file mode 100644 index 000000000000..23fb77e355d6 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetUpdateStrategyData.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.ContainerServiceFleet.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + /// + /// A class representing the FleetUpdateStrategy data model. + /// Defines a multi-stage process to perform update operations across members of a Fleet. + /// + public partial class FleetUpdateStrategyData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public FleetUpdateStrategyData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The provisioning state of the UpdateStrategy resource. + /// Defines the update sequence of the clusters. + /// 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. + /// Keeps track of any properties unknown to the library. + internal FleetUpdateStrategyData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, FleetUpdateStrategyProvisioningState? provisioningState, UpdateRunStrategy strategy, string etag, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + ProvisioningState = provisioningState; + Strategy = strategy; + ETag = etag; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The provisioning state of the UpdateStrategy resource. + public FleetUpdateStrategyProvisioningState? ProvisioningState { get; } + /// Defines the update sequence of the clusters. + internal UpdateRunStrategy Strategy { get; set; } + /// The list of stages that compose this update run. Min size: 1. + public IList StrategyStages + { + get => Strategy is null ? default : Strategy.Stages; + set => Strategy = new UpdateRunStrategy(value); + } + + /// 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. + public string ETag { get; } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetUpdateStrategyResource.Serialization.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetUpdateStrategyResource.Serialization.cs new file mode 100644 index 000000000000..dd3ee2aedbc1 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetUpdateStrategyResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + public partial class FleetUpdateStrategyResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + FleetUpdateStrategyData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + FleetUpdateStrategyData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetUpdateStrategyResource.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetUpdateStrategyResource.cs new file mode 100644 index 000000000000..0f0851cb6e71 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetUpdateStrategyResource.cs @@ -0,0 +1,353 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + /// + /// A Class representing a FleetUpdateStrategy along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetFleetUpdateStrategyResource method. + /// Otherwise you can get one from its parent resource using the GetFleetUpdateStrategy method. + /// + public partial class FleetUpdateStrategyResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The fleetName. + /// The updateStrategyName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string updateStrategyName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _fleetUpdateStrategyClientDiagnostics; + private readonly FleetUpdateStrategiesRestOperations _fleetUpdateStrategyRestClient; + private readonly FleetUpdateStrategyData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.ContainerService/fleets/updateStrategies"; + + /// Initializes a new instance of the class for mocking. + protected FleetUpdateStrategyResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal FleetUpdateStrategyResource(ArmClient client, FleetUpdateStrategyData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal FleetUpdateStrategyResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fleetUpdateStrategyClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerServiceFleet", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string fleetUpdateStrategyApiVersion); + _fleetUpdateStrategyRestClient = new FleetUpdateStrategiesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetUpdateStrategyApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual FleetUpdateStrategyData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a FleetUpdateStrategy + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} + /// + /// + /// Operation Id + /// FleetUpdateStrategy_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _fleetUpdateStrategyClientDiagnostics.CreateScope("FleetUpdateStrategyResource.Get"); + scope.Start(); + try + { + var response = await _fleetUpdateStrategyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetUpdateStrategyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a FleetUpdateStrategy + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} + /// + /// + /// Operation Id + /// FleetUpdateStrategy_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _fleetUpdateStrategyClientDiagnostics.CreateScope("FleetUpdateStrategyResource.Get"); + scope.Start(); + try + { + var response = _fleetUpdateStrategyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetUpdateStrategyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a FleetUpdateStrategy + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} + /// + /// + /// Operation Id + /// FleetUpdateStrategy_Delete + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, string ifMatch = null, CancellationToken cancellationToken = default) + { + using var scope = _fleetUpdateStrategyClientDiagnostics.CreateScope("FleetUpdateStrategyResource.Delete"); + scope.Start(); + try + { + var response = await _fleetUpdateStrategyRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceFleetArmOperation(_fleetUpdateStrategyClientDiagnostics, Pipeline, _fleetUpdateStrategyRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a FleetUpdateStrategy + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} + /// + /// + /// Operation Id + /// FleetUpdateStrategy_Delete + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, string ifMatch = null, CancellationToken cancellationToken = default) + { + using var scope = _fleetUpdateStrategyClientDiagnostics.CreateScope("FleetUpdateStrategyResource.Delete"); + scope.Start(); + try + { + var response = _fleetUpdateStrategyRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch, cancellationToken); + var operation = new ContainerServiceFleetArmOperation(_fleetUpdateStrategyClientDiagnostics, Pipeline, _fleetUpdateStrategyRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a FleetUpdateStrategy + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} + /// + /// + /// Operation Id + /// FleetUpdateStrategy_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, FleetUpdateStrategyData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetUpdateStrategyClientDiagnostics.CreateScope("FleetUpdateStrategyResource.Update"); + scope.Start(); + try + { + var response = await _fleetUpdateStrategyRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceFleetArmOperation(new FleetUpdateStrategyOperationSource(Client), _fleetUpdateStrategyClientDiagnostics, Pipeline, _fleetUpdateStrategyRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a FleetUpdateStrategy + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} + /// + /// + /// Operation Id + /// FleetUpdateStrategy_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, FleetUpdateStrategyData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetUpdateStrategyClientDiagnostics.CreateScope("FleetUpdateStrategyResource.Update"); + scope.Start(); + try + { + var response = _fleetUpdateStrategyRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch, cancellationToken); + var operation = new ContainerServiceFleetArmOperation(new FleetUpdateStrategyOperationSource(Client), _fleetUpdateStrategyClientDiagnostics, Pipeline, _fleetUpdateStrategyRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Internal/Argument.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..b299f1969217 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Internal/Argument.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + internal static class Argument + { + public static void AssertNotNull(T value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNull(T? value, string name) + where T : struct + { + if (!value.HasValue) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNullOrEmpty(IEnumerable value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value is ICollection collectionOfT && collectionOfT.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + if (value is ICollection collection && collection.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + using IEnumerator e = value.GetEnumerator(); + if (!e.MoveNext()) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + } + + public static void AssertNotNullOrEmpty(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value.Length == 0) + { + throw new ArgumentException("Value cannot be an empty string.", name); + } + } + + public static void AssertNotNullOrWhiteSpace(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (string.IsNullOrWhiteSpace(value)) + { + throw new ArgumentException("Value cannot be empty or contain only white-space characters.", name); + } + } + + public static void AssertNotDefault(ref T value, string name) + where T : struct, IEquatable + { + if (value.Equals(default)) + { + throw new ArgumentException("Value cannot be empty.", name); + } + } + + public static void AssertInRange(T value, T minimum, T maximum, string name) + where T : notnull, IComparable + { + if (minimum.CompareTo(value) > 0) + { + throw new ArgumentOutOfRangeException(name, "Value is less than the minimum allowed."); + } + if (maximum.CompareTo(value) < 0) + { + throw new ArgumentOutOfRangeException(name, "Value is greater than the maximum allowed."); + } + } + + public static void AssertEnumDefined(Type enumType, object value, string name) + { + if (!Enum.IsDefined(enumType, value)) + { + throw new ArgumentException($"Value not defined for {enumType.FullName}.", name); + } + } + + public static T CheckNotNull(T value, string name) + where T : class + { + AssertNotNull(value, name); + return value; + } + + public static string CheckNotNullOrEmpty(string value, string name) + { + AssertNotNullOrEmpty(value, name); + return value; + } + + public static void AssertNull(T value, string name, string message = null) + { + if (value != null) + { + throw new ArgumentException(message ?? "Value must be null.", name); + } + } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..c12535274828 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Internal/ChangeTrackingDictionary.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + internal class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary where TKey : notnull + { + private IDictionary _innerDictionary; + + public ChangeTrackingDictionary() + { + } + + public ChangeTrackingDictionary(IDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(dictionary); + } + + public ChangeTrackingDictionary(IReadOnlyDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(); + foreach (var pair in dictionary) + { + _innerDictionary.Add(pair); + } + } + + public bool IsUndefined => _innerDictionary == null; + + public int Count => IsUndefined ? 0 : EnsureDictionary().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureDictionary().IsReadOnly; + + public ICollection Keys => IsUndefined ? Array.Empty() : EnsureDictionary().Keys; + + public ICollection Values => IsUndefined ? Array.Empty() : EnsureDictionary().Values; + + public TValue this[TKey key] + { + get + { + if (IsUndefined) + { + throw new KeyNotFoundException(nameof(key)); + } + return EnsureDictionary()[key]; + } + set + { + EnsureDictionary()[key] = value; + } + } + + IEnumerable IReadOnlyDictionary.Keys => Keys; + + IEnumerable IReadOnlyDictionary.Values => Values; + + public IEnumerator> GetEnumerator() + { + if (IsUndefined) + { + IEnumerator> enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureDictionary().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(KeyValuePair item) + { + EnsureDictionary().Add(item); + } + + public void Clear() + { + EnsureDictionary().Clear(); + } + + public bool Contains(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Contains(item); + } + + public void CopyTo(KeyValuePair[] array, int index) + { + if (IsUndefined) + { + return; + } + EnsureDictionary().CopyTo(array, index); + } + + public bool Remove(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(item); + } + + public void Add(TKey key, TValue value) + { + EnsureDictionary().Add(key, value); + } + + public bool ContainsKey(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().ContainsKey(key); + } + + public bool Remove(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(key); + } + + public bool TryGetValue(TKey key, out TValue value) + { + if (IsUndefined) + { + value = default; + return false; + } + return EnsureDictionary().TryGetValue(key, out value); + } + + public IDictionary EnsureDictionary() + { + return _innerDictionary ??= new Dictionary(); + } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Internal/ChangeTrackingList.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..976d484f303e --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Internal/ChangeTrackingList.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + internal class ChangeTrackingList : IList, IReadOnlyList + { + private IList _innerList; + + public ChangeTrackingList() + { + } + + public ChangeTrackingList(IList innerList) + { + if (innerList != null) + { + _innerList = innerList; + } + } + + public ChangeTrackingList(IReadOnlyList innerList) + { + if (innerList != null) + { + _innerList = innerList.ToList(); + } + } + + public bool IsUndefined => _innerList == null; + + public int Count => IsUndefined ? 0 : EnsureList().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureList().IsReadOnly; + + public T this[int index] + { + get + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + return EnsureList()[index]; + } + set + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList()[index] = value; + } + } + + public void Reset() + { + _innerList = null; + } + + public IEnumerator GetEnumerator() + { + if (IsUndefined) + { + IEnumerator enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureList().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(T item) + { + EnsureList().Add(item); + } + + public void Clear() + { + EnsureList().Clear(); + } + + public bool Contains(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Contains(item); + } + + public void CopyTo(T[] array, int arrayIndex) + { + if (IsUndefined) + { + return; + } + EnsureList().CopyTo(array, arrayIndex); + } + + public bool Remove(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Remove(item); + } + + public int IndexOf(T item) + { + if (IsUndefined) + { + return -1; + } + return EnsureList().IndexOf(item); + } + + public void Insert(int index, T item) + { + EnsureList().Insert(index, item); + } + + public void RemoveAt(int index) + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList().RemoveAt(index); + } + + public IList EnsureList() + { + return _innerList ??= new List(); + } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..67e251136fa0 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Internal/ModelSerializationExtensions.cs @@ -0,0 +1,399 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.Text.Json; +using System.Xml; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + internal static class ModelSerializationExtensions + { + internal static readonly JsonDocumentOptions JsonDocumentOptions = new JsonDocumentOptions { MaxDepth = 256 }; + internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); + + public static object GetObject(this JsonElement element) + { + switch (element.ValueKind) + { + case JsonValueKind.String: + return element.GetString(); + case JsonValueKind.Number: + if (element.TryGetInt32(out int intValue)) + { + return intValue; + } + if (element.TryGetInt64(out long longValue)) + { + return longValue; + } + return element.GetDouble(); + case JsonValueKind.True: + return true; + case JsonValueKind.False: + return false; + case JsonValueKind.Undefined: + case JsonValueKind.Null: + return null; + case JsonValueKind.Object: + var dictionary = new Dictionary(); + foreach (var jsonProperty in element.EnumerateObject()) + { + dictionary.Add(jsonProperty.Name, jsonProperty.Value.GetObject()); + } + return dictionary; + case JsonValueKind.Array: + var list = new List(); + foreach (var item in element.EnumerateArray()) + { + list.Add(item.GetObject()); + } + return list.ToArray(); + default: + throw new NotSupportedException($"Not supported value kind {element.ValueKind}"); + } + } + + public static byte[] GetBytesFromBase64(this JsonElement element, string format) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + + return format switch + { + "U" => TypeFormatters.FromBase64UrlString(element.GetRequiredString()), + "D" => element.GetBytesFromBase64(), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + } + + public static DateTimeOffset GetDateTimeOffset(this JsonElement element, string format) => format switch + { + "U" when element.ValueKind == JsonValueKind.Number => DateTimeOffset.FromUnixTimeSeconds(element.GetInt64()), + _ => TypeFormatters.ParseDateTimeOffset(element.GetString(), format) + }; + + public static TimeSpan GetTimeSpan(this JsonElement element, string format) => TypeFormatters.ParseTimeSpan(element.GetString(), format); + + public static char GetChar(this JsonElement element) + { + if (element.ValueKind == JsonValueKind.String) + { + var text = element.GetString(); + if (text == null || text.Length != 1) + { + throw new NotSupportedException($"Cannot convert \"{text}\" to a char"); + } + return text[0]; + } + else + { + throw new NotSupportedException($"Cannot convert {element.ValueKind} to a char"); + } + } + + [Conditional("DEBUG")] + public static void ThrowNonNullablePropertyIsNull(this JsonProperty property) + { + throw new JsonException($"A property '{property.Name}' defined as non-nullable but received as null from the service. This exception only happens in DEBUG builds of the library and would be ignored in the release build"); + } + + public static string GetRequiredString(this JsonElement element) + { + var value = element.GetString(); + if (value == null) + { + throw new InvalidOperationException($"The requested operation requires an element of type 'String', but the target element has type '{element.ValueKind}'."); + } + return value; + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTime value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, TimeSpan value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, char value) + { + writer.WriteStringValue(value.ToString(CultureInfo.InvariantCulture)); + } + + public static void WriteBase64StringValue(this Utf8JsonWriter writer, byte[] value, string format) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + switch (format) + { + case "U": + writer.WriteStringValue(TypeFormatters.ToBase64UrlString(value)); + break; + case "D": + writer.WriteBase64StringValue(value); + break; + default: + throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)); + } + } + + public static void WriteNumberValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + if (format != "U") + { + throw new ArgumentOutOfRangeException(nameof(format), "Only 'U' format is supported when writing a DateTimeOffset as a Number."); + } + writer.WriteNumberValue(value.ToUnixTimeSeconds()); + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, T value, ModelReaderWriterOptions options = null) + { + switch (value) + { + case null: + writer.WriteNullValue(); + break; + case IJsonModel jsonModel: + jsonModel.Write(writer, options ?? WireOptions); + break; + case IUtf8JsonSerializable serializable: + serializable.Write(writer); + break; + case byte[] bytes: + writer.WriteBase64StringValue(bytes); + break; + case BinaryData bytes0: + writer.WriteBase64StringValue(bytes0); + break; + case JsonElement json: + json.WriteTo(writer); + break; + case int i: + writer.WriteNumberValue(i); + break; + case decimal d: + writer.WriteNumberValue(d); + break; + case double d0: + if (double.IsNaN(d0)) + { + writer.WriteStringValue("NaN"); + } + else + { + writer.WriteNumberValue(d0); + } + break; + case float f: + writer.WriteNumberValue(f); + break; + case long l: + writer.WriteNumberValue(l); + break; + case string s: + writer.WriteStringValue(s); + break; + case bool b: + writer.WriteBooleanValue(b); + break; + case Guid g: + writer.WriteStringValue(g); + break; + case DateTimeOffset dateTimeOffset: + writer.WriteStringValue(dateTimeOffset, "O"); + break; + case DateTime dateTime: + writer.WriteStringValue(dateTime, "O"); + break; + case IEnumerable> enumerable: + writer.WriteStartObject(); + foreach (var pair in enumerable) + { + writer.WritePropertyName(pair.Key); + writer.WriteObjectValue(pair.Value, options); + } + writer.WriteEndObject(); + break; + case IEnumerable objectEnumerable: + writer.WriteStartArray(); + foreach (var item in objectEnumerable) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + break; + case TimeSpan timeSpan: + writer.WriteStringValue(timeSpan, "P"); + break; + default: + throw new NotSupportedException($"Not supported type {value.GetType()}"); + } + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, object value, ModelReaderWriterOptions options = null) + { + writer.WriteObjectValue(value, options); + } + + internal static class TypeFormatters + { + private const string RoundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; + public const string DefaultNumberFormat = "G"; + + public static string ToString(bool value) => value ? "true" : "false"; + + public static string ToString(DateTime value, string format) => value.Kind switch + { + DateTimeKind.Utc => ToString((DateTimeOffset)value, format), + _ => throw new NotSupportedException($"DateTime {value} has a Kind of {value.Kind}. Azure SDK requires it to be UTC. You can call DateTime.SpecifyKind to change Kind property value to DateTimeKind.Utc.") + }; + + public static string ToString(DateTimeOffset value, string format) => format switch + { + "D" => value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), + "U" => value.ToUnixTimeSeconds().ToString(CultureInfo.InvariantCulture), + "O" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "o" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "R" => value.ToString("r", CultureInfo.InvariantCulture), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(TimeSpan value, string format) => format switch + { + "P" => XmlConvert.ToString(value), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(byte[] value, string format) => format switch + { + "U" => ToBase64UrlString(value), + "D" => Convert.ToBase64String(value), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + + public static string ToBase64UrlString(byte[] value) + { + int numWholeOrPartialInputBlocks = checked(value.Length + 2) / 3; + int size = checked(numWholeOrPartialInputBlocks * 4); + char[] output = new char[size]; + + int numBase64Chars = Convert.ToBase64CharArray(value, 0, value.Length, output, 0); + + int i = 0; + for (; i < numBase64Chars; i++) + { + char ch = output[i]; + if (ch == '+') + { + output[i] = '-'; + } + else + { + if (ch == '/') + { + output[i] = '_'; + } + else + { + if (ch == '=') + { + break; + } + } + } + } + + return new string(output, 0, i); + } + + public static byte[] FromBase64UrlString(string value) + { + int paddingCharsToAdd = (value.Length % 4) switch + { + 0 => 0, + 2 => 2, + 3 => 1, + _ => throw new InvalidOperationException("Malformed input") + }; + char[] output = new char[(value.Length + paddingCharsToAdd)]; + int i = 0; + for (; i < value.Length; i++) + { + char ch = value[i]; + if (ch == '-') + { + output[i] = '+'; + } + else + { + if (ch == '_') + { + output[i] = '/'; + } + else + { + output[i] = ch; + } + } + } + + for (; i < output.Length; i++) + { + output[i] = '='; + } + + return Convert.FromBase64CharArray(output, 0, output.Length); + } + + public static DateTimeOffset ParseDateTimeOffset(string value, string format) => format switch + { + "U" => DateTimeOffset.FromUnixTimeSeconds(long.Parse(value, CultureInfo.InvariantCulture)), + _ => DateTimeOffset.Parse(value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal) + }; + + public static TimeSpan ParseTimeSpan(string value, string format) => format switch + { + "P" => XmlConvert.ToTimeSpan(value), + _ => TimeSpan.ParseExact(value, format, CultureInfo.InvariantCulture) + }; + + public static string ConvertToString(object value, string format = null) => value switch + { + null => "null", + string s => s, + bool b => ToString(b), + int or float or double or long or decimal => ((IFormattable)value).ToString(DefaultNumberFormat, CultureInfo.InvariantCulture), + byte[] b0 when format != null => ToString(b0, format), + IEnumerable s0 => string.Join(",", s0), + DateTimeOffset dateTime when format != null => ToString(dateTime, format), + TimeSpan timeSpan when format != null => ToString(timeSpan, format), + TimeSpan timeSpan0 => XmlConvert.ToString(timeSpan0), + Guid guid => guid.ToString(), + BinaryData binaryData => ConvertToString(binaryData.ToArray(), format), + _ => value.ToString() + }; + } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Internal/Optional.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..c6297b0c82de --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Internal/Optional.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + internal static class Optional + { + public static bool IsCollectionDefined(IEnumerable collection) + { + return !(collection is ChangeTrackingList changeTrackingList && changeTrackingList.IsUndefined); + } + + public static bool IsCollectionDefined(IDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsCollectionDefined(IReadOnlyDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsDefined(T? value) + where T : struct + { + return value.HasValue; + } + + public static bool IsDefined(object value) + { + return value != null; + } + + public static bool IsDefined(JsonElement value) + { + return value.ValueKind != JsonValueKind.Undefined; + } + + public static bool IsDefined(string value) + { + return value != null; + } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 000000000000..eb61c5098090 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Internal/Utf8JsonRequestContent.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.IO; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + internal class Utf8JsonRequestContent : RequestContent + { + private readonly MemoryStream _stream; + private readonly RequestContent _content; + + public Utf8JsonRequestContent() + { + _stream = new MemoryStream(); + _content = Create(_stream); + JsonWriter = new Utf8JsonWriter(_stream); + } + + public Utf8JsonWriter JsonWriter { get; } + + public override async Task WriteToAsync(Stream stream, CancellationToken cancellationToken = default) + { + await JsonWriter.FlushAsync().ConfigureAwait(false); + await _content.WriteToAsync(stream, cancellationToken).ConfigureAwait(false); + } + + public override void WriteTo(Stream stream, CancellationToken cancellationToken = default) + { + JsonWriter.Flush(); + _content.WriteTo(stream, cancellationToken); + } + + public override bool TryComputeLength(out long length) + { + length = JsonWriter.BytesCommitted + JsonWriter.BytesPending; + return true; + } + + public override void Dispose() + { + JsonWriter.Dispose(); + _content.Dispose(); + _stream.Dispose(); + } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/LongRunningOperation/AutoUpgradeProfileOperationSource.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/LongRunningOperation/AutoUpgradeProfileOperationSource.cs new file mode 100644 index 000000000000..a2822b3ae762 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/LongRunningOperation/AutoUpgradeProfileOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + internal class AutoUpgradeProfileOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal AutoUpgradeProfileOperationSource(ArmClient client) + { + _client = client; + } + + AutoUpgradeProfileResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new AutoUpgradeProfileResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new AutoUpgradeProfileResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/LongRunningOperation/ContainerServiceFleetArmOperation.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/LongRunningOperation/ContainerServiceFleetArmOperation.cs new file mode 100644 index 000000000000..1e29551e2623 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/LongRunningOperation/ContainerServiceFleetArmOperation.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ +#pragma warning disable SA1649 // File name should match first type name + internal class ContainerServiceFleetArmOperation : ArmOperation +#pragma warning restore SA1649 // File name should match first type name + { + private readonly OperationInternal _operation; + private readonly RehydrationToken? _completeRehydrationToken; + private readonly NextLinkOperationImplementation _nextLinkOperation; + private readonly string _operationId; + + /// Initializes a new instance of ContainerServiceFleetArmOperation for mocking. + protected ContainerServiceFleetArmOperation() + { + } + + internal ContainerServiceFleetArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal ContainerServiceFleetArmOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) + { + var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) + { + _nextLinkOperation = nextLinkOperationValue; + _operationId = _nextLinkOperation.OperationId; + } + else + { + _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); + _operationId = GetOperationId(_completeRehydrationToken); + } + _operation = new OperationInternal(nextLinkOperation, clientDiagnostics, response, "ContainerServiceFleetArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json).ToObjectFromJson>(); + return lroDetails["id"]; + } + /// + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override Response GetRawResponse() => _operation.RawResponse; + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override Response WaitForCompletionResponse(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(cancellationToken); + + /// + public override Response WaitForCompletionResponse(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(pollingInterval, cancellationToken); + + /// + public override ValueTask WaitForCompletionResponseAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(cancellationToken); + + /// + public override ValueTask WaitForCompletionResponseAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(pollingInterval, cancellationToken); + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/LongRunningOperation/ContainerServiceFleetArmOperationOfT.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/LongRunningOperation/ContainerServiceFleetArmOperationOfT.cs new file mode 100644 index 000000000000..442bbec8bb30 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/LongRunningOperation/ContainerServiceFleetArmOperationOfT.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ +#pragma warning disable SA1649 // File name should match first type name + internal class ContainerServiceFleetArmOperation : ArmOperation +#pragma warning restore SA1649 // File name should match first type name + { + private readonly OperationInternal _operation; + private readonly RehydrationToken? _completeRehydrationToken; + private readonly NextLinkOperationImplementation _nextLinkOperation; + private readonly string _operationId; + + /// Initializes a new instance of ContainerServiceFleetArmOperation for mocking. + protected ContainerServiceFleetArmOperation() + { + } + + internal ContainerServiceFleetArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response.GetRawResponse(), response.Value); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal ContainerServiceFleetArmOperation(IOperationSource source, ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) + { + var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) + { + _nextLinkOperation = nextLinkOperationValue; + _operationId = _nextLinkOperation.OperationId; + } + else + { + _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); + _operationId = GetOperationId(_completeRehydrationToken); + } + _operation = new OperationInternal(NextLinkOperationImplementation.Create(source, nextLinkOperation), clientDiagnostics, response, "ContainerServiceFleetArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json).ToObjectFromJson>(); + return lroDetails["id"]; + } + /// + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// + public override T Value => _operation.Value; + + /// + public override bool HasValue => _operation.HasValue; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override Response GetRawResponse() => _operation.RawResponse; + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override Response WaitForCompletion(CancellationToken cancellationToken = default) => _operation.WaitForCompletion(cancellationToken); + + /// + public override Response WaitForCompletion(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletion(pollingInterval, cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken); + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/LongRunningOperation/FleetMemberOperationSource.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/LongRunningOperation/FleetMemberOperationSource.cs new file mode 100644 index 000000000000..78fb5d7a9a59 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/LongRunningOperation/FleetMemberOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + internal class FleetMemberOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal FleetMemberOperationSource(ArmClient client) + { + _client = client; + } + + FleetMemberResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new FleetMemberResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new FleetMemberResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/LongRunningOperation/FleetOperationSource.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/LongRunningOperation/FleetOperationSource.cs new file mode 100644 index 000000000000..0173a73ae265 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/LongRunningOperation/FleetOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + internal class FleetOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal FleetOperationSource(ArmClient client) + { + _client = client; + } + + FleetResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new FleetResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new FleetResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/LongRunningOperation/FleetUpdateStrategyOperationSource.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/LongRunningOperation/FleetUpdateStrategyOperationSource.cs new file mode 100644 index 000000000000..9118571f04ec --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/LongRunningOperation/FleetUpdateStrategyOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + internal class FleetUpdateStrategyOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal FleetUpdateStrategyOperationSource(ArmClient client) + { + _client = client; + } + + FleetUpdateStrategyResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new FleetUpdateStrategyResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new FleetUpdateStrategyResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/LongRunningOperation/UpdateRunOperationSource.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/LongRunningOperation/UpdateRunOperationSource.cs new file mode 100644 index 000000000000..5d1e139719dc --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/LongRunningOperation/UpdateRunOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + internal class UpdateRunOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal UpdateRunOperationSource(ArmClient client) + { + _client = client; + } + + UpdateRunResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new UpdateRunResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new UpdateRunResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/APIServerAccessProfile.Serialization.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/APIServerAccessProfile.Serialization.cs new file mode 100644 index 000000000000..b54b7c574868 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/APIServerAccessProfile.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + public partial class APIServerAccessProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(APIServerAccessProfile)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(EnablePrivateCluster)) + { + writer.WritePropertyName("enablePrivateCluster"u8); + writer.WriteBooleanValue(EnablePrivateCluster.Value); + } + if (Optional.IsDefined(EnableVnetIntegration)) + { + writer.WritePropertyName("enableVnetIntegration"u8); + writer.WriteBooleanValue(EnableVnetIntegration.Value); + } + if (Optional.IsDefined(SubnetId)) + { + writer.WritePropertyName("subnetId"u8); + writer.WriteStringValue(SubnetId); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + APIServerAccessProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(APIServerAccessProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAPIServerAccessProfile(document.RootElement, options); + } + + internal static APIServerAccessProfile DeserializeAPIServerAccessProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? enablePrivateCluster = default; + bool? enableVnetIntegration = default; + ResourceIdentifier subnetId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enablePrivateCluster"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enablePrivateCluster = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("enableVnetIntegration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableVnetIntegration = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("subnetId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + subnetId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new APIServerAccessProfile(enablePrivateCluster, enableVnetIntegration, subnetId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(APIServerAccessProfile)} does not support writing '{options.Format}' format."); + } + } + + APIServerAccessProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAPIServerAccessProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(APIServerAccessProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/APIServerAccessProfile.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/APIServerAccessProfile.cs new file mode 100644 index 000000000000..3e1ebb18bd49 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/APIServerAccessProfile.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// Access profile for the Fleet hub API server. + public partial class APIServerAccessProfile + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public APIServerAccessProfile() + { + } + + /// Initializes a new instance of . + /// Whether to create the Fleet hub as a private cluster or not. + /// Whether to enable apiserver vnet integration for the Fleet hub or not. + /// The subnet to be used when apiserver vnet integration is enabled. It is required when creating a new Fleet with BYO vnet. + /// Keeps track of any properties unknown to the library. + internal APIServerAccessProfile(bool? enablePrivateCluster, bool? enableVnetIntegration, ResourceIdentifier subnetId, IDictionary serializedAdditionalRawData) + { + EnablePrivateCluster = enablePrivateCluster; + EnableVnetIntegration = enableVnetIntegration; + SubnetId = subnetId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Whether to create the Fleet hub as a private cluster or not. + public bool? EnablePrivateCluster { get; set; } + /// Whether to enable apiserver vnet integration for the Fleet hub or not. + public bool? EnableVnetIntegration { get; set; } + /// The subnet to be used when apiserver vnet integration is enabled. It is required when creating a new Fleet with BYO vnet. + public ResourceIdentifier SubnetId { get; set; } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AgentProfile.Serialization.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AgentProfile.Serialization.cs new file mode 100644 index 000000000000..c970ab00c542 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AgentProfile.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + public partial class AgentProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AgentProfile)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(SubnetId)) + { + writer.WritePropertyName("subnetId"u8); + writer.WriteStringValue(SubnetId); + } + if (Optional.IsDefined(VmSize)) + { + writer.WritePropertyName("vmSize"u8); + writer.WriteStringValue(VmSize); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AgentProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AgentProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAgentProfile(document.RootElement, options); + } + + internal static AgentProfile DeserializeAgentProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier subnetId = default; + string vmSize = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("subnetId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + subnetId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("vmSize"u8)) + { + vmSize = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AgentProfile(subnetId, vmSize, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AgentProfile)} does not support writing '{options.Format}' format."); + } + } + + AgentProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAgentProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AgentProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AgentProfile.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AgentProfile.cs new file mode 100644 index 000000000000..ef8901e6fe6e --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AgentProfile.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// Agent profile for the Fleet hub. + public partial class AgentProfile + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public AgentProfile() + { + } + + /// Initializes a new instance of . + /// The ID of the subnet which the Fleet hub node will join on startup. If this is not specified, a vnet and subnet will be generated and used. + /// The virtual machine size of the Fleet hub. + /// Keeps track of any properties unknown to the library. + internal AgentProfile(ResourceIdentifier subnetId, string vmSize, IDictionary serializedAdditionalRawData) + { + SubnetId = subnetId; + VmSize = vmSize; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The ID of the subnet which the Fleet hub node will join on startup. If this is not specified, a vnet and subnet will be generated and used. + public ResourceIdentifier SubnetId { get; set; } + /// The virtual machine size of the Fleet hub. + public string VmSize { get; set; } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeLastTriggerStatus.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeLastTriggerStatus.cs new file mode 100644 index 000000000000..1256f8cc3ed7 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeLastTriggerStatus.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// AutoUpgradeLastTriggerStatus is the status of the last AutoUpgrade trigger (attempt to automatically create and start UpdateRun when there are new released versions) of an auto upgrade profile. + public readonly partial struct AutoUpgradeLastTriggerStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AutoUpgradeLastTriggerStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + + /// The last AutoUpgrade trigger was succeeded. + public static AutoUpgradeLastTriggerStatus Succeeded { get; } = new AutoUpgradeLastTriggerStatus(SucceededValue); + /// The last AutoUpgrade trigger failed. + public static AutoUpgradeLastTriggerStatus Failed { get; } = new AutoUpgradeLastTriggerStatus(FailedValue); + /// Determines if two values are the same. + public static bool operator ==(AutoUpgradeLastTriggerStatus left, AutoUpgradeLastTriggerStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AutoUpgradeLastTriggerStatus left, AutoUpgradeLastTriggerStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AutoUpgradeLastTriggerStatus(string value) => new AutoUpgradeLastTriggerStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AutoUpgradeLastTriggerStatus other && Equals(other); + /// + public bool Equals(AutoUpgradeLastTriggerStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeNodeImageSelection.Serialization.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeNodeImageSelection.Serialization.cs new file mode 100644 index 000000000000..5ea99b334c30 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeNodeImageSelection.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + internal partial class AutoUpgradeNodeImageSelection : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AutoUpgradeNodeImageSelection)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AutoUpgradeNodeImageSelection IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AutoUpgradeNodeImageSelection)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAutoUpgradeNodeImageSelection(document.RootElement, options); + } + + internal static AutoUpgradeNodeImageSelection DeserializeAutoUpgradeNodeImageSelection(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AutoUpgradeNodeImageSelectionType type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = new AutoUpgradeNodeImageSelectionType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AutoUpgradeNodeImageSelection(type, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AutoUpgradeNodeImageSelection)} does not support writing '{options.Format}' format."); + } + } + + AutoUpgradeNodeImageSelection IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAutoUpgradeNodeImageSelection(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AutoUpgradeNodeImageSelection)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeNodeImageSelection.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeNodeImageSelection.cs new file mode 100644 index 000000000000..3a0d56f8bac9 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeNodeImageSelection.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// The node image upgrade to be applied to the target clusters in auto upgrade. + internal partial class AutoUpgradeNodeImageSelection + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The node image upgrade type. + public AutoUpgradeNodeImageSelection(AutoUpgradeNodeImageSelectionType type) + { + Type = type; + } + + /// Initializes a new instance of . + /// The node image upgrade type. + /// Keeps track of any properties unknown to the library. + internal AutoUpgradeNodeImageSelection(AutoUpgradeNodeImageSelectionType type, IDictionary serializedAdditionalRawData) + { + Type = type; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AutoUpgradeNodeImageSelection() + { + } + + /// The node image upgrade type. + public AutoUpgradeNodeImageSelectionType Type { get; set; } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeNodeImageSelectionType.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeNodeImageSelectionType.cs new file mode 100644 index 000000000000..8e0faa9dbe54 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeNodeImageSelectionType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// The node image upgrade type. + public readonly partial struct AutoUpgradeNodeImageSelectionType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AutoUpgradeNodeImageSelectionType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string LatestValue = "Latest"; + private const string ConsistentValue = "Consistent"; + + /// Use the latest image version when upgrading nodes. Clusters may use different image versions (e.g., 'AKSUbuntu-1804gen2containerd-2021.10.12' and 'AKSUbuntu-1804gen2containerd-2021.10.19') because, for example, the latest available version is different in different regions. + public static AutoUpgradeNodeImageSelectionType Latest { get; } = new AutoUpgradeNodeImageSelectionType(LatestValue); + /// The image versions to upgrade nodes to are selected as described below: for each node pool in managed clusters affected by the update run, the system selects the latest image version such that it is available across all other node pools (in all other clusters) of the same image type. As a result, all node pools of the same image type will be upgraded to the same image version. For example, if the latest image version for image type 'AKSUbuntu-1804gen2containerd' is 'AKSUbuntu-1804gen2containerd-2021.10.12' for a node pool in cluster A in region X, and is 'AKSUbuntu-1804gen2containerd-2021.10.17' for a node pool in cluster B in region Y, the system will upgrade both node pools to image version 'AKSUbuntu-1804gen2containerd-2021.10.12'. + public static AutoUpgradeNodeImageSelectionType Consistent { get; } = new AutoUpgradeNodeImageSelectionType(ConsistentValue); + /// Determines if two values are the same. + public static bool operator ==(AutoUpgradeNodeImageSelectionType left, AutoUpgradeNodeImageSelectionType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AutoUpgradeNodeImageSelectionType left, AutoUpgradeNodeImageSelectionType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AutoUpgradeNodeImageSelectionType(string value) => new AutoUpgradeNodeImageSelectionType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AutoUpgradeNodeImageSelectionType other && Equals(other); + /// + public bool Equals(AutoUpgradeNodeImageSelectionType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeProfileListResult.Serialization.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeProfileListResult.Serialization.cs new file mode 100644 index 000000000000..5f8289644cce --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeProfileListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + internal partial class AutoUpgradeProfileListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AutoUpgradeProfileListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AutoUpgradeProfileListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AutoUpgradeProfileListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAutoUpgradeProfileListResult(document.RootElement, options); + } + + internal static AutoUpgradeProfileListResult DeserializeAutoUpgradeProfileListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AutoUpgradeProfileData.DeserializeAutoUpgradeProfileData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AutoUpgradeProfileListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AutoUpgradeProfileListResult)} does not support writing '{options.Format}' format."); + } + } + + AutoUpgradeProfileListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAutoUpgradeProfileListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AutoUpgradeProfileListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeProfileListResult.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeProfileListResult.cs new file mode 100644 index 000000000000..fafd94282b79 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeProfileListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// The response of a AutoUpgradeProfile list operation. + internal partial class AutoUpgradeProfileListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The AutoUpgradeProfile items on this page. + /// is null. + internal AutoUpgradeProfileListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The AutoUpgradeProfile items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal AutoUpgradeProfileListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AutoUpgradeProfileListResult() + { + } + + /// The AutoUpgradeProfile items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeProfileProvisioningState.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeProfileProvisioningState.cs new file mode 100644 index 000000000000..2cb2c37c36cc --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeProfileProvisioningState.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// The provisioning state of the AutoUpgradeProfile resource. + public readonly partial struct AutoUpgradeProfileProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AutoUpgradeProfileProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + + /// Resource has been created. + public static AutoUpgradeProfileProvisioningState Succeeded { get; } = new AutoUpgradeProfileProvisioningState(SucceededValue); + /// Resource creation failed. + public static AutoUpgradeProfileProvisioningState Failed { get; } = new AutoUpgradeProfileProvisioningState(FailedValue); + /// Resource creation was canceled. + public static AutoUpgradeProfileProvisioningState Canceled { get; } = new AutoUpgradeProfileProvisioningState(CanceledValue); + /// Determines if two values are the same. + public static bool operator ==(AutoUpgradeProfileProvisioningState left, AutoUpgradeProfileProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AutoUpgradeProfileProvisioningState left, AutoUpgradeProfileProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AutoUpgradeProfileProvisioningState(string value) => new AutoUpgradeProfileProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AutoUpgradeProfileProvisioningState other && Equals(other); + /// + public bool Equals(AutoUpgradeProfileProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeProfileStatus.Serialization.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeProfileStatus.Serialization.cs new file mode 100644 index 000000000000..590658d96bf6 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeProfileStatus.Serialization.cs @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + public partial class AutoUpgradeProfileStatus : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AutoUpgradeProfileStatus)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(LastTriggeredOn)) + { + writer.WritePropertyName("lastTriggeredAt"u8); + writer.WriteStringValue(LastTriggeredOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(LastTriggerStatus)) + { + writer.WritePropertyName("lastTriggerStatus"u8); + writer.WriteStringValue(LastTriggerStatus.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(LastTriggerError)) + { + writer.WritePropertyName("lastTriggerError"u8); + JsonSerializer.Serialize(writer, LastTriggerError); + } + if (options.Format != "W" && Optional.IsCollectionDefined(LastTriggerUpgradeVersions)) + { + writer.WritePropertyName("lastTriggerUpgradeVersions"u8); + writer.WriteStartArray(); + foreach (var item in LastTriggerUpgradeVersions) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AutoUpgradeProfileStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AutoUpgradeProfileStatus)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAutoUpgradeProfileStatus(document.RootElement, options); + } + + internal static AutoUpgradeProfileStatus DeserializeAutoUpgradeProfileStatus(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset? lastTriggeredAt = default; + AutoUpgradeLastTriggerStatus? lastTriggerStatus = default; + ResponseError lastTriggerError = default; + IReadOnlyList lastTriggerUpgradeVersions = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("lastTriggeredAt"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastTriggeredAt = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastTriggerStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastTriggerStatus = new AutoUpgradeLastTriggerStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("lastTriggerError"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastTriggerError = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("lastTriggerUpgradeVersions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + lastTriggerUpgradeVersions = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AutoUpgradeProfileStatus(lastTriggeredAt, lastTriggerStatus, lastTriggerError, lastTriggerUpgradeVersions ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AutoUpgradeProfileStatus)} does not support writing '{options.Format}' format."); + } + } + + AutoUpgradeProfileStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAutoUpgradeProfileStatus(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AutoUpgradeProfileStatus)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeProfileStatus.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeProfileStatus.cs new file mode 100644 index 000000000000..c0e44168a356 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeProfileStatus.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// AutoUpgradeProfileStatus is the status of an auto upgrade profile. + public partial class AutoUpgradeProfileStatus + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public AutoUpgradeProfileStatus() + { + LastTriggerUpgradeVersions = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The UTC time of the last attempt to automatically create and start an UpdateRun as triggered by the release of new versions. + /// The status of the last AutoUpgrade trigger. + /// The error details of the last trigger. + /// The target Kubernetes version or node image versions of the last trigger. + /// Keeps track of any properties unknown to the library. + internal AutoUpgradeProfileStatus(DateTimeOffset? lastTriggeredOn, AutoUpgradeLastTriggerStatus? lastTriggerStatus, ResponseError lastTriggerError, IReadOnlyList lastTriggerUpgradeVersions, IDictionary serializedAdditionalRawData) + { + LastTriggeredOn = lastTriggeredOn; + LastTriggerStatus = lastTriggerStatus; + LastTriggerError = lastTriggerError; + LastTriggerUpgradeVersions = lastTriggerUpgradeVersions; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The UTC time of the last attempt to automatically create and start an UpdateRun as triggered by the release of new versions. + public DateTimeOffset? LastTriggeredOn { get; } + /// The status of the last AutoUpgrade trigger. + public AutoUpgradeLastTriggerStatus? LastTriggerStatus { get; } + /// The error details of the last trigger. + public ResponseError LastTriggerError { get; } + /// The target Kubernetes version or node image versions of the last trigger. + public IReadOnlyList LastTriggerUpgradeVersions { get; } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetCredentialResult.Serialization.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetCredentialResult.Serialization.cs new file mode 100644 index 000000000000..aa832dc70f37 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetCredentialResult.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + public partial class FleetCredentialResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetCredentialResult)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && Optional.IsDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteBase64StringValue(Value, "D"); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FleetCredentialResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetCredentialResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetCredentialResult(document.RootElement, options); + } + + internal static FleetCredentialResult DeserializeFleetCredentialResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + byte[] value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + value = property.Value.GetBytesFromBase64("D"); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetCredentialResult(name, value, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FleetCredentialResult)} does not support writing '{options.Format}' format."); + } + } + + FleetCredentialResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFleetCredentialResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetCredentialResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetCredentialResult.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetCredentialResult.cs new file mode 100644 index 000000000000..fddf0d409547 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetCredentialResult.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// One credential result item. + public partial class FleetCredentialResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal FleetCredentialResult() + { + } + + /// Initializes a new instance of . + /// The name of the credential. + /// Base64-encoded Kubernetes configuration file. + /// Keeps track of any properties unknown to the library. + internal FleetCredentialResult(string name, byte[] value, IDictionary serializedAdditionalRawData) + { + Name = name; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The name of the credential. + public string Name { get; } + /// Base64-encoded Kubernetes configuration file. + public byte[] Value { get; } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetCredentialResults.Serialization.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetCredentialResults.Serialization.cs new file mode 100644 index 000000000000..51a9eb6e9614 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetCredentialResults.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + public partial class FleetCredentialResults : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetCredentialResults)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsCollectionDefined(Kubeconfigs)) + { + writer.WritePropertyName("kubeconfigs"u8); + writer.WriteStartArray(); + foreach (var item in Kubeconfigs) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FleetCredentialResults IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetCredentialResults)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetCredentialResults(document.RootElement, options); + } + + internal static FleetCredentialResults DeserializeFleetCredentialResults(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList kubeconfigs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("kubeconfigs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FleetCredentialResult.DeserializeFleetCredentialResult(item, options)); + } + kubeconfigs = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetCredentialResults(kubeconfigs ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FleetCredentialResults)} does not support writing '{options.Format}' format."); + } + } + + FleetCredentialResults IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFleetCredentialResults(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetCredentialResults)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetCredentialResults.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetCredentialResults.cs new file mode 100644 index 000000000000..336a85a07109 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetCredentialResults.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// The Credential results response. + public partial class FleetCredentialResults + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal FleetCredentialResults() + { + Kubeconfigs = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Array of base64-encoded Kubernetes configuration files. + /// Keeps track of any properties unknown to the library. + internal FleetCredentialResults(IReadOnlyList kubeconfigs, IDictionary serializedAdditionalRawData) + { + Kubeconfigs = kubeconfigs; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Array of base64-encoded Kubernetes configuration files. + public IReadOnlyList Kubeconfigs { get; } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetHubProfile.Serialization.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetHubProfile.Serialization.cs new file mode 100644 index 000000000000..97341dc23f0d --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetHubProfile.Serialization.cs @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + public partial class FleetHubProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetHubProfile)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(DnsPrefix)) + { + writer.WritePropertyName("dnsPrefix"u8); + writer.WriteStringValue(DnsPrefix); + } + if (Optional.IsDefined(ApiServerAccessProfile)) + { + writer.WritePropertyName("apiServerAccessProfile"u8); + writer.WriteObjectValue(ApiServerAccessProfile, options); + } + if (Optional.IsDefined(AgentProfile)) + { + writer.WritePropertyName("agentProfile"u8); + writer.WriteObjectValue(AgentProfile, options); + } + if (options.Format != "W" && Optional.IsDefined(Fqdn)) + { + writer.WritePropertyName("fqdn"u8); + writer.WriteStringValue(Fqdn); + } + if (options.Format != "W" && Optional.IsDefined(KubernetesVersion)) + { + writer.WritePropertyName("kubernetesVersion"u8); + writer.WriteStringValue(KubernetesVersion); + } + if (options.Format != "W" && Optional.IsDefined(PortalFqdn)) + { + writer.WritePropertyName("portalFqdn"u8); + writer.WriteStringValue(PortalFqdn); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FleetHubProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetHubProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetHubProfile(document.RootElement, options); + } + + internal static FleetHubProfile DeserializeFleetHubProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string dnsPrefix = default; + APIServerAccessProfile apiServerAccessProfile = default; + AgentProfile agentProfile = default; + string fqdn = default; + string kubernetesVersion = default; + string portalFqdn = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("dnsPrefix"u8)) + { + dnsPrefix = property.Value.GetString(); + continue; + } + if (property.NameEquals("apiServerAccessProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + apiServerAccessProfile = APIServerAccessProfile.DeserializeAPIServerAccessProfile(property.Value, options); + continue; + } + if (property.NameEquals("agentProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + agentProfile = AgentProfile.DeserializeAgentProfile(property.Value, options); + continue; + } + if (property.NameEquals("fqdn"u8)) + { + fqdn = property.Value.GetString(); + continue; + } + if (property.NameEquals("kubernetesVersion"u8)) + { + kubernetesVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("portalFqdn"u8)) + { + portalFqdn = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetHubProfile( + dnsPrefix, + apiServerAccessProfile, + agentProfile, + fqdn, + kubernetesVersion, + portalFqdn, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FleetHubProfile)} does not support writing '{options.Format}' format."); + } + } + + FleetHubProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFleetHubProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetHubProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetHubProfile.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetHubProfile.cs new file mode 100644 index 000000000000..ee84030f529c --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetHubProfile.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// The FleetHubProfile configures the fleet hub. + public partial class FleetHubProfile + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public FleetHubProfile() + { + } + + /// Initializes a new instance of . + /// DNS prefix used to create the FQDN for the Fleet hub. + /// The access profile for the Fleet hub API server. + /// The agent profile for the Fleet hub. + /// The FQDN of the Fleet hub. + /// The Kubernetes version of the Fleet hub. + /// The Azure Portal FQDN of the Fleet hub. + /// Keeps track of any properties unknown to the library. + internal FleetHubProfile(string dnsPrefix, APIServerAccessProfile apiServerAccessProfile, AgentProfile agentProfile, string fqdn, string kubernetesVersion, string portalFqdn, IDictionary serializedAdditionalRawData) + { + DnsPrefix = dnsPrefix; + ApiServerAccessProfile = apiServerAccessProfile; + AgentProfile = agentProfile; + Fqdn = fqdn; + KubernetesVersion = kubernetesVersion; + PortalFqdn = portalFqdn; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// DNS prefix used to create the FQDN for the Fleet hub. + public string DnsPrefix { get; set; } + /// The access profile for the Fleet hub API server. + public APIServerAccessProfile ApiServerAccessProfile { get; set; } + /// The agent profile for the Fleet hub. + public AgentProfile AgentProfile { get; set; } + /// The FQDN of the Fleet hub. + public string Fqdn { get; } + /// The Kubernetes version of the Fleet hub. + public string KubernetesVersion { get; } + /// The Azure Portal FQDN of the Fleet hub. + public string PortalFqdn { get; } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetListResult.Serialization.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetListResult.Serialization.cs new file mode 100644 index 000000000000..a6f1b635c17f --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + internal partial class FleetListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FleetListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetListResult(document.RootElement, options); + } + + internal static FleetListResult DeserializeFleetListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FleetData.DeserializeFleetData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FleetListResult)} does not support writing '{options.Format}' format."); + } + } + + FleetListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFleetListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetListResult.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetListResult.cs new file mode 100644 index 000000000000..55c636ffceb6 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// The response of a Fleet list operation. + internal partial class FleetListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The Fleet items on this page. + /// is null. + internal FleetListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The Fleet items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal FleetListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FleetListResult() + { + } + + /// The Fleet items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetMemberListResult.Serialization.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetMemberListResult.Serialization.cs new file mode 100644 index 000000000000..0fd6b1dbd613 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetMemberListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + internal partial class FleetMemberListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetMemberListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FleetMemberListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetMemberListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetMemberListResult(document.RootElement, options); + } + + internal static FleetMemberListResult DeserializeFleetMemberListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FleetMemberData.DeserializeFleetMemberData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetMemberListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FleetMemberListResult)} does not support writing '{options.Format}' format."); + } + } + + FleetMemberListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFleetMemberListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetMemberListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetMemberListResult.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetMemberListResult.cs new file mode 100644 index 000000000000..236c06151c5a --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetMemberListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// The response of a FleetMember list operation. + internal partial class FleetMemberListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The FleetMember items on this page. + /// is null. + internal FleetMemberListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The FleetMember items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal FleetMemberListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FleetMemberListResult() + { + } + + /// The FleetMember items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetMemberPatch.Serialization.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetMemberPatch.Serialization.cs new file mode 100644 index 000000000000..59fb822e949f --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetMemberPatch.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + public partial class FleetMemberPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetMemberPatch)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(Group)) + { + writer.WritePropertyName("group"u8); + writer.WriteStringValue(Group); + } + writer.WriteEndObject(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FleetMemberPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetMemberPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetMemberPatch(document.RootElement, options); + } + + internal static FleetMemberPatch DeserializeFleetMemberPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string group = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("group"u8)) + { + group = property0.Value.GetString(); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetMemberPatch(group, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FleetMemberPatch)} does not support writing '{options.Format}' format."); + } + } + + FleetMemberPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFleetMemberPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetMemberPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetMemberPatch.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetMemberPatch.cs new file mode 100644 index 000000000000..1c9c6a28b95a --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetMemberPatch.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// The type used for update operations of the FleetMember. + public partial class FleetMemberPatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public FleetMemberPatch() + { + } + + /// Initializes a new instance of . + /// The group this member belongs to for multi-cluster update management. + /// Keeps track of any properties unknown to the library. + internal FleetMemberPatch(string group, IDictionary serializedAdditionalRawData) + { + Group = group; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The group this member belongs to for multi-cluster update management. + public string Group { get; set; } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetMemberProvisioningState.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetMemberProvisioningState.cs new file mode 100644 index 000000000000..4f1e4da3390e --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetMemberProvisioningState.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// The provisioning state of the last accepted operation. + public readonly partial struct FleetMemberProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public FleetMemberProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + private const string JoiningValue = "Joining"; + private const string LeavingValue = "Leaving"; + private const string UpdatingValue = "Updating"; + + /// Resource has been created. + public static FleetMemberProvisioningState Succeeded { get; } = new FleetMemberProvisioningState(SucceededValue); + /// Resource creation failed. + public static FleetMemberProvisioningState Failed { get; } = new FleetMemberProvisioningState(FailedValue); + /// Resource creation was canceled. + public static FleetMemberProvisioningState Canceled { get; } = new FleetMemberProvisioningState(CanceledValue); + /// The provisioning state of a member joining a fleet. + public static FleetMemberProvisioningState Joining { get; } = new FleetMemberProvisioningState(JoiningValue); + /// The provisioning state of a member leaving a fleet. + public static FleetMemberProvisioningState Leaving { get; } = new FleetMemberProvisioningState(LeavingValue); + /// The provisioning state of a member being updated. + public static FleetMemberProvisioningState Updating { get; } = new FleetMemberProvisioningState(UpdatingValue); + /// Determines if two values are the same. + public static bool operator ==(FleetMemberProvisioningState left, FleetMemberProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(FleetMemberProvisioningState left, FleetMemberProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator FleetMemberProvisioningState(string value) => new FleetMemberProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is FleetMemberProvisioningState other && Equals(other); + /// + public bool Equals(FleetMemberProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetMemberStatus.Serialization.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetMemberStatus.Serialization.cs new file mode 100644 index 000000000000..6587c9e222e3 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetMemberStatus.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + public partial class FleetMemberStatus : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetMemberStatus)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(LastOperationId)) + { + writer.WritePropertyName("lastOperationId"u8); + writer.WriteStringValue(LastOperationId); + } + if (options.Format != "W" && Optional.IsDefined(LastOperationError)) + { + writer.WritePropertyName("lastOperationError"u8); + JsonSerializer.Serialize(writer, LastOperationError); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FleetMemberStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetMemberStatus)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetMemberStatus(document.RootElement, options); + } + + internal static FleetMemberStatus DeserializeFleetMemberStatus(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string lastOperationId = default; + ResponseError lastOperationError = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("lastOperationId"u8)) + { + lastOperationId = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastOperationError"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastOperationError = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetMemberStatus(lastOperationId, lastOperationError, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FleetMemberStatus)} does not support writing '{options.Format}' format."); + } + } + + FleetMemberStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFleetMemberStatus(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetMemberStatus)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetMemberStatus.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetMemberStatus.cs new file mode 100644 index 000000000000..9ef66a477bff --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetMemberStatus.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// Status information for the fleet member. + public partial class FleetMemberStatus + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal FleetMemberStatus() + { + } + + /// Initializes a new instance of . + /// The last operation ID for the fleet member. + /// The last operation error of the fleet member. + /// Keeps track of any properties unknown to the library. + internal FleetMemberStatus(string lastOperationId, ResponseError lastOperationError, IDictionary serializedAdditionalRawData) + { + LastOperationId = lastOperationId; + LastOperationError = lastOperationError; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The last operation ID for the fleet member. + public string LastOperationId { get; } + /// The last operation error of the fleet member. + public ResponseError LastOperationError { get; } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetPatch.Serialization.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetPatch.Serialization.cs new file mode 100644 index 000000000000..8bf533e04564 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetPatch.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + public partial class FleetPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + writer.WriteObjectValue(Identity, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FleetPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetPatch(document.RootElement, options); + } + + internal static FleetPatch DeserializeFleetPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + ManagedServiceIdentity identity = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identity = ManagedServiceIdentity.DeserializeManagedServiceIdentity(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetPatch(tags ?? new ChangeTrackingDictionary(), identity, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FleetPatch)} does not support writing '{options.Format}' format."); + } + } + + FleetPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFleetPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetPatch.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetPatch.cs new file mode 100644 index 000000000000..18ef04b4ca97 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetPatch.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// Properties of a Fleet that can be patched. + public partial class FleetPatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public FleetPatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Resource tags. + /// Managed identity. + /// Keeps track of any properties unknown to the library. + internal FleetPatch(IDictionary tags, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) + { + Tags = tags; + Identity = identity; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Resource tags. + public IDictionary Tags { get; } + /// Managed identity. + public ManagedServiceIdentity Identity { get; set; } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetProvisioningState.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetProvisioningState.cs new file mode 100644 index 000000000000..30f49b4a977e --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetProvisioningState.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// The provisioning state of the last accepted operation. + public readonly partial struct FleetProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public FleetProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + private const string CreatingValue = "Creating"; + private const string UpdatingValue = "Updating"; + private const string DeletingValue = "Deleting"; + + /// Resource has been created. + public static FleetProvisioningState Succeeded { get; } = new FleetProvisioningState(SucceededValue); + /// Resource creation failed. + public static FleetProvisioningState Failed { get; } = new FleetProvisioningState(FailedValue); + /// Resource creation was canceled. + public static FleetProvisioningState Canceled { get; } = new FleetProvisioningState(CanceledValue); + /// The provisioning state of a fleet being created. + public static FleetProvisioningState Creating { get; } = new FleetProvisioningState(CreatingValue); + /// The provisioning state of a fleet being updated. + public static FleetProvisioningState Updating { get; } = new FleetProvisioningState(UpdatingValue); + /// The provisioning state of a fleet being deleted. + public static FleetProvisioningState Deleting { get; } = new FleetProvisioningState(DeletingValue); + /// Determines if two values are the same. + public static bool operator ==(FleetProvisioningState left, FleetProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(FleetProvisioningState left, FleetProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator FleetProvisioningState(string value) => new FleetProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is FleetProvisioningState other && Equals(other); + /// + public bool Equals(FleetProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetStatus.Serialization.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetStatus.Serialization.cs new file mode 100644 index 000000000000..0a45435d1e08 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetStatus.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + public partial class FleetStatus : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetStatus)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(LastOperationId)) + { + writer.WritePropertyName("lastOperationId"u8); + writer.WriteStringValue(LastOperationId); + } + if (options.Format != "W" && Optional.IsDefined(LastOperationError)) + { + writer.WritePropertyName("lastOperationError"u8); + JsonSerializer.Serialize(writer, LastOperationError); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FleetStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetStatus)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetStatus(document.RootElement, options); + } + + internal static FleetStatus DeserializeFleetStatus(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string lastOperationId = default; + ResponseError lastOperationError = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("lastOperationId"u8)) + { + lastOperationId = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastOperationError"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastOperationError = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetStatus(lastOperationId, lastOperationError, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FleetStatus)} does not support writing '{options.Format}' format."); + } + } + + FleetStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFleetStatus(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetStatus)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetStatus.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetStatus.cs new file mode 100644 index 000000000000..9763bc3111ca --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetStatus.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// Status information for the fleet. + public partial class FleetStatus + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal FleetStatus() + { + } + + /// Initializes a new instance of . + /// The last operation ID for the fleet. + /// The last operation error for the fleet. + /// Keeps track of any properties unknown to the library. + internal FleetStatus(string lastOperationId, ResponseError lastOperationError, IDictionary serializedAdditionalRawData) + { + LastOperationId = lastOperationId; + LastOperationError = lastOperationError; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The last operation ID for the fleet. + public string LastOperationId { get; } + /// The last operation error for the fleet. + public ResponseError LastOperationError { get; } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetUpdateStrategyListResult.Serialization.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetUpdateStrategyListResult.Serialization.cs new file mode 100644 index 000000000000..99279f77c51e --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetUpdateStrategyListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + internal partial class FleetUpdateStrategyListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetUpdateStrategyListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FleetUpdateStrategyListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetUpdateStrategyListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetUpdateStrategyListResult(document.RootElement, options); + } + + internal static FleetUpdateStrategyListResult DeserializeFleetUpdateStrategyListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FleetUpdateStrategyData.DeserializeFleetUpdateStrategyData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetUpdateStrategyListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FleetUpdateStrategyListResult)} does not support writing '{options.Format}' format."); + } + } + + FleetUpdateStrategyListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFleetUpdateStrategyListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetUpdateStrategyListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetUpdateStrategyListResult.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetUpdateStrategyListResult.cs new file mode 100644 index 000000000000..4dd4c287eb93 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetUpdateStrategyListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// The response of a FleetUpdateStrategy list operation. + internal partial class FleetUpdateStrategyListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The FleetUpdateStrategy items on this page. + /// is null. + internal FleetUpdateStrategyListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The FleetUpdateStrategy items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal FleetUpdateStrategyListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FleetUpdateStrategyListResult() + { + } + + /// The FleetUpdateStrategy items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetUpdateStrategyProvisioningState.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetUpdateStrategyProvisioningState.cs new file mode 100644 index 000000000000..9a8206ec138e --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetUpdateStrategyProvisioningState.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// The provisioning state of the UpdateStrategy resource. + public readonly partial struct FleetUpdateStrategyProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public FleetUpdateStrategyProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + + /// Resource has been created. + public static FleetUpdateStrategyProvisioningState Succeeded { get; } = new FleetUpdateStrategyProvisioningState(SucceededValue); + /// Resource creation failed. + public static FleetUpdateStrategyProvisioningState Failed { get; } = new FleetUpdateStrategyProvisioningState(FailedValue); + /// Resource creation was canceled. + public static FleetUpdateStrategyProvisioningState Canceled { get; } = new FleetUpdateStrategyProvisioningState(CanceledValue); + /// Determines if two values are the same. + public static bool operator ==(FleetUpdateStrategyProvisioningState left, FleetUpdateStrategyProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(FleetUpdateStrategyProvisioningState left, FleetUpdateStrategyProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator FleetUpdateStrategyProvisioningState(string value) => new FleetUpdateStrategyProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is FleetUpdateStrategyProvisioningState other && Equals(other); + /// + public bool Equals(FleetUpdateStrategyProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ManagedClusterUpdate.Serialization.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ManagedClusterUpdate.Serialization.cs new file mode 100644 index 000000000000..949c8a07a175 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ManagedClusterUpdate.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + public partial class ManagedClusterUpdate : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedClusterUpdate)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("upgrade"u8); + writer.WriteObjectValue(Upgrade, options); + if (Optional.IsDefined(NodeImageSelection)) + { + writer.WritePropertyName("nodeImageSelection"u8); + writer.WriteObjectValue(NodeImageSelection, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ManagedClusterUpdate IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedClusterUpdate)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeManagedClusterUpdate(document.RootElement, options); + } + + internal static ManagedClusterUpdate DeserializeManagedClusterUpdate(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ManagedClusterUpgradeSpec upgrade = default; + NodeImageSelection nodeImageSelection = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("upgrade"u8)) + { + upgrade = ManagedClusterUpgradeSpec.DeserializeManagedClusterUpgradeSpec(property.Value, options); + continue; + } + if (property.NameEquals("nodeImageSelection"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nodeImageSelection = NodeImageSelection.DeserializeNodeImageSelection(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ManagedClusterUpdate(upgrade, nodeImageSelection, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ManagedClusterUpdate)} does not support writing '{options.Format}' format."); + } + } + + ManagedClusterUpdate IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeManagedClusterUpdate(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ManagedClusterUpdate)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ManagedClusterUpdate.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ManagedClusterUpdate.cs new file mode 100644 index 000000000000..bd68d7133cc7 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ManagedClusterUpdate.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// The update to be applied to the ManagedClusters. + public partial class ManagedClusterUpdate + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The upgrade to apply to the ManagedClusters. + /// is null. + public ManagedClusterUpdate(ManagedClusterUpgradeSpec upgrade) + { + Argument.AssertNotNull(upgrade, nameof(upgrade)); + + Upgrade = upgrade; + } + + /// Initializes a new instance of . + /// The upgrade to apply to the ManagedClusters. + /// The node image upgrade to be applied to the target nodes in update run. + /// Keeps track of any properties unknown to the library. + internal ManagedClusterUpdate(ManagedClusterUpgradeSpec upgrade, NodeImageSelection nodeImageSelection, IDictionary serializedAdditionalRawData) + { + Upgrade = upgrade; + NodeImageSelection = nodeImageSelection; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ManagedClusterUpdate() + { + } + + /// The upgrade to apply to the ManagedClusters. + public ManagedClusterUpgradeSpec Upgrade { get; set; } + /// The node image upgrade to be applied to the target nodes in update run. + public NodeImageSelection NodeImageSelection { get; set; } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ManagedClusterUpgradeSpec.Serialization.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ManagedClusterUpgradeSpec.Serialization.cs new file mode 100644 index 000000000000..2f163d194190 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ManagedClusterUpgradeSpec.Serialization.cs @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + public partial class ManagedClusterUpgradeSpec : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedClusterUpgradeSpec)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.ToString()); + if (Optional.IsDefined(KubernetesVersion)) + { + writer.WritePropertyName("kubernetesVersion"u8); + writer.WriteStringValue(KubernetesVersion); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ManagedClusterUpgradeSpec IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedClusterUpgradeSpec)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeManagedClusterUpgradeSpec(document.RootElement, options); + } + + internal static ManagedClusterUpgradeSpec DeserializeManagedClusterUpgradeSpec(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ManagedClusterUpgradeType type = default; + string kubernetesVersion = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = new ManagedClusterUpgradeType(property.Value.GetString()); + continue; + } + if (property.NameEquals("kubernetesVersion"u8)) + { + kubernetesVersion = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ManagedClusterUpgradeSpec(type, kubernetesVersion, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ManagedClusterUpgradeSpec)} does not support writing '{options.Format}' format."); + } + } + + ManagedClusterUpgradeSpec IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeManagedClusterUpgradeSpec(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ManagedClusterUpgradeSpec)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ManagedClusterUpgradeSpec.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ManagedClusterUpgradeSpec.cs new file mode 100644 index 000000000000..274875f4f7ff --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ManagedClusterUpgradeSpec.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// The upgrade to apply to a ManagedCluster. + public partial class ManagedClusterUpgradeSpec + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// ManagedClusterUpgradeType is the type of upgrade to be applied. + public ManagedClusterUpgradeSpec(ManagedClusterUpgradeType type) + { + Type = type; + } + + /// Initializes a new instance of . + /// ManagedClusterUpgradeType is the type of upgrade to be applied. + /// The Kubernetes version to upgrade the member clusters to. + /// Keeps track of any properties unknown to the library. + internal ManagedClusterUpgradeSpec(ManagedClusterUpgradeType type, string kubernetesVersion, IDictionary serializedAdditionalRawData) + { + Type = type; + KubernetesVersion = kubernetesVersion; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ManagedClusterUpgradeSpec() + { + } + + /// ManagedClusterUpgradeType is the type of upgrade to be applied. + public ManagedClusterUpgradeType Type { get; set; } + /// The Kubernetes version to upgrade the member clusters to. + public string KubernetesVersion { get; set; } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ManagedClusterUpgradeType.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ManagedClusterUpgradeType.cs new file mode 100644 index 000000000000..eda46d0aa8dd --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ManagedClusterUpgradeType.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// The type of upgrade to perform when targeting ManagedClusters. + public readonly partial struct ManagedClusterUpgradeType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ManagedClusterUpgradeType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string FullValue = "Full"; + private const string NodeImageOnlyValue = "NodeImageOnly"; + private const string ControlPlaneOnlyValue = "ControlPlaneOnly"; + + /// Full upgrades the control plane and all agent pools of the target ManagedClusters. Requires the ManagedClusterUpgradeSpec.KubernetesVersion property to be set. + public static ManagedClusterUpgradeType Full { get; } = new ManagedClusterUpgradeType(FullValue); + /// NodeImageOnly upgrades only the node images of the target ManagedClusters. Requires the ManagedClusterUpgradeSpec.KubernetesVersion property to NOT be set. + public static ManagedClusterUpgradeType NodeImageOnly { get; } = new ManagedClusterUpgradeType(NodeImageOnlyValue); + /// ControlPlaneOnly upgrades only targets the KubernetesVersion of the ManagedClusters and will not be applied to the AgentPool. Requires the ManagedClusterUpgradeSpec.KubernetesVersion property to be set. + public static ManagedClusterUpgradeType ControlPlaneOnly { get; } = new ManagedClusterUpgradeType(ControlPlaneOnlyValue); + /// Determines if two values are the same. + public static bool operator ==(ManagedClusterUpgradeType left, ManagedClusterUpgradeType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ManagedClusterUpgradeType left, ManagedClusterUpgradeType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ManagedClusterUpgradeType(string value) => new ManagedClusterUpgradeType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ManagedClusterUpgradeType other && Equals(other); + /// + public bool Equals(ManagedClusterUpgradeType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ManagedServiceIdentity.Serialization.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ManagedServiceIdentity.Serialization.cs new file mode 100644 index 000000000000..8ccc3c89bae9 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ManagedServiceIdentity.Serialization.cs @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + public partial class ManagedServiceIdentity : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedServiceIdentity)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(PrincipalId)) + { + writer.WritePropertyName("principalId"u8); + writer.WriteStringValue(PrincipalId.Value); + } + if (options.Format != "W" && Optional.IsDefined(TenantId)) + { + writer.WritePropertyName("tenantId"u8); + writer.WriteStringValue(TenantId.Value); + } + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.ToString()); + if (Optional.IsCollectionDefined(UserAssignedIdentities)) + { + writer.WritePropertyName("userAssignedIdentities"u8); + writer.WriteStartObject(); + foreach (var item in UserAssignedIdentities) + { + writer.WritePropertyName(item.Key); + JsonSerializer.Serialize(writer, item.Value); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ManagedServiceIdentity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedServiceIdentity)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeManagedServiceIdentity(document.RootElement, options); + } + + internal static ManagedServiceIdentity DeserializeManagedServiceIdentity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Guid? principalId = default; + Guid? tenantId = default; + ManagedServiceIdentityType type = default; + IDictionary userAssignedIdentities = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("principalId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + principalId = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("tenantId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + tenantId = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ManagedServiceIdentityType(property.Value.GetString()); + continue; + } + if (property.NameEquals("userAssignedIdentities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, JsonSerializer.Deserialize(property0.Value.GetRawText())); + } + userAssignedIdentities = dictionary; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ManagedServiceIdentity(principalId, tenantId, type, userAssignedIdentities ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ManagedServiceIdentity)} does not support writing '{options.Format}' format."); + } + } + + ManagedServiceIdentity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeManagedServiceIdentity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ManagedServiceIdentity)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ManagedServiceIdentity.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ManagedServiceIdentity.cs new file mode 100644 index 000000000000..704a62918042 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ManagedServiceIdentity.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// Managed service identity (system assigned and/or user assigned identities). + public partial class ManagedServiceIdentity + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The type of managed identity assigned to this resource. + public ManagedServiceIdentity(ManagedServiceIdentityType type) + { + Type = type; + UserAssignedIdentities = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. + /// The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. + /// The type of managed identity assigned to this resource. + /// The identities assigned to this resource by the user. + /// Keeps track of any properties unknown to the library. + internal ManagedServiceIdentity(Guid? principalId, Guid? tenantId, ManagedServiceIdentityType type, IDictionary userAssignedIdentities, IDictionary serializedAdditionalRawData) + { + PrincipalId = principalId; + TenantId = tenantId; + Type = type; + UserAssignedIdentities = userAssignedIdentities; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ManagedServiceIdentity() + { + } + + /// The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. + public Guid? PrincipalId { get; } + /// The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. + public Guid? TenantId { get; } + /// The type of managed identity assigned to this resource. + public ManagedServiceIdentityType Type { get; set; } + /// The identities assigned to this resource by the user. + public IDictionary UserAssignedIdentities { get; } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ManagedServiceIdentityType.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ManagedServiceIdentityType.cs new file mode 100644 index 000000000000..eba0fdf3c2d6 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ManagedServiceIdentityType.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + public readonly partial struct ManagedServiceIdentityType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ManagedServiceIdentityType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string SystemAssignedValue = "SystemAssigned"; + private const string UserAssignedValue = "UserAssigned"; + private const string SystemAndUserAssignedValue = "SystemAssigned, UserAssigned"; + + /// No managed identity. + public static ManagedServiceIdentityType None { get; } = new ManagedServiceIdentityType(NoneValue); + /// System assigned managed identity. + public static ManagedServiceIdentityType SystemAssigned { get; } = new ManagedServiceIdentityType(SystemAssignedValue); + /// User assigned managed identity. + public static ManagedServiceIdentityType UserAssigned { get; } = new ManagedServiceIdentityType(UserAssignedValue); + /// System and user assigned managed identity. + public static ManagedServiceIdentityType SystemAndUserAssigned { get; } = new ManagedServiceIdentityType(SystemAndUserAssignedValue); + /// Determines if two values are the same. + public static bool operator ==(ManagedServiceIdentityType left, ManagedServiceIdentityType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ManagedServiceIdentityType left, ManagedServiceIdentityType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ManagedServiceIdentityType(string value) => new ManagedServiceIdentityType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ManagedServiceIdentityType other && Equals(other); + /// + public bool Equals(ManagedServiceIdentityType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/MemberUpdateStatus.Serialization.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/MemberUpdateStatus.Serialization.cs new file mode 100644 index 000000000000..f0de14d2b929 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/MemberUpdateStatus.Serialization.cs @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + public partial class MemberUpdateStatus : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MemberUpdateStatus)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteObjectValue(Status, options); + } + if (options.Format != "W" && Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && Optional.IsDefined(ClusterResourceId)) + { + writer.WritePropertyName("clusterResourceId"u8); + writer.WriteStringValue(ClusterResourceId); + } + if (options.Format != "W" && Optional.IsDefined(OperationId)) + { + writer.WritePropertyName("operationId"u8); + writer.WriteStringValue(OperationId); + } + if (options.Format != "W" && Optional.IsDefined(Message)) + { + writer.WritePropertyName("message"u8); + writer.WriteStringValue(Message); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + MemberUpdateStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MemberUpdateStatus)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMemberUpdateStatus(document.RootElement, options); + } + + internal static MemberUpdateStatus DeserializeMemberUpdateStatus(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + UpdateStatus status = default; + string name = default; + string clusterResourceId = default; + string operationId = default; + string message = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = UpdateStatus.DeserializeUpdateStatus(property.Value, options); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("clusterResourceId"u8)) + { + clusterResourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("operationId"u8)) + { + operationId = property.Value.GetString(); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MemberUpdateStatus( + status, + name, + clusterResourceId, + operationId, + message, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MemberUpdateStatus)} does not support writing '{options.Format}' format."); + } + } + + MemberUpdateStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeMemberUpdateStatus(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MemberUpdateStatus)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/MemberUpdateStatus.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/MemberUpdateStatus.cs new file mode 100644 index 000000000000..5da344f12b99 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/MemberUpdateStatus.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// The status of a member update operation. + public partial class MemberUpdateStatus + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal MemberUpdateStatus() + { + } + + /// Initializes a new instance of . + /// The status of the MemberUpdate operation. + /// The name of the FleetMember. + /// The Azure resource id of the target Kubernetes cluster. + /// The operation resource id of the latest attempt to perform the operation. + /// The status message after processing the member update operation. + /// Keeps track of any properties unknown to the library. + internal MemberUpdateStatus(UpdateStatus status, string name, string clusterResourceId, string operationId, string message, IDictionary serializedAdditionalRawData) + { + Status = status; + Name = name; + ClusterResourceId = clusterResourceId; + OperationId = operationId; + Message = message; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The status of the MemberUpdate operation. + public UpdateStatus Status { get; } + /// The name of the FleetMember. + public string Name { get; } + /// The Azure resource id of the target Kubernetes cluster. + public string ClusterResourceId { get; } + /// The operation resource id of the latest attempt to perform the operation. + public string OperationId { get; } + /// The status message after processing the member update operation. + public string Message { get; } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/NodeImageSelection.Serialization.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/NodeImageSelection.Serialization.cs new file mode 100644 index 000000000000..f15cdefe39d0 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/NodeImageSelection.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + public partial class NodeImageSelection : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NodeImageSelection)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.ToString()); + if (Optional.IsCollectionDefined(CustomNodeImageVersions)) + { + writer.WritePropertyName("customNodeImageVersions"u8); + writer.WriteStartArray(); + foreach (var item in CustomNodeImageVersions) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NodeImageSelection IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NodeImageSelection)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNodeImageSelection(document.RootElement, options); + } + + internal static NodeImageSelection DeserializeNodeImageSelection(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + NodeImageSelectionType type = default; + IList customNodeImageVersions = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = new NodeImageSelectionType(property.Value.GetString()); + continue; + } + if (property.NameEquals("customNodeImageVersions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NodeImageVersion.DeserializeNodeImageVersion(item, options)); + } + customNodeImageVersions = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NodeImageSelection(type, customNodeImageVersions ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(NodeImageSelection)} does not support writing '{options.Format}' format."); + } + } + + NodeImageSelection IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNodeImageSelection(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NodeImageSelection)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/NodeImageSelection.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/NodeImageSelection.cs new file mode 100644 index 000000000000..c535d39f0c2b --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/NodeImageSelection.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// The node image upgrade to be applied to the target nodes in update run. + public partial class NodeImageSelection + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The node image upgrade type. + public NodeImageSelection(NodeImageSelectionType type) + { + Type = type; + CustomNodeImageVersions = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The node image upgrade type. + /// Custom node image versions to upgrade the nodes to. This field is required if node image selection type is Custom. Otherwise, it must be empty. For each node image family (e.g., 'AKSUbuntu-1804gen2containerd'), this field can contain at most one version (e.g., only one of 'AKSUbuntu-1804gen2containerd-2023.01.12' or 'AKSUbuntu-1804gen2containerd-2023.02.12', not both). If the nodes belong to a family without a matching image version in this field, they are not upgraded. + /// Keeps track of any properties unknown to the library. + internal NodeImageSelection(NodeImageSelectionType type, IList customNodeImageVersions, IDictionary serializedAdditionalRawData) + { + Type = type; + CustomNodeImageVersions = customNodeImageVersions; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal NodeImageSelection() + { + } + + /// The node image upgrade type. + public NodeImageSelectionType Type { get; set; } + /// Custom node image versions to upgrade the nodes to. This field is required if node image selection type is Custom. Otherwise, it must be empty. For each node image family (e.g., 'AKSUbuntu-1804gen2containerd'), this field can contain at most one version (e.g., only one of 'AKSUbuntu-1804gen2containerd-2023.01.12' or 'AKSUbuntu-1804gen2containerd-2023.02.12', not both). If the nodes belong to a family without a matching image version in this field, they are not upgraded. + public IList CustomNodeImageVersions { get; } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/NodeImageSelectionStatus.Serialization.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/NodeImageSelectionStatus.Serialization.cs new file mode 100644 index 000000000000..7f6aea8fbda5 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/NodeImageSelectionStatus.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + internal partial class NodeImageSelectionStatus : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NodeImageSelectionStatus)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsCollectionDefined(SelectedNodeImageVersions)) + { + writer.WritePropertyName("selectedNodeImageVersions"u8); + writer.WriteStartArray(); + foreach (var item in SelectedNodeImageVersions) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NodeImageSelectionStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NodeImageSelectionStatus)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNodeImageSelectionStatus(document.RootElement, options); + } + + internal static NodeImageSelectionStatus DeserializeNodeImageSelectionStatus(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList selectedNodeImageVersions = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("selectedNodeImageVersions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NodeImageVersion.DeserializeNodeImageVersion(item, options)); + } + selectedNodeImageVersions = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NodeImageSelectionStatus(selectedNodeImageVersions ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(NodeImageSelectionStatus)} does not support writing '{options.Format}' format."); + } + } + + NodeImageSelectionStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNodeImageSelectionStatus(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NodeImageSelectionStatus)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/NodeImageSelectionStatus.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/NodeImageSelectionStatus.cs new file mode 100644 index 000000000000..ea5d81b43e61 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/NodeImageSelectionStatus.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// The node image upgrade specs for the update run. + internal partial class NodeImageSelectionStatus + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal NodeImageSelectionStatus() + { + SelectedNodeImageVersions = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The image versions to upgrade the nodes to. + /// Keeps track of any properties unknown to the library. + internal NodeImageSelectionStatus(IReadOnlyList selectedNodeImageVersions, IDictionary serializedAdditionalRawData) + { + SelectedNodeImageVersions = selectedNodeImageVersions; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The image versions to upgrade the nodes to. + public IReadOnlyList SelectedNodeImageVersions { get; } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/NodeImageSelectionType.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/NodeImageSelectionType.cs new file mode 100644 index 000000000000..ea1381fe7ee2 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/NodeImageSelectionType.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// The node image upgrade type. + public readonly partial struct NodeImageSelectionType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public NodeImageSelectionType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string LatestValue = "Latest"; + private const string ConsistentValue = "Consistent"; + private const string CustomValue = "Custom"; + + /// Use the latest image version when upgrading nodes. Clusters may use different image versions (e.g., 'AKSUbuntu-1804gen2containerd-2021.10.12' and 'AKSUbuntu-1804gen2containerd-2021.10.19') because, for example, the latest available version is different in different regions. + public static NodeImageSelectionType Latest { get; } = new NodeImageSelectionType(LatestValue); + /// The image versions to upgrade nodes to are selected as described below: for each node pool in managed clusters affected by the update run, the system selects the latest image version such that it is available across all other node pools (in all other clusters) of the same image type. As a result, all node pools of the same image type will be upgraded to the same image version. For example, if the latest image version for image type 'AKSUbuntu-1804gen2containerd' is 'AKSUbuntu-1804gen2containerd-2021.10.12' for a node pool in cluster A in region X, and is 'AKSUbuntu-1804gen2containerd-2021.10.17' for a node pool in cluster B in region Y, the system will upgrade both node pools to image version 'AKSUbuntu-1804gen2containerd-2021.10.12'. + public static NodeImageSelectionType Consistent { get; } = new NodeImageSelectionType(ConsistentValue); + /// Upgrade the nodes to the custom image versions. When set, update run will use node image versions provided in customNodeImageVersions to upgrade the nodes. If set, customNodeImageVersions must not be empty. + public static NodeImageSelectionType Custom { get; } = new NodeImageSelectionType(CustomValue); + /// Determines if two values are the same. + public static bool operator ==(NodeImageSelectionType left, NodeImageSelectionType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(NodeImageSelectionType left, NodeImageSelectionType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator NodeImageSelectionType(string value) => new NodeImageSelectionType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is NodeImageSelectionType other && Equals(other); + /// + public bool Equals(NodeImageSelectionType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/NodeImageVersion.Serialization.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/NodeImageVersion.Serialization.cs new file mode 100644 index 000000000000..fbd8ea949b81 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/NodeImageVersion.Serialization.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + public partial class NodeImageVersion : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NodeImageVersion)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Version)) + { + writer.WritePropertyName("version"u8); + writer.WriteStringValue(Version); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NodeImageVersion IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NodeImageVersion)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNodeImageVersion(document.RootElement, options); + } + + internal static NodeImageVersion DeserializeNodeImageVersion(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string version = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("version"u8)) + { + version = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NodeImageVersion(version, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(NodeImageVersion)} does not support writing '{options.Format}' format."); + } + } + + NodeImageVersion IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNodeImageVersion(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NodeImageVersion)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/NodeImageVersion.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/NodeImageVersion.cs new file mode 100644 index 000000000000..fb3d930628c2 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/NodeImageVersion.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// The node upgrade image version. + public partial class NodeImageVersion + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public NodeImageVersion() + { + } + + /// Initializes a new instance of . + /// The image version to upgrade the nodes to (e.g., 'AKSUbuntu-1804gen2containerd-2022.12.13'). + /// Keeps track of any properties unknown to the library. + internal NodeImageVersion(string version, IDictionary serializedAdditionalRawData) + { + Version = version; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The image version to upgrade the nodes to (e.g., 'AKSUbuntu-1804gen2containerd-2022.12.13'). + public string Version { get; } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/SkipProperties.Serialization.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/SkipProperties.Serialization.cs new file mode 100644 index 000000000000..b200f43b9c81 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/SkipProperties.Serialization.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + public partial class SkipProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SkipProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("targets"u8); + writer.WriteStartArray(); + foreach (var item in Targets) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SkipProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SkipProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSkipProperties(document.RootElement, options); + } + + internal static SkipProperties DeserializeSkipProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList targets = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("targets"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SkipTarget.DeserializeSkipTarget(item, options)); + } + targets = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SkipProperties(targets, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SkipProperties)} does not support writing '{options.Format}' format."); + } + } + + SkipProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSkipProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SkipProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/SkipProperties.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/SkipProperties.cs new file mode 100644 index 000000000000..b25f0d78ae10 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/SkipProperties.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// The properties of a skip operation containing multiple skip requests. + public partial class SkipProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The targets to skip. + /// is null. + public SkipProperties(IEnumerable targets) + { + Argument.AssertNotNull(targets, nameof(targets)); + + Targets = targets.ToList(); + } + + /// Initializes a new instance of . + /// The targets to skip. + /// Keeps track of any properties unknown to the library. + internal SkipProperties(IList targets, IDictionary serializedAdditionalRawData) + { + Targets = targets; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SkipProperties() + { + } + + /// The targets to skip. + public IList Targets { get; } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/SkipTarget.Serialization.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/SkipTarget.Serialization.cs new file mode 100644 index 000000000000..0108b0a48264 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/SkipTarget.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + public partial class SkipTarget : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SkipTarget)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.ToString()); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SkipTarget IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SkipTarget)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSkipTarget(document.RootElement, options); + } + + internal static SkipTarget DeserializeSkipTarget(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + TargetType type = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = new TargetType(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SkipTarget(type, name, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SkipTarget)} does not support writing '{options.Format}' format."); + } + } + + SkipTarget IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSkipTarget(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SkipTarget)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/SkipTarget.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/SkipTarget.cs new file mode 100644 index 000000000000..6a194ace548c --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/SkipTarget.cs @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// The definition of a single skip request. + public partial class SkipTarget + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The skip target type. + /// + /// The skip target's name. + /// To skip a member/group/stage, use the member/group/stage's name; + /// Tp skip an after stage wait, use the parent stage's name. + /// + /// is null. + public SkipTarget(TargetType type, string name) + { + Argument.AssertNotNull(name, nameof(name)); + + Type = type; + Name = name; + } + + /// Initializes a new instance of . + /// The skip target type. + /// + /// The skip target's name. + /// To skip a member/group/stage, use the member/group/stage's name; + /// Tp skip an after stage wait, use the parent stage's name. + /// + /// Keeps track of any properties unknown to the library. + internal SkipTarget(TargetType type, string name, IDictionary serializedAdditionalRawData) + { + Type = type; + Name = name; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SkipTarget() + { + } + + /// The skip target type. + public TargetType Type { get; } + /// + /// The skip target's name. + /// To skip a member/group/stage, use the member/group/stage's name; + /// Tp skip an after stage wait, use the parent stage's name. + /// + public string Name { get; } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/TargetType.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/TargetType.cs new file mode 100644 index 000000000000..22b1ad8d169c --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/TargetType.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// The target type of a skip request. + public readonly partial struct TargetType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public TargetType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string MemberValue = "Member"; + private const string GroupValue = "Group"; + private const string StageValue = "Stage"; + private const string AfterStageWaitValue = "AfterStageWait"; + + /// Skip the update of a member. + public static TargetType Member { get; } = new TargetType(MemberValue); + /// Skip the update of a group. + public static TargetType Group { get; } = new TargetType(GroupValue); + /// Skip the update of an entire stage including the after stage wait. + public static TargetType Stage { get; } = new TargetType(StageValue); + /// Skip the update of the after stage wait of a certain stage. + public static TargetType AfterStageWait { get; } = new TargetType(AfterStageWaitValue); + /// Determines if two values are the same. + public static bool operator ==(TargetType left, TargetType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TargetType left, TargetType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator TargetType(string value) => new TargetType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TargetType other && Equals(other); + /// + public bool Equals(TargetType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateGroup.Serialization.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateGroup.Serialization.cs new file mode 100644 index 000000000000..22f3205ca93e --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateGroup.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + public partial class UpdateGroup : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UpdateGroup)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + UpdateGroup IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UpdateGroup)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUpdateGroup(document.RootElement, options); + } + + internal static UpdateGroup DeserializeUpdateGroup(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UpdateGroup(name, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(UpdateGroup)} does not support writing '{options.Format}' format."); + } + } + + UpdateGroup IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeUpdateGroup(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UpdateGroup)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateGroup.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateGroup.cs new file mode 100644 index 000000000000..740b60e71f8a --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateGroup.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// A group to be updated. + public partial class UpdateGroup + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// + /// Name of the group. + /// It must match a group name of an existing fleet member. + /// + /// is null. + public UpdateGroup(string name) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + } + + /// Initializes a new instance of . + /// + /// Name of the group. + /// It must match a group name of an existing fleet member. + /// + /// Keeps track of any properties unknown to the library. + internal UpdateGroup(string name, IDictionary serializedAdditionalRawData) + { + Name = name; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal UpdateGroup() + { + } + + /// + /// Name of the group. + /// It must match a group name of an existing fleet member. + /// + public string Name { get; set; } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateGroupStatus.Serialization.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateGroupStatus.Serialization.cs new file mode 100644 index 000000000000..29edc8d67c14 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateGroupStatus.Serialization.cs @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + public partial class UpdateGroupStatus : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UpdateGroupStatus)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteObjectValue(Status, options); + } + if (options.Format != "W" && Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && Optional.IsCollectionDefined(Members)) + { + writer.WritePropertyName("members"u8); + writer.WriteStartArray(); + foreach (var item in Members) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + UpdateGroupStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UpdateGroupStatus)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUpdateGroupStatus(document.RootElement, options); + } + + internal static UpdateGroupStatus DeserializeUpdateGroupStatus(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + UpdateStatus status = default; + string name = default; + IReadOnlyList members = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = UpdateStatus.DeserializeUpdateStatus(property.Value, options); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("members"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MemberUpdateStatus.DeserializeMemberUpdateStatus(item, options)); + } + members = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UpdateGroupStatus(status, name, members ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(UpdateGroupStatus)} does not support writing '{options.Format}' format."); + } + } + + UpdateGroupStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeUpdateGroupStatus(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UpdateGroupStatus)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateGroupStatus.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateGroupStatus.cs new file mode 100644 index 000000000000..9010e2b010d1 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateGroupStatus.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// The status of a UpdateGroup. + public partial class UpdateGroupStatus + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal UpdateGroupStatus() + { + Members = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The status of the UpdateGroup. + /// The name of the UpdateGroup. + /// The list of member this UpdateGroup updates. + /// Keeps track of any properties unknown to the library. + internal UpdateGroupStatus(UpdateStatus status, string name, IReadOnlyList members, IDictionary serializedAdditionalRawData) + { + Status = status; + Name = name; + Members = members; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The status of the UpdateGroup. + public UpdateStatus Status { get; } + /// The name of the UpdateGroup. + public string Name { get; } + /// The list of member this UpdateGroup updates. + public IReadOnlyList Members { get; } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateRunListResult.Serialization.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateRunListResult.Serialization.cs new file mode 100644 index 000000000000..365cbf996747 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateRunListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + internal partial class UpdateRunListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UpdateRunListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + UpdateRunListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UpdateRunListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUpdateRunListResult(document.RootElement, options); + } + + internal static UpdateRunListResult DeserializeUpdateRunListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(UpdateRunData.DeserializeUpdateRunData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UpdateRunListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(UpdateRunListResult)} does not support writing '{options.Format}' format."); + } + } + + UpdateRunListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeUpdateRunListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UpdateRunListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateRunListResult.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateRunListResult.cs new file mode 100644 index 000000000000..c120e41c2663 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateRunListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// The response of a UpdateRun list operation. + internal partial class UpdateRunListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The UpdateRun items on this page. + /// is null. + internal UpdateRunListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The UpdateRun items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal UpdateRunListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal UpdateRunListResult() + { + } + + /// The UpdateRun items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateRunProvisioningState.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateRunProvisioningState.cs new file mode 100644 index 000000000000..e10a258bbe53 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateRunProvisioningState.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// The provisioning state of the UpdateRun resource. + public readonly partial struct UpdateRunProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public UpdateRunProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + + /// Resource has been created. + public static UpdateRunProvisioningState Succeeded { get; } = new UpdateRunProvisioningState(SucceededValue); + /// Resource creation failed. + public static UpdateRunProvisioningState Failed { get; } = new UpdateRunProvisioningState(FailedValue); + /// Resource creation was canceled. + public static UpdateRunProvisioningState Canceled { get; } = new UpdateRunProvisioningState(CanceledValue); + /// Determines if two values are the same. + public static bool operator ==(UpdateRunProvisioningState left, UpdateRunProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(UpdateRunProvisioningState left, UpdateRunProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator UpdateRunProvisioningState(string value) => new UpdateRunProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is UpdateRunProvisioningState other && Equals(other); + /// + public bool Equals(UpdateRunProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateRunStatus.Serialization.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateRunStatus.Serialization.cs new file mode 100644 index 000000000000..21590c309cf3 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateRunStatus.Serialization.cs @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + public partial class UpdateRunStatus : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UpdateRunStatus)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteObjectValue(Status, options); + } + if (options.Format != "W" && Optional.IsCollectionDefined(Stages)) + { + writer.WritePropertyName("stages"u8); + writer.WriteStartArray(); + foreach (var item in Stages) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(NodeImageSelection)) + { + writer.WritePropertyName("nodeImageSelection"u8); + writer.WriteObjectValue(NodeImageSelection, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + UpdateRunStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UpdateRunStatus)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUpdateRunStatus(document.RootElement, options); + } + + internal static UpdateRunStatus DeserializeUpdateRunStatus(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + UpdateStatus status = default; + IReadOnlyList stages = default; + NodeImageSelectionStatus nodeImageSelection = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = UpdateStatus.DeserializeUpdateStatus(property.Value, options); + continue; + } + if (property.NameEquals("stages"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(UpdateStageStatus.DeserializeUpdateStageStatus(item, options)); + } + stages = array; + continue; + } + if (property.NameEquals("nodeImageSelection"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nodeImageSelection = NodeImageSelectionStatus.DeserializeNodeImageSelectionStatus(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UpdateRunStatus(status, stages ?? new ChangeTrackingList(), nodeImageSelection, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(UpdateRunStatus)} does not support writing '{options.Format}' format."); + } + } + + UpdateRunStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeUpdateRunStatus(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UpdateRunStatus)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateRunStatus.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateRunStatus.cs new file mode 100644 index 000000000000..e562cb60d035 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateRunStatus.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// The status of a UpdateRun. + public partial class UpdateRunStatus + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal UpdateRunStatus() + { + Stages = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The status of the UpdateRun. + /// The stages composing an update run. Stages are run sequentially withing an UpdateRun. + /// The node image upgrade specs for the update run. It is only set in update run when `NodeImageSelection.type` is `Consistent`. + /// Keeps track of any properties unknown to the library. + internal UpdateRunStatus(UpdateStatus status, IReadOnlyList stages, NodeImageSelectionStatus nodeImageSelection, IDictionary serializedAdditionalRawData) + { + Status = status; + Stages = stages; + NodeImageSelection = nodeImageSelection; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The status of the UpdateRun. + public UpdateStatus Status { get; } + /// The stages composing an update run. Stages are run sequentially withing an UpdateRun. + public IReadOnlyList Stages { get; } + /// The node image upgrade specs for the update run. It is only set in update run when `NodeImageSelection.type` is `Consistent`. + internal NodeImageSelectionStatus NodeImageSelection { get; } + /// The image versions to upgrade the nodes to. + public IReadOnlyList SelectedNodeImageVersions + { + get => NodeImageSelection?.SelectedNodeImageVersions; + } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateRunStrategy.Serialization.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateRunStrategy.Serialization.cs new file mode 100644 index 000000000000..b2c3295a0d5b --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateRunStrategy.Serialization.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + internal partial class UpdateRunStrategy : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UpdateRunStrategy)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("stages"u8); + writer.WriteStartArray(); + foreach (var item in Stages) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + UpdateRunStrategy IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UpdateRunStrategy)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUpdateRunStrategy(document.RootElement, options); + } + + internal static UpdateRunStrategy DeserializeUpdateRunStrategy(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList stages = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("stages"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(UpdateStage.DeserializeUpdateStage(item, options)); + } + stages = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UpdateRunStrategy(stages, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(UpdateRunStrategy)} does not support writing '{options.Format}' format."); + } + } + + UpdateRunStrategy IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeUpdateRunStrategy(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UpdateRunStrategy)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateRunStrategy.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateRunStrategy.cs new file mode 100644 index 000000000000..ffca0513046e --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateRunStrategy.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// + /// Defines the update sequence of the clusters via stages and groups. + /// + /// Stages within a run are executed sequentially one after another. + /// Groups within a stage are executed in parallel. + /// Member clusters within a group are updated sequentially one after another. + /// + /// A valid strategy contains no duplicate groups within or across stages. + /// + internal partial class UpdateRunStrategy + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The list of stages that compose this update run. Min size: 1. + /// is null. + public UpdateRunStrategy(IEnumerable stages) + { + Argument.AssertNotNull(stages, nameof(stages)); + + Stages = stages.ToList(); + } + + /// Initializes a new instance of . + /// The list of stages that compose this update run. Min size: 1. + /// Keeps track of any properties unknown to the library. + internal UpdateRunStrategy(IList stages, IDictionary serializedAdditionalRawData) + { + Stages = stages; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal UpdateRunStrategy() + { + } + + /// The list of stages that compose this update run. Min size: 1. + public IList Stages { get; } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateStage.Serialization.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateStage.Serialization.cs new file mode 100644 index 000000000000..2dd6fa3067d3 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateStage.Serialization.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + public partial class UpdateStage : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UpdateStage)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (Optional.IsCollectionDefined(Groups)) + { + writer.WritePropertyName("groups"u8); + writer.WriteStartArray(); + foreach (var item in Groups) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(AfterStageWaitInSeconds)) + { + writer.WritePropertyName("afterStageWaitInSeconds"u8); + writer.WriteNumberValue(AfterStageWaitInSeconds.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + UpdateStage IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UpdateStage)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUpdateStage(document.RootElement, options); + } + + internal static UpdateStage DeserializeUpdateStage(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + IList groups = default; + int? afterStageWaitInSeconds = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("groups"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(UpdateGroup.DeserializeUpdateGroup(item, options)); + } + groups = array; + continue; + } + if (property.NameEquals("afterStageWaitInSeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + afterStageWaitInSeconds = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UpdateStage(name, groups ?? new ChangeTrackingList(), afterStageWaitInSeconds, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(UpdateStage)} does not support writing '{options.Format}' format."); + } + } + + UpdateStage IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeUpdateStage(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UpdateStage)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateStage.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateStage.cs new file mode 100644 index 000000000000..36a68afa3c59 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateStage.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// Defines a stage which contains the groups to update and the steps to take (e.g., wait for a time period) before starting the next stage. + public partial class UpdateStage + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The name of the stage. Must be unique within the UpdateRun. + /// is null. + public UpdateStage(string name) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + Groups = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The name of the stage. Must be unique within the UpdateRun. + /// Defines the groups to be executed in parallel in this stage. Duplicate groups are not allowed. Min size: 1. + /// The time in seconds to wait at the end of this stage before starting the next one. Defaults to 0 seconds if unspecified. + /// Keeps track of any properties unknown to the library. + internal UpdateStage(string name, IList groups, int? afterStageWaitInSeconds, IDictionary serializedAdditionalRawData) + { + Name = name; + Groups = groups; + AfterStageWaitInSeconds = afterStageWaitInSeconds; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal UpdateStage() + { + } + + /// The name of the stage. Must be unique within the UpdateRun. + public string Name { get; set; } + /// Defines the groups to be executed in parallel in this stage. Duplicate groups are not allowed. Min size: 1. + public IList Groups { get; } + /// The time in seconds to wait at the end of this stage before starting the next one. Defaults to 0 seconds if unspecified. + public int? AfterStageWaitInSeconds { get; set; } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateStageStatus.Serialization.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateStageStatus.Serialization.cs new file mode 100644 index 000000000000..43a71d1c0ee3 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateStageStatus.Serialization.cs @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + public partial class UpdateStageStatus : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UpdateStageStatus)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteObjectValue(Status, options); + } + if (options.Format != "W" && Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && Optional.IsCollectionDefined(Groups)) + { + writer.WritePropertyName("groups"u8); + writer.WriteStartArray(); + foreach (var item in Groups) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(AfterStageWaitStatus)) + { + writer.WritePropertyName("afterStageWaitStatus"u8); + writer.WriteObjectValue(AfterStageWaitStatus, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + UpdateStageStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UpdateStageStatus)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUpdateStageStatus(document.RootElement, options); + } + + internal static UpdateStageStatus DeserializeUpdateStageStatus(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + UpdateStatus status = default; + string name = default; + IReadOnlyList groups = default; + WaitStatus afterStageWaitStatus = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = UpdateStatus.DeserializeUpdateStatus(property.Value, options); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("groups"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(UpdateGroupStatus.DeserializeUpdateGroupStatus(item, options)); + } + groups = array; + continue; + } + if (property.NameEquals("afterStageWaitStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + afterStageWaitStatus = WaitStatus.DeserializeWaitStatus(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UpdateStageStatus(status, name, groups ?? new ChangeTrackingList(), afterStageWaitStatus, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(UpdateStageStatus)} does not support writing '{options.Format}' format."); + } + } + + UpdateStageStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeUpdateStageStatus(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UpdateStageStatus)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateStageStatus.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateStageStatus.cs new file mode 100644 index 000000000000..e62d456a6f5b --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateStageStatus.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// The status of a UpdateStage. + public partial class UpdateStageStatus + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal UpdateStageStatus() + { + Groups = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The status of the UpdateStage. + /// The name of the UpdateStage. + /// The list of groups to be updated as part of this UpdateStage. + /// The status of the wait period configured on the UpdateStage. + /// Keeps track of any properties unknown to the library. + internal UpdateStageStatus(UpdateStatus status, string name, IReadOnlyList groups, WaitStatus afterStageWaitStatus, IDictionary serializedAdditionalRawData) + { + Status = status; + Name = name; + Groups = groups; + AfterStageWaitStatus = afterStageWaitStatus; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The status of the UpdateStage. + public UpdateStatus Status { get; } + /// The name of the UpdateStage. + public string Name { get; } + /// The list of groups to be updated as part of this UpdateStage. + public IReadOnlyList Groups { get; } + /// The status of the wait period configured on the UpdateStage. + public WaitStatus AfterStageWaitStatus { get; } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateState.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateState.cs new file mode 100644 index 000000000000..028a1587f24b --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateState.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// The state of the UpdateRun, UpdateStage, UpdateGroup, or MemberUpdate. + public readonly partial struct UpdateState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public UpdateState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NotStartedValue = "NotStarted"; + private const string RunningValue = "Running"; + private const string StoppingValue = "Stopping"; + private const string StoppedValue = "Stopped"; + private const string SkippedValue = "Skipped"; + private const string FailedValue = "Failed"; + private const string CompletedValue = "Completed"; + + /// The state of an UpdateRun/UpdateStage/UpdateGroup/MemberUpdate that has not been started. + public static UpdateState NotStarted { get; } = new UpdateState(NotStartedValue); + /// The state of an UpdateRun/UpdateStage/UpdateGroup/MemberUpdate that is running. + public static UpdateState Running { get; } = new UpdateState(RunningValue); + /// The state of an UpdateRun/UpdateStage/UpdateGroup/MemberUpdate that is being stopped. + public static UpdateState Stopping { get; } = new UpdateState(StoppingValue); + /// The state of an UpdateRun/UpdateStage/UpdateGroup/MemberUpdate that has stopped. + public static UpdateState Stopped { get; } = new UpdateState(StoppedValue); + /// The state of an UpdateRun/UpdateStage/UpdateGroup/MemberUpdate that has been skipped. + public static UpdateState Skipped { get; } = new UpdateState(SkippedValue); + /// The state of an UpdateRun/UpdateStage/UpdateGroup/MemberUpdate that has failed. + public static UpdateState Failed { get; } = new UpdateState(FailedValue); + /// The state of an UpdateRun/UpdateStage/UpdateGroup/MemberUpdate that has completed. + public static UpdateState Completed { get; } = new UpdateState(CompletedValue); + /// Determines if two values are the same. + public static bool operator ==(UpdateState left, UpdateState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(UpdateState left, UpdateState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator UpdateState(string value) => new UpdateState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is UpdateState other && Equals(other); + /// + public bool Equals(UpdateState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateStatus.Serialization.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateStatus.Serialization.cs new file mode 100644 index 000000000000..e5cc72a19073 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateStatus.Serialization.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + public partial class UpdateStatus : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UpdateStatus)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(StartOn)) + { + writer.WritePropertyName("startTime"u8); + writer.WriteStringValue(StartOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(CompletedOn)) + { + writer.WritePropertyName("completedTime"u8); + writer.WriteStringValue(CompletedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(State)) + { + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + JsonSerializer.Serialize(writer, Error); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + UpdateStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UpdateStatus)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUpdateStatus(document.RootElement, options); + } + + internal static UpdateStatus DeserializeUpdateStatus(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset? startTime = default; + DateTimeOffset? completedTime = default; + UpdateState? state = default; + ResponseError error = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("startTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("completedTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + completedTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("state"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + state = new UpdateState(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + error = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UpdateStatus(startTime, completedTime, state, error, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(UpdateStatus)} does not support writing '{options.Format}' format."); + } + } + + UpdateStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeUpdateStatus(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UpdateStatus)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateStatus.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateStatus.cs new file mode 100644 index 000000000000..34d6a24f90eb --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpdateStatus.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// The status for an operation or group of operations. + public partial class UpdateStatus + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal UpdateStatus() + { + } + + /// Initializes a new instance of . + /// The time the operation or group was started. + /// The time the operation or group was completed. + /// The State of the operation or group. + /// The error details when a failure is encountered. + /// Keeps track of any properties unknown to the library. + internal UpdateStatus(DateTimeOffset? startOn, DateTimeOffset? completedOn, UpdateState? state, ResponseError error, IDictionary serializedAdditionalRawData) + { + StartOn = startOn; + CompletedOn = completedOn; + State = state; + Error = error; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The time the operation or group was started. + public DateTimeOffset? StartOn { get; } + /// The time the operation or group was completed. + public DateTimeOffset? CompletedOn { get; } + /// The State of the operation or group. + public UpdateState? State { get; } + /// The error details when a failure is encountered. + public ResponseError Error { get; } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpgradeChannel.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpgradeChannel.cs new file mode 100644 index 000000000000..3ec3fa494c26 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpgradeChannel.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// Configuration of how auto upgrade will be run. + public readonly partial struct UpgradeChannel : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public UpgradeChannel(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string StableValue = "Stable"; + private const string RapidValue = "Rapid"; + private const string NodeImageValue = "NodeImage"; + + /// + /// Upgrades the clusters kubernetes version to the latest supported patch release on minor version N-1, where N is the latest supported minor version. + /// For example, if a cluster runs version 1.17.7 and versions 1.17.9, 1.18.4, 1.18.6, and 1.19.1 are available, the cluster upgrades to 1.18.6. + /// + public static UpgradeChannel Stable { get; } = new UpgradeChannel(StableValue); + /// Upgrades the clusters kubernetes version to the latest supported patch release on the latest supported minor version. + public static UpgradeChannel Rapid { get; } = new UpgradeChannel(RapidValue); + /// Upgrade node image version of the clusters. + public static UpgradeChannel NodeImage { get; } = new UpgradeChannel(NodeImageValue); + /// Determines if two values are the same. + public static bool operator ==(UpgradeChannel left, UpgradeChannel right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(UpgradeChannel left, UpgradeChannel right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator UpgradeChannel(string value) => new UpgradeChannel(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is UpgradeChannel other && Equals(other); + /// + public bool Equals(UpgradeChannel other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/WaitStatus.Serialization.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/WaitStatus.Serialization.cs new file mode 100644 index 000000000000..41db87b389be --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/WaitStatus.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + public partial class WaitStatus : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WaitStatus)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteObjectValue(Status, options); + } + if (options.Format != "W" && Optional.IsDefined(WaitDurationInSeconds)) + { + writer.WritePropertyName("waitDurationInSeconds"u8); + writer.WriteNumberValue(WaitDurationInSeconds.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + WaitStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WaitStatus)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWaitStatus(document.RootElement, options); + } + + internal static WaitStatus DeserializeWaitStatus(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + UpdateStatus status = default; + int? waitDurationInSeconds = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = UpdateStatus.DeserializeUpdateStatus(property.Value, options); + continue; + } + if (property.NameEquals("waitDurationInSeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + waitDurationInSeconds = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new WaitStatus(status, waitDurationInSeconds, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(WaitStatus)} does not support writing '{options.Format}' format."); + } + } + + WaitStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeWaitStatus(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(WaitStatus)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/WaitStatus.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/WaitStatus.cs new file mode 100644 index 000000000000..7078bfe992dc --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/WaitStatus.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// The status of the wait duration. + public partial class WaitStatus + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal WaitStatus() + { + } + + /// Initializes a new instance of . + /// The status of the wait duration. + /// The wait duration configured in seconds. + /// Keeps track of any properties unknown to the library. + internal WaitStatus(UpdateStatus status, int? waitDurationInSeconds, IDictionary serializedAdditionalRawData) + { + Status = status; + WaitDurationInSeconds = waitDurationInSeconds; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The status of the wait duration. + public UpdateStatus Status { get; } + /// The wait duration configured in seconds. + public int? WaitDurationInSeconds { get; } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ProviderConstants.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ProviderConstants.cs new file mode 100644 index 000000000000..ee749ff5d1a6 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ProviderConstants.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + internal static class ProviderConstants + { + public static string DefaultProviderNamespace { get; } = ClientDiagnostics.GetResourceProviderNamespace(typeof(ProviderConstants).Assembly); + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/AutoUpgradeProfileRestOperations.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/AutoUpgradeProfileRestOperations.cs new file mode 100644 index 000000000000..503d38cf0aa5 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/AutoUpgradeProfileRestOperations.cs @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + internal partial class AutoUpgradeProfileRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of AutoUpgradeProfileRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public AutoUpgradeProfileRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGenerateUpdateRunRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string autoUpgradeProfileName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/autoUpgradeProfiles/", false); + uri.AppendPath(autoUpgradeProfileName, true); + uri.AppendPath("/generateUpdateRun", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGenerateUpdateRunRequest(string subscriptionId, string resourceGroupName, string fleetName, string autoUpgradeProfileName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/autoUpgradeProfiles/", false); + uri.AppendPath(autoUpgradeProfileName, true); + uri.AppendPath("/generateUpdateRun", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Generates an update run for a given auto upgrade profile. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the AutoUpgradeProfile resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task GenerateUpdateRunAsync(string subscriptionId, string resourceGroupName, string fleetName, string autoUpgradeProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(autoUpgradeProfileName, nameof(autoUpgradeProfileName)); + + using var message = CreateGenerateUpdateRunRequest(subscriptionId, resourceGroupName, fleetName, autoUpgradeProfileName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Generates an update run for a given auto upgrade profile. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the AutoUpgradeProfile resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response GenerateUpdateRun(string subscriptionId, string resourceGroupName, string fleetName, string autoUpgradeProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(autoUpgradeProfileName, nameof(autoUpgradeProfileName)); + + using var message = CreateGenerateUpdateRunRequest(subscriptionId, resourceGroupName, fleetName, autoUpgradeProfileName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/AutoUpgradeProfilesRestOperations.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/AutoUpgradeProfilesRestOperations.cs new file mode 100644 index 000000000000..b159b8464295 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/AutoUpgradeProfilesRestOperations.cs @@ -0,0 +1,531 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ContainerServiceFleet.Models; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + internal partial class AutoUpgradeProfilesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of AutoUpgradeProfilesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public AutoUpgradeProfilesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string autoUpgradeProfileName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/autoUpgradeProfiles/", false); + uri.AppendPath(autoUpgradeProfileName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string fleetName, string autoUpgradeProfileName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/autoUpgradeProfiles/", false); + uri.AppendPath(autoUpgradeProfileName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a AutoUpgradeProfile. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the AutoUpgradeProfile resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string fleetName, string autoUpgradeProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(autoUpgradeProfileName, nameof(autoUpgradeProfileName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, autoUpgradeProfileName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AutoUpgradeProfileData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = AutoUpgradeProfileData.DeserializeAutoUpgradeProfileData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AutoUpgradeProfileData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a AutoUpgradeProfile. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the AutoUpgradeProfile resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string fleetName, string autoUpgradeProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(autoUpgradeProfileName, nameof(autoUpgradeProfileName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, autoUpgradeProfileName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AutoUpgradeProfileData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = AutoUpgradeProfileData.DeserializeAutoUpgradeProfileData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AutoUpgradeProfileData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string autoUpgradeProfileName, AutoUpgradeProfileData data, string ifMatch, string ifNoneMatch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/autoUpgradeProfiles/", false); + uri.AppendPath(autoUpgradeProfileName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string fleetName, string autoUpgradeProfileName, AutoUpgradeProfileData data, string ifMatch, string ifNoneMatch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/autoUpgradeProfiles/", false); + uri.AppendPath(autoUpgradeProfileName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + if (ifNoneMatch != null) + { + request.Headers.Add("If-None-Match", ifNoneMatch); + } + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a AutoUpgradeProfile. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the AutoUpgradeProfile resource. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string fleetName, string autoUpgradeProfileName, AutoUpgradeProfileData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(autoUpgradeProfileName, nameof(autoUpgradeProfileName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, autoUpgradeProfileName, data, ifMatch, ifNoneMatch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a AutoUpgradeProfile. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the AutoUpgradeProfile resource. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string fleetName, string autoUpgradeProfileName, AutoUpgradeProfileData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(autoUpgradeProfileName, nameof(autoUpgradeProfileName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, autoUpgradeProfileName, data, ifMatch, ifNoneMatch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string autoUpgradeProfileName, string ifMatch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/autoUpgradeProfiles/", false); + uri.AppendPath(autoUpgradeProfileName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string fleetName, string autoUpgradeProfileName, string ifMatch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/autoUpgradeProfiles/", false); + uri.AppendPath(autoUpgradeProfileName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a AutoUpgradeProfile. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the AutoUpgradeProfile resource. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string fleetName, string autoUpgradeProfileName, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(autoUpgradeProfileName, nameof(autoUpgradeProfileName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, autoUpgradeProfileName, ifMatch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a AutoUpgradeProfile. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the AutoUpgradeProfile resource. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string fleetName, string autoUpgradeProfileName, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(autoUpgradeProfileName, nameof(autoUpgradeProfileName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, autoUpgradeProfileName, ifMatch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByFleetRequestUri(string subscriptionId, string resourceGroupName, string fleetName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/autoUpgradeProfiles", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByFleetRequest(string subscriptionId, string resourceGroupName, string fleetName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/autoUpgradeProfiles", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AutoUpgradeProfile resources by Fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByFleetAsync(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetRequest(subscriptionId, resourceGroupName, fleetName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AutoUpgradeProfileListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = AutoUpgradeProfileListResult.DeserializeAutoUpgradeProfileListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AutoUpgradeProfile resources by Fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByFleet(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetRequest(subscriptionId, resourceGroupName, fleetName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AutoUpgradeProfileListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = AutoUpgradeProfileListResult.DeserializeAutoUpgradeProfileListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByFleetNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string fleetName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByFleetNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string fleetName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AutoUpgradeProfile resources by Fleet. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByFleetNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AutoUpgradeProfileListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = AutoUpgradeProfileListResult.DeserializeAutoUpgradeProfileListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AutoUpgradeProfile resources by Fleet. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByFleetNextPage(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AutoUpgradeProfileListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = AutoUpgradeProfileListResult.DeserializeAutoUpgradeProfileListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/FleetMembersRestOperations.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/FleetMembersRestOperations.cs new file mode 100644 index 000000000000..2c513a79a60f --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/FleetMembersRestOperations.cs @@ -0,0 +1,639 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ContainerServiceFleet.Models; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + internal partial class FleetMembersRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of FleetMembersRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public FleetMembersRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetMemberName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/members/", false); + uri.AppendPath(fleetMemberName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetMemberName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/members/", false); + uri.AppendPath(fleetMemberName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a FleetMember. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the Fleet member resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetMemberName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetMemberName, nameof(fleetMemberName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, fleetMemberName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetMemberData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetMemberData.DeserializeFleetMemberData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FleetMemberData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a FleetMember. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the Fleet member resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string fleetName, string fleetMemberName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetMemberName, nameof(fleetMemberName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, fleetMemberName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetMemberData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetMemberData.DeserializeFleetMemberData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FleetMemberData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetMemberName, FleetMemberData data, string ifMatch, string ifNoneMatch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/members/", false); + uri.AppendPath(fleetMemberName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetMemberName, FleetMemberData data, string ifMatch, string ifNoneMatch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/members/", false); + uri.AppendPath(fleetMemberName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + if (ifNoneMatch != null) + { + request.Headers.Add("If-None-Match", ifNoneMatch); + } + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a FleetMember. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the Fleet member resource. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetMemberName, FleetMemberData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetMemberName, nameof(fleetMemberName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, fleetName, fleetMemberName, data, ifMatch, ifNoneMatch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a FleetMember. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the Fleet member resource. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string fleetName, string fleetMemberName, FleetMemberData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetMemberName, nameof(fleetMemberName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, fleetName, fleetMemberName, data, ifMatch, ifNoneMatch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateAsyncRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetMemberName, FleetMemberPatch patch, string ifMatch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/members/", false); + uri.AppendPath(fleetMemberName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateAsyncRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetMemberName, FleetMemberPatch patch, string ifMatch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/members/", false); + uri.AppendPath(fleetMemberName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update a FleetMember. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the Fleet member resource. + /// The resource properties to be updated. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsyncAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetMemberName, FleetMemberPatch patch, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetMemberName, nameof(fleetMemberName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateAsyncRequest(subscriptionId, resourceGroupName, fleetName, fleetMemberName, patch, ifMatch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update a FleetMember. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the Fleet member resource. + /// The resource properties to be updated. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response UpdateAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetMemberName, FleetMemberPatch patch, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetMemberName, nameof(fleetMemberName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateAsyncRequest(subscriptionId, resourceGroupName, fleetName, fleetMemberName, patch, ifMatch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetMemberName, string ifMatch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/members/", false); + uri.AppendPath(fleetMemberName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetMemberName, string ifMatch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/members/", false); + uri.AppendPath(fleetMemberName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a FleetMember. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the Fleet member resource. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetMemberName, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetMemberName, nameof(fleetMemberName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, fleetMemberName, ifMatch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a FleetMember. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the Fleet member resource. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string fleetName, string fleetMemberName, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetMemberName, nameof(fleetMemberName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, fleetMemberName, ifMatch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByFleetRequestUri(string subscriptionId, string resourceGroupName, string fleetName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/members", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByFleetRequest(string subscriptionId, string resourceGroupName, string fleetName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/members", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List FleetMember resources by Fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByFleetAsync(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetRequest(subscriptionId, resourceGroupName, fleetName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetMemberListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetMemberListResult.DeserializeFleetMemberListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List FleetMember resources by Fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByFleet(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetRequest(subscriptionId, resourceGroupName, fleetName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetMemberListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetMemberListResult.DeserializeFleetMemberListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByFleetNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string fleetName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByFleetNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string fleetName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List FleetMember resources by Fleet. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByFleetNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetMemberListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetMemberListResult.DeserializeFleetMemberListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List FleetMember resources by Fleet. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByFleetNextPage(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetMemberListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetMemberListResult.DeserializeFleetMemberListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/FleetUpdateStrategiesRestOperations.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/FleetUpdateStrategiesRestOperations.cs new file mode 100644 index 000000000000..3122501b14a4 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/FleetUpdateStrategiesRestOperations.cs @@ -0,0 +1,533 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ContainerServiceFleet.Models; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + internal partial class FleetUpdateStrategiesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of FleetUpdateStrategiesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public FleetUpdateStrategiesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string updateStrategyName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateStrategies/", false); + uri.AppendPath(updateStrategyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string fleetName, string updateStrategyName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateStrategies/", false); + uri.AppendPath(updateStrategyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a FleetUpdateStrategy. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the UpdateStrategy resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string fleetName, string updateStrategyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateStrategyName, nameof(updateStrategyName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, updateStrategyName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetUpdateStrategyData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetUpdateStrategyData.DeserializeFleetUpdateStrategyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FleetUpdateStrategyData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a FleetUpdateStrategy. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the UpdateStrategy resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string fleetName, string updateStrategyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateStrategyName, nameof(updateStrategyName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, updateStrategyName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetUpdateStrategyData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetUpdateStrategyData.DeserializeFleetUpdateStrategyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FleetUpdateStrategyData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string updateStrategyName, FleetUpdateStrategyData data, string ifMatch, string ifNoneMatch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateStrategies/", false); + uri.AppendPath(updateStrategyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string fleetName, string updateStrategyName, FleetUpdateStrategyData data, string ifMatch, string ifNoneMatch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateStrategies/", false); + uri.AppendPath(updateStrategyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + if (ifNoneMatch != null) + { + request.Headers.Add("If-None-Match", ifNoneMatch); + } + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a FleetUpdateStrategy. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the UpdateStrategy resource. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string fleetName, string updateStrategyName, FleetUpdateStrategyData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateStrategyName, nameof(updateStrategyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, updateStrategyName, data, ifMatch, ifNoneMatch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a FleetUpdateStrategy. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the UpdateStrategy resource. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string fleetName, string updateStrategyName, FleetUpdateStrategyData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateStrategyName, nameof(updateStrategyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, updateStrategyName, data, ifMatch, ifNoneMatch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string updateStrategyName, string ifMatch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateStrategies/", false); + uri.AppendPath(updateStrategyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string fleetName, string updateStrategyName, string ifMatch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateStrategies/", false); + uri.AppendPath(updateStrategyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a FleetUpdateStrategy. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the UpdateStrategy resource. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string fleetName, string updateStrategyName, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateStrategyName, nameof(updateStrategyName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, updateStrategyName, ifMatch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a FleetUpdateStrategy. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the UpdateStrategy resource. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string fleetName, string updateStrategyName, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateStrategyName, nameof(updateStrategyName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, updateStrategyName, ifMatch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByFleetRequestUri(string subscriptionId, string resourceGroupName, string fleetName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateStrategies", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByFleetRequest(string subscriptionId, string resourceGroupName, string fleetName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateStrategies", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List FleetUpdateStrategy resources by Fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByFleetAsync(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetRequest(subscriptionId, resourceGroupName, fleetName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetUpdateStrategyListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetUpdateStrategyListResult.DeserializeFleetUpdateStrategyListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List FleetUpdateStrategy resources by Fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByFleet(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetRequest(subscriptionId, resourceGroupName, fleetName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetUpdateStrategyListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetUpdateStrategyListResult.DeserializeFleetUpdateStrategyListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByFleetNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string fleetName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByFleetNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string fleetName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List FleetUpdateStrategy resources by Fleet. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByFleetNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetUpdateStrategyListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetUpdateStrategyListResult.DeserializeFleetUpdateStrategyListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List FleetUpdateStrategy resources by Fleet. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByFleetNextPage(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetUpdateStrategyListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetUpdateStrategyListResult.DeserializeFleetUpdateStrategyListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/FleetsRestOperations.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/FleetsRestOperations.cs new file mode 100644 index 000000000000..1658b2b7a6c7 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/FleetsRestOperations.cs @@ -0,0 +1,843 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ContainerServiceFleet.Models; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + internal partial class FleetsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of FleetsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public FleetsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string fleetName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string fleetName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets a Fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetData.DeserializeFleetData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FleetData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets a Fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetData.DeserializeFleetData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FleetData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string fleetName, FleetData data, string ifMatch, string ifNoneMatch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string fleetName, FleetData data, string ifMatch, string ifNoneMatch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + if (ifNoneMatch != null) + { + request.Headers.Add("If-None-Match", ifNoneMatch); + } + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates or updates a Fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string fleetName, FleetData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, fleetName, data, ifMatch, ifNoneMatch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates or updates a Fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string fleetName, FleetData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, fleetName, data, ifMatch, ifNoneMatch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateAsyncRequestUri(string subscriptionId, string resourceGroupName, string fleetName, FleetPatch patch, string ifMatch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateAsyncRequest(string subscriptionId, string resourceGroupName, string fleetName, FleetPatch patch, string ifMatch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update a Fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The resource properties to be updated. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsyncAsync(string subscriptionId, string resourceGroupName, string fleetName, FleetPatch patch, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateAsyncRequest(subscriptionId, resourceGroupName, fleetName, patch, ifMatch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update a Fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The resource properties to be updated. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response UpdateAsync(string subscriptionId, string resourceGroupName, string fleetName, FleetPatch patch, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateAsyncRequest(subscriptionId, resourceGroupName, fleetName, patch, ifMatch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string ifMatch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string fleetName, string ifMatch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a Fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string fleetName, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, ifMatch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a Fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string fleetName, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, ifMatch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists fleets in the specified subscription and resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists fleets in the specified subscription and resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists fleets in the specified subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists fleets in the specified subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListCredentialsRequestUri(string subscriptionId, string resourceGroupName, string fleetName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/listCredentials", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListCredentialsRequest(string subscriptionId, string resourceGroupName, string fleetName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/listCredentials", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists the user credentials of a Fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListCredentialsAsync(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListCredentialsRequest(subscriptionId, resourceGroupName, fleetName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetCredentialResults value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetCredentialResults.DeserializeFleetCredentialResults(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists the user credentials of a Fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListCredentials(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListCredentialsRequest(subscriptionId, resourceGroupName, fleetName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetCredentialResults value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetCredentialResults.DeserializeFleetCredentialResults(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists fleets in the specified subscription and resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists fleets in the specified subscription and resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists fleets in the specified subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists fleets in the specified subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/UpdateRunsRestOperations.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/UpdateRunsRestOperations.cs new file mode 100644 index 000000000000..8c2b7b176d95 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/UpdateRunsRestOperations.cs @@ -0,0 +1,841 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ContainerServiceFleet.Models; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + internal partial class UpdateRunsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of UpdateRunsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public UpdateRunsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateRuns/", false); + uri.AppendPath(updateRunName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateRuns/", false); + uri.AppendPath(updateRunName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a UpdateRun. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the UpdateRun resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, updateRunName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + UpdateRunData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = UpdateRunData.DeserializeUpdateRunData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((UpdateRunData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a UpdateRun. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the UpdateRun resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, updateRunName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + UpdateRunData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = UpdateRunData.DeserializeUpdateRunData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((UpdateRunData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, UpdateRunData data, string ifMatch, string ifNoneMatch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateRuns/", false); + uri.AppendPath(updateRunName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, UpdateRunData data, string ifMatch, string ifNoneMatch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateRuns/", false); + uri.AppendPath(updateRunName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + if (ifNoneMatch != null) + { + request.Headers.Add("If-None-Match", ifNoneMatch); + } + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a UpdateRun. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the UpdateRun resource. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, UpdateRunData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, updateRunName, data, ifMatch, ifNoneMatch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a UpdateRun. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the UpdateRun resource. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, UpdateRunData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, updateRunName, data, ifMatch, ifNoneMatch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, string ifMatch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateRuns/", false); + uri.AppendPath(updateRunName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, string ifMatch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateRuns/", false); + uri.AppendPath(updateRunName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a UpdateRun. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the UpdateRun resource. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, updateRunName, ifMatch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a UpdateRun. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the UpdateRun resource. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, updateRunName, ifMatch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByFleetRequestUri(string subscriptionId, string resourceGroupName, string fleetName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateRuns", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByFleetRequest(string subscriptionId, string resourceGroupName, string fleetName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateRuns", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List UpdateRun resources by Fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByFleetAsync(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetRequest(subscriptionId, resourceGroupName, fleetName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + UpdateRunListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = UpdateRunListResult.DeserializeUpdateRunListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List UpdateRun resources by Fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByFleet(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetRequest(subscriptionId, resourceGroupName, fleetName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + UpdateRunListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = UpdateRunListResult.DeserializeUpdateRunListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateStartRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, string ifMatch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateRuns/", false); + uri.AppendPath(updateRunName, true); + uri.AppendPath("/start", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateStartRequest(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, string ifMatch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateRuns/", false); + uri.AppendPath(updateRunName, true); + uri.AppendPath("/start", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Starts an UpdateRun. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the UpdateRun resource. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task StartAsync(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); + + using var message = CreateStartRequest(subscriptionId, resourceGroupName, fleetName, updateRunName, ifMatch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Starts an UpdateRun. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the UpdateRun resource. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Start(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); + + using var message = CreateStartRequest(subscriptionId, resourceGroupName, fleetName, updateRunName, ifMatch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateStopRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, string ifMatch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateRuns/", false); + uri.AppendPath(updateRunName, true); + uri.AppendPath("/stop", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateStopRequest(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, string ifMatch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateRuns/", false); + uri.AppendPath(updateRunName, true); + uri.AppendPath("/stop", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Stops an UpdateRun. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the UpdateRun resource. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task StopAsync(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); + + using var message = CreateStopRequest(subscriptionId, resourceGroupName, fleetName, updateRunName, ifMatch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Stops an UpdateRun. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the UpdateRun resource. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Stop(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); + + using var message = CreateStopRequest(subscriptionId, resourceGroupName, fleetName, updateRunName, ifMatch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateSkipRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, SkipProperties body, string ifMatch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateRuns/", false); + uri.AppendPath(updateRunName, true); + uri.AppendPath("/skip", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateSkipRequest(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, SkipProperties body, string ifMatch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateRuns/", false); + uri.AppendPath(updateRunName, true); + uri.AppendPath("/skip", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(body, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Skips one or a combination of member/group/stage/afterStageWait(s) of an update run. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the UpdateRun resource. + /// The content of the action request. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task SkipAsync(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, SkipProperties body, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateSkipRequest(subscriptionId, resourceGroupName, fleetName, updateRunName, body, ifMatch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Skips one or a combination of member/group/stage/afterStageWait(s) of an update run. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the UpdateRun resource. + /// The content of the action request. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Skip(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, SkipProperties body, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateSkipRequest(subscriptionId, resourceGroupName, fleetName, updateRunName, body, ifMatch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByFleetNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string fleetName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByFleetNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string fleetName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List UpdateRun resources by Fleet. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByFleetNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + UpdateRunListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = UpdateRunListResult.DeserializeUpdateRunListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List UpdateRun resources by Fleet. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByFleetNextPage(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + UpdateRunListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = UpdateRunListResult.DeserializeUpdateRunListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/UpdateRunCollection.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/UpdateRunCollection.cs new file mode 100644 index 000000000000..d9d85fce2ea3 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/UpdateRunCollection.cs @@ -0,0 +1,497 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetUpdateRuns method from an instance of . + /// + public partial class UpdateRunCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _updateRunClientDiagnostics; + private readonly UpdateRunsRestOperations _updateRunRestClient; + + /// Initializes a new instance of the class for mocking. + protected UpdateRunCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal UpdateRunCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _updateRunClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerServiceFleet", UpdateRunResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(UpdateRunResource.ResourceType, out string updateRunApiVersion); + _updateRunRestClient = new UpdateRunsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, updateRunApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != FleetResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, FleetResource.ResourceType), nameof(id)); + } + + /// + /// Create a UpdateRun + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName} + /// + /// + /// Operation Id + /// UpdateRun_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the UpdateRun resource. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string updateRunName, UpdateRunData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _updateRunClientDiagnostics.CreateScope("UpdateRunCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _updateRunRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateRunName, data, ifMatch, ifNoneMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceFleetArmOperation(new UpdateRunOperationSource(Client), _updateRunClientDiagnostics, Pipeline, _updateRunRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateRunName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a UpdateRun + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName} + /// + /// + /// Operation Id + /// UpdateRun_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the UpdateRun resource. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string updateRunName, UpdateRunData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _updateRunClientDiagnostics.CreateScope("UpdateRunCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _updateRunRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateRunName, data, ifMatch, ifNoneMatch, cancellationToken); + var operation = new ContainerServiceFleetArmOperation(new UpdateRunOperationSource(Client), _updateRunClientDiagnostics, Pipeline, _updateRunRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateRunName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a UpdateRun + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName} + /// + /// + /// Operation Id + /// UpdateRun_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the UpdateRun resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string updateRunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); + + using var scope = _updateRunClientDiagnostics.CreateScope("UpdateRunCollection.Get"); + scope.Start(); + try + { + var response = await _updateRunRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateRunName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new UpdateRunResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a UpdateRun + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName} + /// + /// + /// Operation Id + /// UpdateRun_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the UpdateRun resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string updateRunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); + + using var scope = _updateRunClientDiagnostics.CreateScope("UpdateRunCollection.Get"); + scope.Start(); + try + { + var response = _updateRunRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateRunName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new UpdateRunResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List UpdateRun resources by Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns + /// + /// + /// Operation Id + /// UpdateRun_ListByFleet + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _updateRunRestClient.CreateListByFleetRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _updateRunRestClient.CreateListByFleetNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new UpdateRunResource(Client, UpdateRunData.DeserializeUpdateRunData(e)), _updateRunClientDiagnostics, Pipeline, "UpdateRunCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List UpdateRun resources by Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns + /// + /// + /// Operation Id + /// UpdateRun_ListByFleet + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _updateRunRestClient.CreateListByFleetRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _updateRunRestClient.CreateListByFleetNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new UpdateRunResource(Client, UpdateRunData.DeserializeUpdateRunData(e)), _updateRunClientDiagnostics, Pipeline, "UpdateRunCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName} + /// + /// + /// Operation Id + /// UpdateRun_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the UpdateRun resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string updateRunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); + + using var scope = _updateRunClientDiagnostics.CreateScope("UpdateRunCollection.Exists"); + scope.Start(); + try + { + var response = await _updateRunRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateRunName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName} + /// + /// + /// Operation Id + /// UpdateRun_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the UpdateRun resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string updateRunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); + + using var scope = _updateRunClientDiagnostics.CreateScope("UpdateRunCollection.Exists"); + scope.Start(); + try + { + var response = _updateRunRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateRunName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName} + /// + /// + /// Operation Id + /// UpdateRun_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the UpdateRun resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string updateRunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); + + using var scope = _updateRunClientDiagnostics.CreateScope("UpdateRunCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _updateRunRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateRunName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new UpdateRunResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName} + /// + /// + /// Operation Id + /// UpdateRun_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the UpdateRun resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string updateRunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); + + using var scope = _updateRunClientDiagnostics.CreateScope("UpdateRunCollection.GetIfExists"); + scope.Start(); + try + { + var response = _updateRunRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateRunName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new UpdateRunResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/UpdateRunData.Serialization.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/UpdateRunData.Serialization.cs new file mode 100644 index 000000000000..c3810d4d35c7 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/UpdateRunData.Serialization.cs @@ -0,0 +1,262 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.ContainerServiceFleet.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + public partial class UpdateRunData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UpdateRunData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (options.Format != "W" && Optional.IsDefined(ETag)) + { + writer.WritePropertyName("eTag"u8); + writer.WriteStringValue(ETag); + } + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(UpdateStrategyId)) + { + writer.WritePropertyName("updateStrategyId"u8); + writer.WriteStringValue(UpdateStrategyId); + } + if (Optional.IsDefined(Strategy)) + { + writer.WritePropertyName("strategy"u8); + writer.WriteObjectValue(Strategy, options); + } + if (Optional.IsDefined(ManagedClusterUpdate)) + { + writer.WritePropertyName("managedClusterUpdate"u8); + writer.WriteObjectValue(ManagedClusterUpdate, options); + } + if (options.Format != "W" && Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteObjectValue(Status, options); + } + if (options.Format != "W" && Optional.IsDefined(AutoUpgradeProfileId)) + { + writer.WritePropertyName("autoUpgradeProfileId"u8); + writer.WriteStringValue(AutoUpgradeProfileId); + } + writer.WriteEndObject(); + } + + UpdateRunData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UpdateRunData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUpdateRunData(document.RootElement, options); + } + + internal static UpdateRunData DeserializeUpdateRunData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string etag = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + UpdateRunProvisioningState? provisioningState = default; + ResourceIdentifier updateStrategyId = default; + UpdateRunStrategy strategy = default; + ManagedClusterUpdate managedClusterUpdate = default; + UpdateRunStatus status = default; + ResourceIdentifier autoUpgradeProfileId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("eTag"u8)) + { + etag = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new UpdateRunProvisioningState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("updateStrategyId"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + updateStrategyId = new ResourceIdentifier(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("strategy"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + strategy = UpdateRunStrategy.DeserializeUpdateRunStrategy(property0.Value, options); + continue; + } + if (property0.NameEquals("managedClusterUpdate"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + managedClusterUpdate = ManagedClusterUpdate.DeserializeManagedClusterUpdate(property0.Value, options); + continue; + } + if (property0.NameEquals("status"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = UpdateRunStatus.DeserializeUpdateRunStatus(property0.Value, options); + continue; + } + if (property0.NameEquals("autoUpgradeProfileId"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + autoUpgradeProfileId = new ResourceIdentifier(property0.Value.GetString()); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UpdateRunData( + id, + name, + type, + systemData, + provisioningState, + updateStrategyId, + strategy, + managedClusterUpdate, + status, + autoUpgradeProfileId, + etag, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(UpdateRunData)} does not support writing '{options.Format}' format."); + } + } + + UpdateRunData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeUpdateRunData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UpdateRunData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/UpdateRunData.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/UpdateRunData.cs new file mode 100644 index 000000000000..e4e1da400359 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/UpdateRunData.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.ContainerServiceFleet.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + /// + /// A class representing the UpdateRun data model. + /// A multi-stage process to perform update operations across members of a Fleet. + /// + public partial class UpdateRunData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public UpdateRunData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The provisioning state of the UpdateRun resource. + /// + /// The resource id of the FleetUpdateStrategy resource to reference. + /// + /// When creating a new run, there are three ways to define a strategy for the run: + /// 1. Define a new strategy in place: Set the "strategy" field. + /// 2. Use an existing strategy: Set the "updateStrategyId" field. (since 2023-08-15-preview) + /// 3. Use the default strategy to update all the members one by one: Leave both "updateStrategyId" and "strategy" unset. (since 2023-08-15-preview) + /// + /// Setting both "updateStrategyId" and "strategy" is invalid. + /// + /// UpdateRuns created by "updateStrategyId" snapshot the referenced UpdateStrategy at the time of creation and store it in the "strategy" field. + /// Subsequent changes to the referenced FleetUpdateStrategy resource do not propagate. + /// UpdateRunStrategy changes can be made directly on the "strategy" field before launching the UpdateRun. + /// + /// + /// The strategy defines the order in which the clusters will be updated. + /// If not set, all members will be updated sequentially. The UpdateRun status will show a single UpdateStage and a single UpdateGroup targeting all members. + /// The strategy of the UpdateRun can be modified until the run is started. + /// + /// The update to be applied to all clusters in the UpdateRun. The managedClusterUpdate can be modified until the run is started. + /// The status of the UpdateRun. + /// AutoUpgradeProfileId is the id of an auto upgrade profile resource. + /// 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. + /// Keeps track of any properties unknown to the library. + internal UpdateRunData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, UpdateRunProvisioningState? provisioningState, ResourceIdentifier updateStrategyId, UpdateRunStrategy strategy, ManagedClusterUpdate managedClusterUpdate, UpdateRunStatus status, ResourceIdentifier autoUpgradeProfileId, string etag, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + ProvisioningState = provisioningState; + UpdateStrategyId = updateStrategyId; + Strategy = strategy; + ManagedClusterUpdate = managedClusterUpdate; + Status = status; + AutoUpgradeProfileId = autoUpgradeProfileId; + ETag = etag; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The provisioning state of the UpdateRun resource. + public UpdateRunProvisioningState? ProvisioningState { get; } + /// + /// The resource id of the FleetUpdateStrategy resource to reference. + /// + /// When creating a new run, there are three ways to define a strategy for the run: + /// 1. Define a new strategy in place: Set the "strategy" field. + /// 2. Use an existing strategy: Set the "updateStrategyId" field. (since 2023-08-15-preview) + /// 3. Use the default strategy to update all the members one by one: Leave both "updateStrategyId" and "strategy" unset. (since 2023-08-15-preview) + /// + /// Setting both "updateStrategyId" and "strategy" is invalid. + /// + /// UpdateRuns created by "updateStrategyId" snapshot the referenced UpdateStrategy at the time of creation and store it in the "strategy" field. + /// Subsequent changes to the referenced FleetUpdateStrategy resource do not propagate. + /// UpdateRunStrategy changes can be made directly on the "strategy" field before launching the UpdateRun. + /// + public ResourceIdentifier UpdateStrategyId { get; set; } + /// + /// The strategy defines the order in which the clusters will be updated. + /// If not set, all members will be updated sequentially. The UpdateRun status will show a single UpdateStage and a single UpdateGroup targeting all members. + /// The strategy of the UpdateRun can be modified until the run is started. + /// + internal UpdateRunStrategy Strategy { get; set; } + /// The list of stages that compose this update run. Min size: 1. + public IList StrategyStages + { + get => Strategy is null ? default : Strategy.Stages; + set => Strategy = new UpdateRunStrategy(value); + } + + /// The update to be applied to all clusters in the UpdateRun. The managedClusterUpdate can be modified until the run is started. + public ManagedClusterUpdate ManagedClusterUpdate { get; set; } + /// The status of the UpdateRun. + public UpdateRunStatus Status { get; } + /// AutoUpgradeProfileId is the id of an auto upgrade profile resource. + public ResourceIdentifier AutoUpgradeProfileId { get; } + /// 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. + public string ETag { get; } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/UpdateRunResource.Serialization.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/UpdateRunResource.Serialization.cs new file mode 100644 index 000000000000..6a707367e971 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/UpdateRunResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + public partial class UpdateRunResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + UpdateRunData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + UpdateRunData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/UpdateRunResource.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/UpdateRunResource.cs new file mode 100644 index 000000000000..23677b88cf49 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/UpdateRunResource.cs @@ -0,0 +1,620 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ContainerServiceFleet.Models; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + /// + /// A Class representing an UpdateRun along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetUpdateRunResource method. + /// Otherwise you can get one from its parent resource using the GetUpdateRun method. + /// + public partial class UpdateRunResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The fleetName. + /// The updateRunName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _updateRunClientDiagnostics; + private readonly UpdateRunsRestOperations _updateRunRestClient; + private readonly UpdateRunData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.ContainerService/fleets/updateRuns"; + + /// Initializes a new instance of the class for mocking. + protected UpdateRunResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal UpdateRunResource(ArmClient client, UpdateRunData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal UpdateRunResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _updateRunClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerServiceFleet", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string updateRunApiVersion); + _updateRunRestClient = new UpdateRunsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, updateRunApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual UpdateRunData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a UpdateRun + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName} + /// + /// + /// Operation Id + /// UpdateRun_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _updateRunClientDiagnostics.CreateScope("UpdateRunResource.Get"); + scope.Start(); + try + { + var response = await _updateRunRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new UpdateRunResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a UpdateRun + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName} + /// + /// + /// Operation Id + /// UpdateRun_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _updateRunClientDiagnostics.CreateScope("UpdateRunResource.Get"); + scope.Start(); + try + { + var response = _updateRunRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new UpdateRunResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a UpdateRun + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName} + /// + /// + /// Operation Id + /// UpdateRun_Delete + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, string ifMatch = null, CancellationToken cancellationToken = default) + { + using var scope = _updateRunClientDiagnostics.CreateScope("UpdateRunResource.Delete"); + scope.Start(); + try + { + var response = await _updateRunRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceFleetArmOperation(_updateRunClientDiagnostics, Pipeline, _updateRunRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a UpdateRun + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName} + /// + /// + /// Operation Id + /// UpdateRun_Delete + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, string ifMatch = null, CancellationToken cancellationToken = default) + { + using var scope = _updateRunClientDiagnostics.CreateScope("UpdateRunResource.Delete"); + scope.Start(); + try + { + var response = _updateRunRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch, cancellationToken); + var operation = new ContainerServiceFleetArmOperation(_updateRunClientDiagnostics, Pipeline, _updateRunRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a UpdateRun + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName} + /// + /// + /// Operation Id + /// UpdateRun_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, UpdateRunData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _updateRunClientDiagnostics.CreateScope("UpdateRunResource.Update"); + scope.Start(); + try + { + var response = await _updateRunRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceFleetArmOperation(new UpdateRunOperationSource(Client), _updateRunClientDiagnostics, Pipeline, _updateRunRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a UpdateRun + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName} + /// + /// + /// Operation Id + /// UpdateRun_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, UpdateRunData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _updateRunClientDiagnostics.CreateScope("UpdateRunResource.Update"); + scope.Start(); + try + { + var response = _updateRunRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch, cancellationToken); + var operation = new ContainerServiceFleetArmOperation(new UpdateRunOperationSource(Client), _updateRunClientDiagnostics, Pipeline, _updateRunRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Starts an UpdateRun. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName}/start + /// + /// + /// Operation Id + /// UpdateRuns_Start + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + public virtual async Task> StartAsync(WaitUntil waitUntil, string ifMatch = null, CancellationToken cancellationToken = default) + { + using var scope = _updateRunClientDiagnostics.CreateScope("UpdateRunResource.Start"); + scope.Start(); + try + { + var response = await _updateRunRestClient.StartAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceFleetArmOperation(new UpdateRunOperationSource(Client), _updateRunClientDiagnostics, Pipeline, _updateRunRestClient.CreateStartRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Starts an UpdateRun. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName}/start + /// + /// + /// Operation Id + /// UpdateRuns_Start + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + public virtual ArmOperation Start(WaitUntil waitUntil, string ifMatch = null, CancellationToken cancellationToken = default) + { + using var scope = _updateRunClientDiagnostics.CreateScope("UpdateRunResource.Start"); + scope.Start(); + try + { + var response = _updateRunRestClient.Start(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch, cancellationToken); + var operation = new ContainerServiceFleetArmOperation(new UpdateRunOperationSource(Client), _updateRunClientDiagnostics, Pipeline, _updateRunRestClient.CreateStartRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Stops an UpdateRun. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName}/stop + /// + /// + /// Operation Id + /// UpdateRuns_Stop + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + public virtual async Task> StopAsync(WaitUntil waitUntil, string ifMatch = null, CancellationToken cancellationToken = default) + { + using var scope = _updateRunClientDiagnostics.CreateScope("UpdateRunResource.Stop"); + scope.Start(); + try + { + var response = await _updateRunRestClient.StopAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceFleetArmOperation(new UpdateRunOperationSource(Client), _updateRunClientDiagnostics, Pipeline, _updateRunRestClient.CreateStopRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Stops an UpdateRun. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName}/stop + /// + /// + /// Operation Id + /// UpdateRuns_Stop + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + public virtual ArmOperation Stop(WaitUntil waitUntil, string ifMatch = null, CancellationToken cancellationToken = default) + { + using var scope = _updateRunClientDiagnostics.CreateScope("UpdateRunResource.Stop"); + scope.Start(); + try + { + var response = _updateRunRestClient.Stop(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch, cancellationToken); + var operation = new ContainerServiceFleetArmOperation(new UpdateRunOperationSource(Client), _updateRunClientDiagnostics, Pipeline, _updateRunRestClient.CreateStopRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Skips one or a combination of member/group/stage/afterStageWait(s) of an update run. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName}/skip + /// + /// + /// Operation Id + /// UpdateRuns_Skip + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The content of the action request. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + /// is null. + public virtual async Task> SkipAsync(WaitUntil waitUntil, SkipProperties body, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _updateRunClientDiagnostics.CreateScope("UpdateRunResource.Skip"); + scope.Start(); + try + { + var response = await _updateRunRestClient.SkipAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body, ifMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceFleetArmOperation(new UpdateRunOperationSource(Client), _updateRunClientDiagnostics, Pipeline, _updateRunRestClient.CreateSkipRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Skips one or a combination of member/group/stage/afterStageWait(s) of an update run. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName}/skip + /// + /// + /// Operation Id + /// UpdateRuns_Skip + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The content of the action request. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Skip(WaitUntil waitUntil, SkipProperties body, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _updateRunClientDiagnostics.CreateScope("UpdateRunResource.Skip"); + scope.Start(); + try + { + var response = _updateRunRestClient.Skip(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body, ifMatch, cancellationToken); + var operation = new ContainerServiceFleetArmOperation(new UpdateRunOperationSource(Client), _updateRunClientDiagnostics, Pipeline, _updateRunRestClient.CreateSkipRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Properties/AssemblyInfo.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..5d22c67b3872 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/src/Properties/AssemblyInfo.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Azure.ResourceManager.ContainerServiceFleet.Tests, PublicKey = 0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] + +// Replace Microsoft.Test with the correct resource provider namepace for your service and uncomment. +// See https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-services-resource-providers +// for the list of possible values. +[assembly: Azure.Core.AzureResourceProviderNamespace("ContainerServiceFleet")] diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/tests/Azure.ResourceManager.ContainerServiceFleet.Tests.csproj b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/tests/Azure.ResourceManager.ContainerServiceFleet.Tests.csproj new file mode 100644 index 000000000000..36a6e89eb970 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/tests/Azure.ResourceManager.ContainerServiceFleet.Tests.csproj @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/tests/ContainerServiceFleetManagementTestBase.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/tests/ContainerServiceFleetManagementTestBase.cs new file mode 100644 index 000000000000..bd4f03a28324 --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/tests/ContainerServiceFleetManagementTestBase.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager; +using Azure.ResourceManager.Resources; +using Azure.ResourceManager.TestFramework; +using NUnit.Framework; +using System.Threading.Tasks; + +namespace Azure.ResourceManager.ContainerServiceFleet.Tests +{ + public class ContainerServiceFleetManagementTestBase : ManagementRecordedTestBase + { + protected ArmClient Client { get; private set; } + protected SubscriptionResource DefaultSubscription { get; private set; } + + protected ContainerServiceFleetManagementTestBase(bool isAsync, RecordedTestMode mode) + : base(isAsync, mode) + { + } + + protected ContainerServiceFleetManagementTestBase(bool isAsync) + : base(isAsync) + { + } + + [SetUp] + public async Task CreateCommonClient() + { + Client = GetArmClient(); + DefaultSubscription = await Client.GetDefaultSubscriptionAsync().ConfigureAwait(false); + } + + protected async Task CreateResourceGroup(SubscriptionResource subscription, string rgNamePrefix, AzureLocation location) + { + string rgName = Recording.GenerateAssetName(rgNamePrefix); + ResourceGroupData input = new ResourceGroupData(location); + var lro = await subscription.GetResourceGroups().CreateOrUpdateAsync(WaitUntil.Completed, rgName, input); + return lro.Value; + } + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/tests/ContainerServiceFleetManagementTestEnvironment.cs b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/tests/ContainerServiceFleetManagementTestEnvironment.cs new file mode 100644 index 000000000000..880ae1a6e2cd --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/tests/ContainerServiceFleetManagementTestEnvironment.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.TestFramework; + +namespace Azure.ResourceManager.ContainerServiceFleet.Tests +{ + public class ContainerServiceFleetManagementTestEnvironment : TestEnvironment + { + } +} diff --git a/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/tsp-location.yaml b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/tsp-location.yaml new file mode 100644 index 000000000000..44bc417e8a7e --- /dev/null +++ b/sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/containerservice/Fleet.Management +commit: 88ad03595e8e35c4422e55fb93f7e822fee6e1ce +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/containerservicefleet/ci.mgmt.yml b/sdk/containerservicefleet/ci.mgmt.yml new file mode 100644 index 000000000000..bc7d2c9d717b --- /dev/null +++ b/sdk/containerservicefleet/ci.mgmt.yml @@ -0,0 +1,26 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: none + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerservicefleet /ci.mgmt.yml + - sdk/containerservicefleet /Azure.ResourceManager.ContainerServiceFleet / + + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: containerservicefleet + ArtifactName: packages + LimitForPullRequest: true + Artifacts: + - name: Azure.ResourceManager.ContainerServiceFleet + safeName: AzureResourceManagerContainerServiceFleet diff --git a/sdk/resourcemanager/ci.mgmt.yml b/sdk/resourcemanager/ci.mgmt.yml index 4e3c032f60a4..c7648420d846 100644 --- a/sdk/resourcemanager/ci.mgmt.yml +++ b/sdk/resourcemanager/ci.mgmt.yml @@ -53,6 +53,7 @@ trigger: - sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime - sdk/containerregistry/Azure.ResourceManager.ContainerRegistry - sdk/containerservice/Azure.ResourceManager.ContainerService + - sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet - sdk/cosmosdb/Azure.ResourceManager.CosmosDB - sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql - sdk/costmanagement/Azure.ResourceManager.CostManagement @@ -262,6 +263,7 @@ pr: - sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime - sdk/containerregistry/Azure.ResourceManager.ContainerRegistry - sdk/containerservice/Azure.ResourceManager.ContainerService + - sdk/containerservicefleet/Azure.ResourceManager.ContainerServiceFleet - sdk/cosmosdb/Azure.ResourceManager.CosmosDB - sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql - sdk/costmanagement/Azure.ResourceManager.CostManagement diff --git a/sdk/storage/ci.yml b/sdk/storage/ci.yml index 2ca0501b60bd..4e749e6b85b1 100644 --- a/sdk/storage/ci.yml +++ b/sdk/storage/ci.yml @@ -12,6 +12,8 @@ trigger: - sdk/storage/Azure.Storage.DataMovement/ - sdk/storage/Azure.Storage.DataMovement.Blobs/ - sdk/storage/Azure.Storage.DataMovement.Files/ + exclude: + - sdk/storage/Azure.ResourceManager.Storage/ - sdk/storage/Azure.Storage.DataMovement.Blobs.Files.Shares/ exclude: - sdk/storage/Azure.ResourceManager.Storage/