From 9ae4326760613fbc28c970391162fb86db6316a7 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 23 Jan 2024 20:52:33 +0000 Subject: [PATCH] CodeGen from PR 27491 in Azure/azure-rest-api-specs Merge 9c0c32bc703843273a88b05ec3f2def66b5fd9a9 into d695b50e199aff6da55cd8fa5728de8dea38eace --- .../src/Generated/AgentPoolSnapshotData.cs | 123 - .../Generated/AgentPoolSnapshotResource.cs | 701 ----- .../Generated/AgentPoolUpgradeProfileData.cs | 100 - .../AgentPoolUpgradeProfileResource.cs | 173 -- .../ArmContainerServiceModelFactory.cs | 700 +---- .../ContainerServiceAgentPoolCollection.cs | 495 ---- .../ContainerServiceAgentPoolData.cs | 271 -- .../ContainerServiceAgentPoolResource.cs | 777 ----- ...rviceMaintenanceConfigurationCollection.cs | 495 ---- ...inerServiceMaintenanceConfigurationData.cs | 85 - ...ontainerServiceManagedClusterCollection.cs | 496 ---- .../ContainerServiceManagedClusterData.cs | 282 -- .../ContainerServiceManagedClusterResource.cs | 2332 --------------- ...vicePrivateEndpointConnectionCollection.cs | 493 ---- ...nerServicePrivateEndpointConnectionData.cs | 96 - ...rviceTrustedAccessRoleBindingCollection.cs | 495 ---- ...inerServiceTrustedAccessRoleBindingData.cs | 97 - ...ServiceTrustedAccessRoleBindingResource.cs | 349 --- .../Extensions/ContainerServiceExtensions.cs | 663 +---- .../MockableContainerServiceArmClient.cs | 132 +- ...leContainerServiceResourceGroupResource.cs | 117 +- ...bleContainerServiceSubscriptionResource.cs | 319 +-- ...apshotCollection.cs => FleetCollection.cs} | 278 +- .../src/Generated/FleetData.cs | 96 + .../src/Generated/FleetMemberCollection.cs | 499 ++++ .../src/Generated/FleetMemberData.cs | 88 + ...tionResource.cs => FleetMemberResource.cs} | 173 +- .../src/Generated/FleetResource.cs | 996 +++++++ .../FleetUpdateStrategyCollection.cs | 499 ++++ .../src/Generated/FleetUpdateStrategyData.cs | 90 + ...urce.cs => FleetUpdateStrategyResource.cs} | 166 +- ...ontainerServiceAgentPoolOperationSource.cs | 40 - ...nerServiceManagedClusterOperationSource.cs | 40 - ...TrustedAccessRoleBindingOperationSource.cs | 40 - .../FleetMemberOperationSource.cs | 40 + .../FleetOperationSource.cs | 40 + .../FleetUpdateStrategyOperationSource.cs | 40 + ...dClusterRunCommandResultOperationSource.cs | 31 - .../UpdateRunOperationSource.cs | 40 + .../ManagedClusterUpgradeProfileData.cs | 93 - .../ManagedClusterUpgradeProfileResource.cs | 172 -- .../MeshRevisionProfileCollection.cs | 401 --- .../src/Generated/MeshRevisionProfileData.cs | 85 - .../Generated/MeshRevisionProfileResource.cs | 173 -- .../Generated/MeshUpgradeProfileCollection.cs | 397 --- .../src/Generated/MeshUpgradeProfileData.cs | 75 - .../Generated/MeshUpgradeProfileResource.cs | 173 -- ...AgentPoolAvailableVersion.Serialization.cs | 152 - .../Models/AgentPoolAvailableVersion.cs | 73 - ...gentPoolAvailableVersions.Serialization.cs | 200 -- .../src/Generated/Models/AgentPoolMode.cs | 51 - .../Models/AgentPoolNetworkPortProtocol.cs | 51 - .../Models/AgentPoolNetworkPortRange.cs | 73 - .../AgentPoolNetworkProfile.Serialization.cs | 198 -- .../Models/AgentPoolNetworkProfile.cs | 77 - .../AgentPoolSnapshotData.Serialization.cs | 318 --- ...entPoolSnapshotListResult.Serialization.cs | 148 - .../src/Generated/Models/AgentPoolType.cs | 51 - ...entPoolUpgradeProfileData.Serialization.cs | 228 -- ...ilePropertiesUpgradesItem.Serialization.cs | 137 - .../Models/AgentPoolUpgradeSettings.cs | 69 - ...ation.cs => AgentProfile.Serialization.cs} | 68 +- ...lSnapshotListResult.cs => AgentProfile.cs} | 30 +- ...> ApiServerAccessProfile.Serialization.cs} | 74 +- ...eVersions.cs => ApiServerAccessProfile.cs} | 34 +- .../src/Generated/Models/AutoScaleExpander.cs | 57 - .../ClusterUpgradeSettings.Serialization.cs | 126 - ...ainerServiceAgentPoolData.Serialization.cs | 843 ------ ...erviceAgentPoolListResult.Serialization.cs | 148 - .../ContainerServiceAgentPoolListResult.cs | 72 - .../Models/ContainerServiceCreationData.cs | 66 - .../ContainerServiceDateSpan.Serialization.cs | 127 - .../Models/ContainerServiceDateSpan.cs | 78 - ...ServiceEndpointDependency.Serialization.cs | 147 - .../ContainerServiceEndpointDependency.cs | 71 - ...inerServiceEndpointDetail.Serialization.cs | 164 -- .../Models/ContainerServiceEndpointDetail.cs | 78 - .../Generated/Models/ContainerServiceIPTag.cs | 69 - ...tainerServiceLinuxProfile.Serialization.cs | 127 - .../Models/ContainerServiceLinuxProfile.cs | 89 - .../Models/ContainerServiceLoadBalancerSku.cs | 51 - ...ceAbsoluteMonthlySchedule.Serialization.cs | 127 - ...rviceMaintenanceAbsoluteMonthlySchedule.cs | 78 - ...ceConfigurationListResult.Serialization.cs | 148 - ...ceRelativeMonthlySchedule.Serialization.cs | 135 - ...rviceMaintenanceRelativeMonthlySchedule.cs | 84 - ...tenanceRelativeMonthlyScheduleWeekIndex.cs | 60 - ...erviceMaintenanceSchedule.Serialization.cs | 171 -- .../ContainerServiceMaintenanceSchedule.cs | 87 - ...MaintenanceWeeklySchedule.Serialization.cs | 127 - ...ntainerServiceMaintenanceWeeklySchedule.cs | 78 - ...rServiceMaintenanceWindow.Serialization.cs | 182 -- .../ContainerServiceMaintenanceWindow.cs | 102 - ...ServiceManagedClusterData.Serialization.cs | 847 ------ .../Models/ContainerServiceNetworkMode.cs | 51 - .../Models/ContainerServiceNetworkPlugin.cs | 54 - .../ContainerServiceNetworkPluginMode.cs | 48 - .../Models/ContainerServiceNetworkPolicy.cs | 54 - ...inerServiceNetworkProfile.Serialization.cs | 354 --- .../Models/ContainerServiceNetworkProfile.cs | 125 - .../Models/ContainerServiceOSDiskType.cs | 51 - ...erServiceOSOptionProperty.Serialization.cs | 127 - .../ContainerServiceOSOptionProperty.cs | 82 - .../Generated/Models/ContainerServiceOSSku.cs | 60 - .../Models/ContainerServiceOSType.cs | 51 - ...tboundEnvironmentEndpoint.Serialization.cs | 147 - ...ainerServiceOutboundEnvironmentEndpoint.cs | 71 - .../Models/ContainerServiceOutboundType.cs | 57 - ...pointConnectionListResult.Serialization.cs | 137 - ...vicePrivateEndpointConnectionListResult.cs | 68 - ...vateEndpointConnectionProvisioningState.cs | 60 - ...cePrivateLinkResourceData.Serialization.cs | 203 -- ...ContainerServicePrivateLinkResourceData.cs | 87 - ...teLinkResourcesListResult.Serialization.cs | 136 - ...erServicePrivateLinkResourcesListResult.cs | 67 - ...inkServiceConnectionState.Serialization.cs | 137 - ...rvicePrivateLinkServiceConnectionStatus.cs | 57 - .../ContainerServicePublicNetworkAccess.cs | 51 - ...erServiceSshConfiguration.Serialization.cs | 129 - .../Models/ContainerServiceStateCode.cs | 51 - .../Models/ContainerServiceTimeInWeek.cs | 71 - .../Models/ContainerServiceTimeSpan.cs | 69 - .../ContainerServiceTrustedAccessRole.cs | 75 - ...ustedAccessRoleBindingProvisioningState.cs | 60 - ...viceTrustedAccessRoleRule.Serialization.cs | 236 -- .../ContainerServiceTrustedAccessRoleRule.cs | 87 - ...rviceUserAssignedIdentity.Serialization.cs | 156 - .../ContainerServiceUserAssignedIdentity.cs | 74 - .../Models/ContainerServiceWeekDay.cs | 66 - ...=> FleetCredentialResult.Serialization.cs} | 38 +- ...Credential.cs => FleetCredentialResult.cs} | 12 +- ...> FleetCredentialResults.Serialization.cs} | 56 +- ...edentials.cs => FleetCredentialResults.cs} | 20 +- ...lization.cs => FleetData.Serialization.cs} | 99 +- .../Models/FleetHubProfile.Serialization.cs | 185 ++ ...tiesUpgradesItem.cs => FleetHubProfile.cs} | 40 +- ...on.cs => FleetListResult.Serialization.cs} | 73 +- ...dpointListResult.cs => FleetListResult.cs} | 31 +- ...on.cs => FleetMemberData.Serialization.cs} | 96 +- ...=> FleetMemberListResult.Serialization.cs} | 74 +- ...ListResult.cs => FleetMemberListResult.cs} | 36 +- ...n.cs => FleetMemberPatch.Serialization.cs} | 61 +- ...UpgradeSettings.cs => FleetMemberPatch.cs} | 20 +- .../Models/FleetMemberProvisioningState.cs | 63 + ...ization.cs => FleetPatch.Serialization.cs} | 54 +- ...inerServiceTagsObject.cs => FleetPatch.cs} | 17 +- .../Models/FleetProvisioningState.cs | 63 + ... FleetUpdateStrategyData.Serialization.cs} | 86 +- ...UpdateStrategyListResult.Serialization.cs} | 79 +- ...on.cs => FleetUpdateStrategyListResult.cs} | 37 +- .../FleetUpdateStrategyProvisioningState.cs | 54 + .../Generated/Models/GpuInstanceProfile.cs | 60 - .../src/Generated/Models/IPFamily.cs | 51 - ...IstioCertificateAuthority.Serialization.cs | 126 - .../Models/IstioCertificateAuthority.cs | 65 - .../src/Generated/Models/IstioComponents.cs | 72 - .../IstioEgressGateway.Serialization.cs | 145 - .../Generated/Models/IstioEgressGateway.cs | 78 - .../Generated/Models/IstioIngressGateway.cs | 78 - .../Models/IstioIngressGatewayMode.cs | 51 - ...luginCertificateAuthority.Serialization.cs | 170 -- .../Models/IstioPluginCertificateAuthority.cs | 82 - .../Models/IstioServiceMesh.Serialization.cs | 166 -- .../src/Generated/Models/IstioServiceMesh.cs | 87 - .../src/Generated/Models/KubeConfigFormat.cs | 51 - .../Models/KubeletConfig.Serialization.cs | 274 -- .../src/Generated/Models/KubeletConfig.cs | 107 - .../src/Generated/Models/KubeletDiskType.cs | 51 - .../Models/KubernetesPatchVersion.cs | 67 - .../Generated/Models/KubernetesSupportPlan.cs | 51 - .../src/Generated/Models/KubernetesVersion.cs | 85 - ...rnetesVersionCapabilities.Serialization.cs | 136 - .../Models/KubernetesVersionCapabilities.cs | 67 - ...bernetesVersionListResult.Serialization.cs | 136 - .../Models/LinuxOSConfig.Serialization.cs | 163 -- .../src/Generated/Models/LinuxOSConfig.cs | 77 - .../ManagedClusterAadProfile.Serialization.cs | 222 -- .../Models/ManagedClusterAadProfile.cs | 91 - .../Models/ManagedClusterAccessProfile.cs | 79 - ...anagedClusterAddonProfile.Serialization.cs | 160 -- .../Models/ManagedClusterAddonProfile.cs | 82 - ...usterAddonProfileIdentity.Serialization.cs | 156 - .../ManagedClusterAddonProfileIdentity.cs | 31 - ...edClusterAgentPoolProfile.Serialization.cs | 786 ------ .../Models/ManagedClusterAgentPoolProfile.cs | 86 - ...gentPoolProfileProperties.Serialization.cs | 778 ----- ...anagedClusterAgentPoolProfileProperties.cs | 262 -- ...terApiServerAccessProfile.Serialization.cs | 192 -- .../ManagedClusterApiServerAccessProfile.cs | 83 - ...dClusterAutoScalerProfile.Serialization.cs | 302 -- .../Models/ManagedClusterAutoScalerProfile.cs | 129 - ...ClusterAutoUpgradeProfile.Serialization.cs | 141 - .../ManagedClusterAutoUpgradeProfile.cs | 69 - .../ManagedClusterAzureMonitorProfile.cs | 65 - .../Models/ManagedClusterDelegatedIdentity.cs | 78 - ...gedClusterHttpProxyConfig.Serialization.cs | 169 -- .../Models/ManagedClusterHttpProxyConfig.cs | 79 - ...ManagedClusterKeyVaultNetworkAccessType.cs | 51 - .../ManagedClusterListResult.Serialization.cs | 148 - .../Models/ManagedClusterListResult.cs | 72 - ...nagedClusterLoadBalancerBackendPoolType.cs | 51 - ...lusterLoadBalancerProfile.Serialization.cs | 242 -- .../ManagedClusterLoadBalancerProfile.cs | 118 - ...ProfileManagedOutboundIPs.Serialization.cs | 141 - ...erLoadBalancerProfileManagedOutboundIPs.cs | 69 - ...ProfileOutboundIPPrefixes.Serialization.cs | 137 - ...erLoadBalancerProfileOutboundIPPrefixes.cs | 68 - ...alancerProfileOutboundIPs.Serialization.cs | 137 - ...edClusterLoadBalancerProfileOutboundIPs.cs | 68 - ...rManagedOutboundIPProfile.Serialization.cs | 126 - .../ManagedClusterManagedOutboundIPProfile.cs | 65 - ...orProfileKubeStateMetrics.Serialization.cs | 133 - ...edClusterMonitorProfileKubeStateMetrics.cs | 69 - ...sterMonitorProfileMetrics.Serialization.cs | 134 - .../ManagedClusterMonitorProfileMetrics.cs | 76 - ...dClusterNatGatewayProfile.Serialization.cs | 167 -- .../Models/ManagedClusterNatGatewayProfile.cs | 88 - .../ManagedClusterNodeOSUpgradeChannel.cs | 54 - ...dClusterOidcIssuerProfile.Serialization.cs | 137 - .../Models/ManagedClusterOidcIssuerProfile.cs | 69 - ...ManagedClusterPodIdentity.Serialization.cs | 176 -- .../Models/ManagedClusterPodIdentity.cs | 108 - ...usterPodIdentityException.Serialization.cs | 146 - .../ManagedClusterPodIdentityException.cs | 90 - ...ClusterPodIdentityProfile.Serialization.cs | 191 -- .../ManagedClusterPodIdentityProfile.cs | 80 - ...IdentityProvisioningError.Serialization.cs | 127 - ...agedClusterPodIdentityProvisioningError.cs | 66 - ...dIdentityProvisioningInfo.Serialization.cs | 126 - ...agedClusterPodIdentityProvisioningState.cs | 63 - ...ClusterPoolUpgradeProfile.Serialization.cs | 163 -- .../ManagedClusterPoolUpgradeProfile.cs | 91 - ...pgradeProfileUpgradesItem.Serialization.cs | 137 - ...dClusterRunCommandContent.Serialization.cs | 141 - ...edClusterRunCommandResult.Serialization.cs | 215 -- .../Models/ManagedClusterRunCommandResult.cs | 89 - ...gedClusterSecurityProfile.Serialization.cs | 171 -- .../Models/ManagedClusterSecurityProfile.cs | 89 - ...erSecurityProfileDefender.Serialization.cs | 141 - .../ManagedClusterSecurityProfileDefender.cs | 81 - ...efenderSecurityMonitoring.Serialization.cs | 126 - ...curityProfileDefenderSecurityMonitoring.cs | 65 - ...curityProfileImageCleaner.Serialization.cs | 141 - ...nagedClusterSecurityProfileImageCleaner.cs | 69 - ...ecurityProfileKeyVaultKms.Serialization.cs | 167 -- ...anagedClusterSecurityProfileKeyVaultKms.cs | 78 - ...tyProfileWorkloadIdentity.Serialization.cs | 126 - ...dClusterSecurityProfileWorkloadIdentity.cs | 65 - ...erServicePrincipalProfile.Serialization.cs | 130 - .../Generated/Models/ManagedClusterSkuName.cs | 48 - .../Generated/Models/ManagedClusterSkuTier.cs | 54 - ...agedClusterStorageProfile.Serialization.cs | 171 -- .../Models/ManagedClusterStorageProfile.cs | 80 - ...orageProfileBlobCsiDriver.Serialization.cs | 126 - ...nagedClusterStorageProfileBlobCsiDriver.cs | 65 - ...orageProfileDiskCsiDriver.Serialization.cs | 126 - ...nagedClusterStorageProfileDiskCsiDriver.cs | 65 - ...orageProfileFileCsiDriver.Serialization.cs | 126 - ...nagedClusterStorageProfileFileCsiDriver.cs | 65 - ...ProfileSnapshotController.Serialization.cs | 126 - ...ClusterStorageProfileSnapshotController.cs | 65 - ... => ManagedClusterUpdate.Serialization.cs} | 58 +- ...ipalProfile.cs => ManagedClusterUpdate.cs} | 49 +- ...ClusterUpgradeProfileData.Serialization.cs | 202 -- ...anagedClusterUpgradeSpec.Serialization.cs} | 72 +- ...esItem.cs => ManagedClusterUpgradeSpec.cs} | 33 +- .../Models/ManagedClusterUpgradeType.cs | 54 + ...sterVerticalPodAutoscaler.Serialization.cs | 119 - .../ManagedClusterVerticalPodAutoscaler.cs | 72 - ...agedClusterWindowsProfile.Serialization.cs | 175 -- .../Models/ManagedClusterWindowsProfile.cs | 92 - ...WorkloadAutoScalerProfile.Serialization.cs | 141 - ...ManagedClusterWorkloadAutoScalerProfile.cs | 88 - ...loadAutoScalerProfileKeda.Serialization.cs | 119 - ...gedClusterWorkloadAutoScalerProfileKeda.cs | 72 - ...> ManagedServiceIdentity.Serialization.cs} | 89 +- .../Models/ManagedServiceIdentity.cs | 87 + .../Models/ManagedServiceIdentityType.cs | 57 + ...cs => MemberUpdateStatus.Serialization.cs} | 99 +- ...gedClusterSku.cs => MemberUpdateStatus.cs} | 39 +- .../src/Generated/Models/MeshRevision.cs | 76 - .../MeshRevisionProfileData.Serialization.cs | 176 -- .../Models/MeshRevisionProfileList.cs | 72 - .../MeshUpgradeProfileData.Serialization.cs | 176 -- .../Models/MeshUpgradeProfileList.cs | 72 - ...hUpgradeProfileProperties.Serialization.cs | 172 -- .../Models/MeshUpgradeProfileProperties.cs | 30 - .../src/Generated/Models/NetworkDataplane.cs | 51 - ...cs => NodeImageSelection.Serialization.cs} | 63 +- ...DailySchedule.cs => NodeImageSelection.cs} | 28 +- ...NodeImageSelectionStatus.Serialization.cs} | 71 +- ...tResult.cs => NodeImageSelectionStatus.cs} | 22 +- .../Models/NodeImageSelectionType.cs | 51 + ...n.cs => NodeImageVersion.Serialization.cs} | 51 +- ...rvicePowerState.cs => NodeImageVersion.cs} | 20 +- .../OSOptionProfileData.Serialization.cs | 194 -- ...ronmentEndpointListResult.Serialization.cs | 140 - .../src/Generated/Models/ScaleDownMode.cs | 51 - .../Models/ScaleSetEvictionPolicy.cs | 51 - .../src/Generated/Models/ScaleSetPriority.cs | 51 - .../src/Generated/Models/ServiceMeshMode.cs | 51 - ...ion.cs => SkipProperties.Serialization.cs} | 57 +- ...erviceMeshProfile.cs => SkipProperties.cs} | 37 +- ...ization.cs => SkipTarget.Serialization.cs} | 58 +- ...sterRunCommandContent.cs => SkipTarget.cs} | 58 +- .../src/Generated/Models/SnapshotType.cs | 48 - .../Models/SysctlConfig.Serialization.cs | 527 ---- .../src/Generated/Models/SysctlConfig.cs | 173 -- .../src/Generated/Models/TargetType.cs | 57 + ...cessRoleBindingListResult.Serialization.cs | 148 - ...ustedAccessRoleListResult.Serialization.cs | 147 - .../Models/TrustedAccessRoleListResult.cs | 71 - ...zation.cs => UpdateGroup.Serialization.cs} | 48 +- .../{CompatibleVersions.cs => UpdateGroup.cs} | 40 +- ....cs => UpdateGroupStatus.Serialization.cs} | 70 +- ...onnectionState.cs => UpdateGroupStatus.cs} | 32 +- ...tion.cs => UpdateRunData.Serialization.cs} | 132 +- ...s => UpdateRunListResult.Serialization.cs} | 73 +- ...onListResult.cs => UpdateRunListResult.cs} | 36 +- .../Models/UpdateRunProvisioningState.cs | 54 + ...on.cs => UpdateRunStatus.Serialization.cs} | 91 +- .../src/Generated/Models/UpdateRunStatus.cs | 80 + ....cs => UpdateRunStrategy.Serialization.cs} | 72 +- ...ceSshPublicKey.cs => UpdateRunStrategy.cs} | 41 +- ...zation.cs => UpdateStage.Serialization.cs} | 86 +- .../src/Generated/Models/UpdateStage.cs | 85 + ....cs => UpdateStageStatus.Serialization.cs} | 113 +- ...errideSettings.cs => UpdateStageStatus.cs} | 38 +- .../src/Generated/Models/UpdateState.cs | 66 + ...ation.cs => UpdateStatus.Serialization.cs} | 110 +- ...ityProvisioningInfo.cs => UpdateStatus.cs} | 35 +- .../src/Generated/Models/UpgradeChannel.cs | 60 - ...ization.cs => WaitStatus.Serialization.cs} | 62 +- ...sionProfileProperties.cs => WaitStatus.cs} | 26 +- .../WindowsGmsaProfile.Serialization.cs | 148 - .../Generated/Models/WindowsGmsaProfile.cs | 73 - .../Generated/Models/WindowsVmLicenseType.cs | 51 - .../src/Generated/Models/WorkloadRuntime.cs | 51 - .../src/Generated/OSOptionProfileData.cs | 86 - .../src/Generated/OSOptionProfileResource.cs | 174 -- .../FleetMembersRestOperations.cs | 553 ++++ ...=> FleetUpdateStrategiesRestOperations.cs} | 284 +- ...tOperations.cs => FleetsRestOperations.cs} | 417 +-- ...MaintenanceConfigurationsRestOperations.cs | 453 --- .../ManagedClustersRestOperations.cs | 2506 ----------------- ...rivateEndpointConnectionsRestOperations.cs | 377 --- .../PrivateLinkResourcesRestOperations.cs | 119 - ...solvePrivateLinkServiceIdRestOperations.cs | 127 - .../TrustedAccessRolesRestOperations.cs | 181 -- ...rations.cs => UpdateRunsRestOperations.cs} | 569 ++-- .../src/Generated/UpdateRunCollection.cs | 499 ++++ .../src/Generated/UpdateRunData.cs | 137 + .../src/Generated/UpdateRunResource.cs | 614 ++++ .../src/autorest.md | 2 +- 354 files changed, 8160 insertions(+), 44839 deletions(-) delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotData.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotResource.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileData.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileResource.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolCollection.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolData.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolResource.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationCollection.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationData.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterCollection.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterData.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterResource.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServicePrivateEndpointConnectionCollection.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServicePrivateEndpointConnectionData.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBindingCollection.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBindingData.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBindingResource.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/{AgentPoolSnapshotCollection.cs => FleetCollection.cs} (50%) create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetData.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetMemberCollection.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetMemberData.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/{ContainerServicePrivateEndpointConnectionResource.cs => FleetMemberResource.cs} (53%) create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetResource.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetUpdateStrategyCollection.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetUpdateStrategyData.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/{ContainerServiceMaintenanceConfigurationResource.cs => FleetUpdateStrategyResource.cs} (56%) delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/ContainerServiceAgentPoolOperationSource.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/ContainerServiceManagedClusterOperationSource.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/ContainerServiceTrustedAccessRoleBindingOperationSource.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/FleetMemberOperationSource.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/FleetOperationSource.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/FleetUpdateStrategyOperationSource.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/ManagedClusterRunCommandResultOperationSource.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/UpdateRunOperationSource.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ManagedClusterUpgradeProfileData.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ManagedClusterUpgradeProfileResource.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshRevisionProfileCollection.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshRevisionProfileData.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshRevisionProfileResource.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshUpgradeProfileCollection.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshUpgradeProfileData.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshUpgradeProfileResource.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolAvailableVersion.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolAvailableVersion.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolAvailableVersions.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolMode.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolNetworkPortProtocol.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolNetworkPortRange.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolNetworkProfile.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolNetworkProfile.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolSnapshotData.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolSnapshotListResult.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolType.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeProfileData.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeProfilePropertiesUpgradesItem.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeSettings.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{AgentPoolUpgradeSettings.Serialization.cs => AgentProfile.Serialization.cs} (56%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{AgentPoolSnapshotListResult.cs => AgentProfile.cs} (66%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{AgentPoolNetworkPortRange.Serialization.cs => ApiServerAccessProfile.Serialization.cs} (53%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{AgentPoolAvailableVersions.cs => ApiServerAccessProfile.cs} (57%) delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AutoScaleExpander.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ClusterUpgradeSettings.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceAgentPoolData.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceAgentPoolListResult.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceAgentPoolListResult.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceCreationData.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceDateSpan.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceDateSpan.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceEndpointDependency.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceEndpointDependency.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceEndpointDetail.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceEndpointDetail.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceIPTag.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceLinuxProfile.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceLinuxProfile.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceLoadBalancerSku.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceAbsoluteMonthlySchedule.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceAbsoluteMonthlySchedule.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceConfigurationListResult.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceRelativeMonthlySchedule.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceRelativeMonthlySchedule.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceSchedule.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceSchedule.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceWeeklySchedule.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceWeeklySchedule.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceWindow.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceWindow.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceManagedClusterData.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkMode.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkPlugin.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkPluginMode.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkPolicy.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkProfile.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkProfile.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSDiskType.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSOptionProperty.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSOptionProperty.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSSku.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSType.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOutboundEnvironmentEndpoint.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOutboundEnvironmentEndpoint.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOutboundType.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateEndpointConnectionListResult.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateEndpointConnectionListResult.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateEndpointConnectionProvisioningState.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkResourceData.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkResourceData.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkResourcesListResult.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkResourcesListResult.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkServiceConnectionState.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkServiceConnectionStatus.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePublicNetworkAccess.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceSshConfiguration.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceStateCode.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTimeInWeek.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTimeSpan.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTrustedAccessRole.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTrustedAccessRoleBindingProvisioningState.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTrustedAccessRoleRule.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTrustedAccessRoleRule.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceUserAssignedIdentity.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceUserAssignedIdentity.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceWeekDay.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ManagedClusterCredential.Serialization.cs => FleetCredentialResult.Serialization.cs} (65%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ManagedClusterCredential.cs => FleetCredentialResult.cs} (82%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{KubernetesPatchVersion.Serialization.cs => FleetCredentialResults.Serialization.cs} (63%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ManagedClusterCredentials.cs => FleetCredentialResults.cs} (69%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ManagedClusterAccessProfile.Serialization.cs => FleetData.Serialization.cs} (61%) create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetHubProfile.Serialization.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{AgentPoolUpgradeProfilePropertiesUpgradesItem.cs => FleetHubProfile.cs} (50%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{MeshUpgradeProfileList.Serialization.cs => FleetListResult.Serialization.cs} (56%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{OutboundEnvironmentEndpointListResult.cs => FleetListResult.cs} (61%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ContainerServiceTrustedAccessRoleBindingData.Serialization.cs => FleetMemberData.Serialization.cs} (62%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ContainerServiceIPTag.Serialization.cs => FleetMemberListResult.Serialization.cs} (55%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{TrustedAccessRoleBindingListResult.cs => FleetMemberListResult.cs} (58%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ContainerServiceCreationData.Serialization.cs => FleetMemberPatch.Serialization.cs} (55%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ClusterUpgradeSettings.cs => FleetMemberPatch.cs} (71%) create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetMemberProvisioningState.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ContainerServiceTagsObject.Serialization.cs => FleetPatch.Serialization.cs} (61%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ContainerServiceTagsObject.cs => FleetPatch.cs} (73%) create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetProvisioningState.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ContainerServicePrivateEndpointConnectionData.Serialization.cs => FleetUpdateStrategyData.Serialization.cs} (59%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{MeshRevisionProfileProperties.Serialization.cs => FleetUpdateStrategyListResult.Serialization.cs} (57%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ContainerServiceSshConfiguration.cs => FleetUpdateStrategyListResult.cs} (56%) create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetUpdateStrategyProvisioningState.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/GpuInstanceProfile.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IPFamily.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioCertificateAuthority.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioCertificateAuthority.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioComponents.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioEgressGateway.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioEgressGateway.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioIngressGateway.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioIngressGatewayMode.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioPluginCertificateAuthority.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioPluginCertificateAuthority.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioServiceMesh.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioServiceMesh.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubeConfigFormat.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubeletConfig.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubeletConfig.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubeletDiskType.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesPatchVersion.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesSupportPlan.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersion.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersionCapabilities.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersionCapabilities.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersionListResult.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/LinuxOSConfig.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/LinuxOSConfig.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAadProfile.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAadProfile.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAccessProfile.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAddonProfile.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAddonProfile.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAddonProfileIdentity.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAddonProfileIdentity.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfileProperties.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfileProperties.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterApiServerAccessProfile.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterApiServerAccessProfile.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAutoScalerProfile.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAutoScalerProfile.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAutoUpgradeProfile.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAutoUpgradeProfile.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAzureMonitorProfile.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterDelegatedIdentity.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterHttpProxyConfig.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterHttpProxyConfig.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterKeyVaultNetworkAccessType.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterListResult.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterListResult.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerBackendPoolType.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfile.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfile.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileManagedOutboundIPs.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileManagedOutboundIPs.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPPrefixes.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPPrefixes.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPs.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPs.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterManagedOutboundIPProfile.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterManagedOutboundIPProfile.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterMonitorProfileKubeStateMetrics.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterMonitorProfileKubeStateMetrics.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterMonitorProfileMetrics.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterMonitorProfileMetrics.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNatGatewayProfile.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNatGatewayProfile.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNodeOSUpgradeChannel.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterOidcIssuerProfile.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterOidcIssuerProfile.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentity.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentity.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityException.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityException.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProfile.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProfile.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProvisioningError.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProvisioningError.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProvisioningInfo.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProvisioningState.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPoolUpgradeProfile.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPoolUpgradeProfile.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPoolUpgradeProfileUpgradesItem.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterRunCommandContent.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterRunCommandResult.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterRunCommandResult.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfile.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfile.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileDefender.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileDefender.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileDefenderSecurityMonitoring.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileDefenderSecurityMonitoring.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileImageCleaner.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileImageCleaner.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileKeyVaultKms.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileKeyVaultKms.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileWorkloadIdentity.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileWorkloadIdentity.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterServicePrincipalProfile.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSkuName.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSkuTier.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfile.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfile.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileBlobCsiDriver.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileBlobCsiDriver.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileDiskCsiDriver.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileDiskCsiDriver.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileFileCsiDriver.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileFileCsiDriver.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileSnapshotController.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileSnapshotController.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ManagedClusterAzureMonitorProfile.Serialization.cs => ManagedClusterUpdate.Serialization.cs} (55%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ManagedClusterServicePrincipalProfile.cs => ManagedClusterUpdate.cs} (55%) delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterUpgradeProfileData.Serialization.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ManagedClusterCredentials.Serialization.cs => ManagedClusterUpgradeSpec.Serialization.cs} (58%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ManagedClusterPoolUpgradeProfileUpgradesItem.cs => ManagedClusterUpgradeSpec.cs} (61%) create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterUpgradeType.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterVerticalPodAutoscaler.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterVerticalPodAutoscaler.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterWindowsProfile.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterWindowsProfile.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterWorkloadAutoScalerProfile.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterWorkloadAutoScalerProfile.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterWorkloadAutoScalerProfileKeda.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterWorkloadAutoScalerProfileKeda.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ManagedClusterDelegatedIdentity.Serialization.cs => ManagedServiceIdentity.Serialization.cs} (51%) create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedServiceIdentity.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedServiceIdentityType.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{CompatibleVersions.Serialization.cs => MemberUpdateStatus.Serialization.cs} (53%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ManagedClusterSku.cs => MemberUpdateStatus.cs} (53%) delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshRevision.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshRevisionProfileData.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshRevisionProfileList.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshUpgradeProfileData.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshUpgradeProfileList.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshUpgradeProfileProperties.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshUpgradeProfileProperties.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NetworkDataplane.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ServiceMeshProfile.Serialization.cs => NodeImageSelection.Serialization.cs} (58%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{DailySchedule.cs => NodeImageSelection.cs} (63%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ContainerServiceTimeSpan.Serialization.cs => NodeImageSelectionStatus.Serialization.cs} (58%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{KubernetesVersionListResult.cs => NodeImageSelectionStatus.cs} (66%) create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NodeImageSelectionType.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ContainerServiceSshPublicKey.Serialization.cs => NodeImageVersion.Serialization.cs} (56%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ContainerServicePowerState.cs => NodeImageVersion.cs} (70%) delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/OSOptionProfileData.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/OutboundEnvironmentEndpointListResult.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ScaleDownMode.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ScaleSetEvictionPolicy.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ScaleSetPriority.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ServiceMeshMode.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ContainerServicePowerState.Serialization.cs => SkipProperties.Serialization.cs} (54%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ServiceMeshProfile.cs => SkipProperties.cs} (67%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{IstioIngressGateway.Serialization.cs => SkipTarget.Serialization.cs} (55%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ManagedClusterRunCommandContent.cs => SkipTarget.cs} (52%) delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SnapshotType.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SysctlConfig.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SysctlConfig.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/TargetType.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/TrustedAccessRoleBindingListResult.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/TrustedAccessRoleListResult.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/TrustedAccessRoleListResult.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{DailySchedule.Serialization.cs => UpdateGroup.Serialization.cs} (59%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{CompatibleVersions.cs => UpdateGroup.cs} (61%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ContainerServiceTrustedAccessRole.Serialization.cs => UpdateGroupStatus.Serialization.cs} (55%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ContainerServicePrivateLinkServiceConnectionState.cs => UpdateGroupStatus.cs} (60%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ContainerServiceMaintenanceConfigurationData.Serialization.cs => UpdateRunData.Serialization.cs} (55%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{MeshRevisionProfileList.Serialization.cs => UpdateRunListResult.Serialization.cs} (55%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ContainerServiceMaintenanceConfigurationListResult.cs => UpdateRunListResult.cs} (59%) create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateRunProvisioningState.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{IstioComponents.Serialization.cs => UpdateRunStatus.Serialization.cs} (57%) create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateRunStatus.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ManagedClusterSku.Serialization.cs => UpdateRunStrategy.Serialization.cs} (57%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ContainerServiceSshPublicKey.cs => UpdateRunStrategy.cs} (57%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ContainerServiceTimeInWeek.Serialization.cs => UpdateStage.Serialization.cs} (54%) create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateStage.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{KubernetesVersion.Serialization.cs => UpdateStageStatus.Serialization.cs} (54%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{UpgradeOverrideSettings.cs => UpdateStageStatus.cs} (54%) create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateState.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{MeshRevision.Serialization.cs => UpdateStatus.Serialization.cs} (54%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ManagedClusterPodIdentityProvisioningInfo.cs => UpdateStatus.cs} (56%) delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpgradeChannel.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{UpgradeOverrideSettings.Serialization.cs => WaitStatus.Serialization.cs} (55%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{MeshRevisionProfileProperties.cs => WaitStatus.cs} (66%) delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/WindowsGmsaProfile.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/WindowsGmsaProfile.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/WindowsVmLicenseType.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/WorkloadRuntime.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/OSOptionProfileData.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/OSOptionProfileResource.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/FleetMembersRestOperations.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/{TrustedAccessRoleBindingsRestOperations.cs => FleetUpdateStrategiesRestOperations.cs} (58%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/{SnapshotsRestOperations.cs => FleetsRestOperations.cs} (62%) delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/MaintenanceConfigurationsRestOperations.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/ManagedClustersRestOperations.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/ResolvePrivateLinkServiceIdRestOperations.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/TrustedAccessRolesRestOperations.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/{AgentPoolsRestOperations.cs => UpdateRunsRestOperations.cs} (50%) create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/UpdateRunCollection.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/UpdateRunData.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/UpdateRunResource.cs diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotData.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotData.cs deleted file mode 100644 index 1bbf5325758a5..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotData.cs +++ /dev/null @@ -1,123 +0,0 @@ -// 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.ContainerService.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// A class representing the AgentPoolSnapshot data model. - /// A node pool snapshot resource. - /// - public partial class AgentPoolSnapshotData : 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 AgentPoolSnapshotData(AzureLocation location) : base(location) - { - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// CreationData to be used to specify the source agent pool resource ID to create this snapshot. - /// The type of a snapshot. The default is NodePool. - /// The version of Kubernetes. - /// The version of node image. - /// The operating system type. The default is Linux. - /// Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows. - /// The size of the VM. - /// Whether to use a FIPS-enabled OS. - /// Keeps track of any properties unknown to the library. - internal AgentPoolSnapshotData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ContainerServiceCreationData creationData, SnapshotType? snapshotType, string kubernetesVersion, string nodeImageVersion, ContainerServiceOSType? osType, ContainerServiceOSSku? osSku, string vmSize, bool? enableFips, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) - { - CreationData = creationData; - SnapshotType = snapshotType; - KubernetesVersion = kubernetesVersion; - NodeImageVersion = nodeImageVersion; - OSType = osType; - OSSku = osSku; - VmSize = vmSize; - EnableFips = enableFips; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal AgentPoolSnapshotData() - { - } - - /// CreationData to be used to specify the source agent pool resource ID to create this snapshot. - internal ContainerServiceCreationData CreationData { get; set; } - /// This is the ARM ID of the source object to be used to create the target object. - public ResourceIdentifier CreationDataSourceResourceId - { - get => CreationData is null ? default : CreationData.SourceResourceId; - set - { - if (CreationData is null) - CreationData = new ContainerServiceCreationData(); - CreationData.SourceResourceId = value; - } - } - - /// The type of a snapshot. The default is NodePool. - public SnapshotType? SnapshotType { get; set; } - /// The version of Kubernetes. - public string KubernetesVersion { get; } - /// The version of node image. - public string NodeImageVersion { get; } - /// The operating system type. The default is Linux. - public ContainerServiceOSType? OSType { get; } - /// Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows. - public ContainerServiceOSSku? OSSku { get; } - /// The size of the VM. - public string VmSize { get; } - /// Whether to use a FIPS-enabled OS. - public bool? EnableFips { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotResource.cs deleted file mode 100644 index a106360d89a2b..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotResource.cs +++ /dev/null @@ -1,701 +0,0 @@ -// 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; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.ContainerService.Models; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// A Class representing an AgentPoolSnapshot 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 GetAgentPoolSnapshotResource method. - /// Otherwise you can get one from its parent resource using the GetAgentPoolSnapshot method. - /// - public partial class AgentPoolSnapshotResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The resourceName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string resourceName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _agentPoolSnapshotSnapshotsClientDiagnostics; - private readonly SnapshotsRestOperations _agentPoolSnapshotSnapshotsRestClient; - private readonly AgentPoolSnapshotData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.ContainerService/snapshots"; - - /// Initializes a new instance of the class for mocking. - protected AgentPoolSnapshotResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal AgentPoolSnapshotResource(ArmClient client, AgentPoolSnapshotData 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 AgentPoolSnapshotResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _agentPoolSnapshotSnapshotsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string agentPoolSnapshotSnapshotsApiVersion); - _agentPoolSnapshotSnapshotsRestClient = new SnapshotsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, agentPoolSnapshotSnapshotsApiVersion); -#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 AgentPoolSnapshotData 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 snapshot. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName} - /// - /// - /// Operation Id - /// Snapshots_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotResource.Get"); - scope.Start(); - try - { - var response = await _agentPoolSnapshotSnapshotsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new AgentPoolSnapshotResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a snapshot. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName} - /// - /// - /// Operation Id - /// Snapshots_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotResource.Get"); - scope.Start(); - try - { - var response = _agentPoolSnapshotSnapshotsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new AgentPoolSnapshotResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deletes a snapshot. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName} - /// - /// - /// Operation Id - /// Snapshots_Delete - /// - /// - /// Default Api Version - /// 2023-10-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 cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotResource.Delete"); - scope.Start(); - try - { - var response = await _agentPoolSnapshotSnapshotsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(response); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deletes a snapshot. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName} - /// - /// - /// Operation Id - /// Snapshots_Delete - /// - /// - /// Default Api Version - /// 2023-10-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 cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotResource.Delete"); - scope.Start(); - try - { - var response = _agentPoolSnapshotSnapshotsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new ContainerServiceArmOperation(response); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Updates tags on a snapshot. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName} - /// - /// - /// Operation Id - /// Snapshots_UpdateTags - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// Parameters supplied to the Update snapshot Tags operation. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(ContainerServiceTagsObject containerServiceTagsObject, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(containerServiceTagsObject, nameof(containerServiceTagsObject)); - - using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotResource.Update"); - scope.Start(); - try - { - var response = await _agentPoolSnapshotSnapshotsRestClient.UpdateTagsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, containerServiceTagsObject, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new AgentPoolSnapshotResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Updates tags on a snapshot. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName} - /// - /// - /// Operation Id - /// Snapshots_UpdateTags - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// Parameters supplied to the Update snapshot Tags operation. - /// The cancellation token to use. - /// is null. - public virtual Response Update(ContainerServiceTagsObject containerServiceTagsObject, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(containerServiceTagsObject, nameof(containerServiceTagsObject)); - - using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotResource.Update"); - scope.Start(); - try - { - var response = _agentPoolSnapshotSnapshotsRestClient.UpdateTags(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, containerServiceTagsObject, cancellationToken); - return Response.FromValue(new AgentPoolSnapshotResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Add a tag to the current resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName} - /// - /// - /// Operation Id - /// Snapshots_Get - /// - /// - /// Default Api Version - /// 2023-10-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 = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotResource.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 _agentPoolSnapshotSnapshotsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new AgentPoolSnapshotResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new ContainerServiceTagsObject(); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags[key] = value; - var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return result; - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Add a tag to the current resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName} - /// - /// - /// Operation Id - /// Snapshots_Get - /// - /// - /// Default Api Version - /// 2023-10-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 = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotResource.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 = _agentPoolSnapshotSnapshotsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new AgentPoolSnapshotResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new ContainerServiceTagsObject(); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags[key] = value; - var result = Update(patch, cancellationToken: cancellationToken); - return result; - } - } - 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/snapshots/{resourceName} - /// - /// - /// Operation Id - /// Snapshots_Get - /// - /// - /// Default Api Version - /// 2023-10-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 = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotResource.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 _agentPoolSnapshotSnapshotsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new AgentPoolSnapshotResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new ContainerServiceTagsObject(); - patch.Tags.ReplaceWith(tags); - var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return result; - } - } - 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/snapshots/{resourceName} - /// - /// - /// Operation Id - /// Snapshots_Get - /// - /// - /// Default Api Version - /// 2023-10-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 = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotResource.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 = _agentPoolSnapshotSnapshotsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new AgentPoolSnapshotResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new ContainerServiceTagsObject(); - patch.Tags.ReplaceWith(tags); - var result = Update(patch, cancellationToken: cancellationToken); - return result; - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Removes a tag by key from the resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName} - /// - /// - /// Operation Id - /// Snapshots_Get - /// - /// - /// Default Api Version - /// 2023-10-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 = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotResource.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 _agentPoolSnapshotSnapshotsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new AgentPoolSnapshotResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new ContainerServiceTagsObject(); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags.Remove(key); - var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return result; - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Removes a tag by key from the resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName} - /// - /// - /// Operation Id - /// Snapshots_Get - /// - /// - /// Default Api Version - /// 2023-10-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 = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotResource.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 = _agentPoolSnapshotSnapshotsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new AgentPoolSnapshotResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new ContainerServiceTagsObject(); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags.Remove(key); - var result = Update(patch, cancellationToken: cancellationToken); - return result; - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileData.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileData.cs deleted file mode 100644 index 1269f3b9a22f1..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileData.cs +++ /dev/null @@ -1,100 +0,0 @@ -// 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.ContainerService.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// A class representing the AgentPoolUpgradeProfile data model. - /// The list of available upgrades for an agent pool. - /// - public partial class AgentPoolUpgradeProfileData : 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 . - /// The Kubernetes version (major.minor.patch). - /// The operating system type. The default is Linux. - /// is null. - internal AgentPoolUpgradeProfileData(string kubernetesVersion, ContainerServiceOSType osType) - { - Argument.AssertNotNull(kubernetesVersion, nameof(kubernetesVersion)); - - KubernetesVersion = kubernetesVersion; - OSType = osType; - Upgrades = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The Kubernetes version (major.minor.patch). - /// The operating system type. The default is Linux. - /// List of orchestrator types and versions available for upgrade. - /// The latest AKS supported node image version. - /// Keeps track of any properties unknown to the library. - internal AgentPoolUpgradeProfileData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string kubernetesVersion, ContainerServiceOSType osType, IReadOnlyList upgrades, string latestNodeImageVersion, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) - { - KubernetesVersion = kubernetesVersion; - OSType = osType; - Upgrades = upgrades; - LatestNodeImageVersion = latestNodeImageVersion; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal AgentPoolUpgradeProfileData() - { - } - - /// The Kubernetes version (major.minor.patch). - public string KubernetesVersion { get; } - /// The operating system type. The default is Linux. - public ContainerServiceOSType OSType { get; } - /// List of orchestrator types and versions available for upgrade. - public IReadOnlyList Upgrades { get; } - /// The latest AKS supported node image version. - public string LatestNodeImageVersion { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileResource.cs deleted file mode 100644 index 55c0ef154ea08..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileResource.cs +++ /dev/null @@ -1,173 +0,0 @@ -// 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; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// A Class representing an AgentPoolUpgradeProfile 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 GetAgentPoolUpgradeProfileResource method. - /// Otherwise you can get one from its parent resource using the GetAgentPoolUpgradeProfile method. - /// - public partial class AgentPoolUpgradeProfileResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The resourceName. - /// The agentPoolName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _agentPoolUpgradeProfileAgentPoolsClientDiagnostics; - private readonly AgentPoolsRestOperations _agentPoolUpgradeProfileAgentPoolsRestClient; - private readonly AgentPoolUpgradeProfileData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.ContainerService/managedClusters/agentPools/upgradeProfiles"; - - /// Initializes a new instance of the class for mocking. - protected AgentPoolUpgradeProfileResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal AgentPoolUpgradeProfileResource(ArmClient client, AgentPoolUpgradeProfileData 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 AgentPoolUpgradeProfileResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _agentPoolUpgradeProfileAgentPoolsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string agentPoolUpgradeProfileAgentPoolsApiVersion); - _agentPoolUpgradeProfileAgentPoolsRestClient = new AgentPoolsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, agentPoolUpgradeProfileAgentPoolsApiVersion); -#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 AgentPoolUpgradeProfileData 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 the upgrade profile for an agent pool. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default - /// - /// - /// Operation Id - /// AgentPools_GetUpgradeProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _agentPoolUpgradeProfileAgentPoolsClientDiagnostics.CreateScope("AgentPoolUpgradeProfileResource.Get"); - scope.Start(); - try - { - var response = await _agentPoolUpgradeProfileAgentPoolsRestClient.GetUpgradeProfileAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new AgentPoolUpgradeProfileResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the upgrade profile for an agent pool. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default - /// - /// - /// Operation Id - /// AgentPools_GetUpgradeProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _agentPoolUpgradeProfileAgentPoolsClientDiagnostics.CreateScope("AgentPoolUpgradeProfileResource.Get"); - scope.Start(); - try - { - var response = _agentPoolUpgradeProfileAgentPoolsRestClient.GetUpgradeProfile(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new AgentPoolUpgradeProfileResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ArmContainerServiceModelFactory.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ArmContainerServiceModelFactory.cs index 881b4813db6d0..eae9b756b2116 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ArmContainerServiceModelFactory.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ArmContainerServiceModelFactory.cs @@ -8,658 +8,210 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Net; using Azure; using Azure.Core; using Azure.ResourceManager.ContainerService; using Azure.ResourceManager.Models; -using Azure.ResourceManager.Resources.Models; namespace Azure.ResourceManager.ContainerService.Models { /// Model factory for models. public static partial class ArmContainerServiceModelFactory { - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The list of OS options. - /// A new instance for mocking. - public static OSOptionProfileData OSOptionProfileData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IEnumerable osOptionPropertyList = null) - { - osOptionPropertyList ??= new List(); - - return new OSOptionProfileData(id, name, resourceType, systemData, osOptionPropertyList?.ToList(), serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The OS type. - /// Whether the image is FIPS-enabled. - /// A new instance for mocking. - public static ContainerServiceOSOptionProperty ContainerServiceOSOptionProperty(string osType = null, bool enableFipsImage = default) - { - return new ContainerServiceOSOptionProperty(osType, enableFipsImage, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Array of AKS supported Kubernetes versions. - /// A new instance for mocking. - public static KubernetesVersionListResult KubernetesVersionListResult(IEnumerable values = null) - { - values ??= new List(); - - return new KubernetesVersionListResult(values?.ToList(), serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// major.minor version of Kubernetes release. - /// Capabilities on this Kubernetes version. - /// Whether this version is in preview mode. - /// Patch versions of Kubernetes release. - /// A new instance for mocking. - public static KubernetesVersion KubernetesVersion(string version = null, IEnumerable capabilitiesSupportPlan = null, bool? isPreview = null, IReadOnlyDictionary patchVersions = null) - { - capabilitiesSupportPlan ??= new List(); - patchVersions ??= new Dictionary(); - - return new KubernetesVersion(version, capabilitiesSupportPlan != null ? new KubernetesVersionCapabilities(capabilitiesSupportPlan?.ToList(), serializedAdditionalRawData: null) : null, isPreview, patchVersions, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Possible upgrade path for given patch version. - /// A new instance for mocking. - public static KubernetesPatchVersion KubernetesPatchVersion(IEnumerable upgrades = null) - { - upgrades ??= new List(); - - return new KubernetesPatchVersion(upgrades?.ToList(), serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. /// The tags. /// The location. - /// The managed cluster SKU. - /// The extended location of the Virtual Machine. - /// The identity of the managed cluster, if configured. - /// The current provisioning state. - /// The Power State of the cluster. - /// The max number of agent pools for the managed cluster. - /// Both patch version <major.minor.patch> (e.g. 1.20.13) and <major.minor> (e.g. 1.20) are supported. When <major.minor> is specified, the latest supported GA patch version is chosen automatically. Updating the cluster with the same <major.minor> once it has been created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. When you upgrade a supported AKS cluster, Kubernetes minor versions cannot be skipped. All upgrades must be performed sequentially by major version number. For example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, however 1.14.x -> 1.16.x is not allowed. See [upgrading an AKS cluster](https://docs.microsoft.com/azure/aks/upgrade-cluster) for more details. - /// If kubernetesVersion was a fully specified version <major.minor.patch>, this field will be exactly equal to it. If kubernetesVersion was <major.minor>, this field will contain the full <major.minor.patch> version being used. - /// This cannot be updated once the Managed Cluster has been created. - /// This cannot be updated once the Managed Cluster has been created. - /// The FQDN of the master pool. - /// The FQDN of private cluster. - /// The Azure Portal requires certain Cross-Origin Resource Sharing (CORS) headers to be sent in some responses, which Kubernetes APIServer doesn't handle by default. This special FQDN supports CORS, allowing the Azure Portal to function properly. - /// The agent pool properties. - /// The profile for Linux VMs in the Managed Cluster. - /// The profile for Windows VMs in the Managed Cluster. - /// Information about a service principal identity for the cluster to use for manipulating Azure APIs. - /// The profile of managed cluster add-on. - /// See [use AAD pod identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity) for more details on AAD pod identity integration. - /// The OIDC issuer profile of the Managed Cluster. - /// The name of the resource group containing agent pool nodes. - /// Whether to enable Kubernetes Role-Based Access Control. - /// The support plan for the Managed Cluster. If unspecified, the default is 'KubernetesOfficial'. - /// (DEPRECATED) Whether to enable Kubernetes pod security policy (preview). PodSecurityPolicy was deprecated in Kubernetes v1.21, and removed from Kubernetes in v1.25. Learn more at https://aka.ms/k8s/psp and https://aka.ms/aks/psp. - /// The network configuration profile. - /// The Azure Active Directory configuration. - /// The auto upgrade configuration. - /// Settings for upgrading a cluster. - /// Parameters to be applied to the cluster-autoscaler when enabled. - /// The access profile for managed cluster API server. - /// This is of the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. - /// Identities associated with the cluster. - /// Private link resources associated with the cluster. - /// If set to true, getting static credentials will be disabled for this cluster. This must only be used on Managed Clusters that are AAD enabled. For more details see [disable local accounts](https://docs.microsoft.com/azure/aks/managed-aad#disable-local-accounts-preview). - /// Configurations for provisioning the cluster with HTTP proxy servers. - /// Security profile for the managed cluster. - /// Storage profile for the managed cluster. - /// Allow or deny public network access for AKS. - /// Workload Auto-scaler profile for the managed cluster. - /// Azure Monitor addon profiles for monitoring the managed cluster. - /// Service mesh profile for a managed cluster. - /// The resourceUID uniquely identifies ManagedClusters that reuse ARM ResourceIds (i.e: create, delete, create sequence). - /// A new instance for mocking. - public static ContainerServiceManagedClusterData ContainerServiceManagedClusterData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedClusterSku sku = null, ExtendedLocation extendedLocation = null, ManagedClusterIdentity clusterIdentity = null, string provisioningState = null, ContainerServiceStateCode? powerStateCode = null, int? maxAgentPools = null, string kubernetesVersion = null, string currentKubernetesVersion = null, string dnsPrefix = null, string fqdnSubdomain = null, string fqdn = null, string privateFqdn = null, string azurePortalFqdn = null, IEnumerable agentPoolProfiles = null, ContainerServiceLinuxProfile linuxProfile = null, ManagedClusterWindowsProfile windowsProfile = null, ManagedClusterServicePrincipalProfile servicePrincipalProfile = null, IDictionary addonProfiles = null, ManagedClusterPodIdentityProfile podIdentityProfile = null, ManagedClusterOidcIssuerProfile oidcIssuerProfile = null, string nodeResourceGroup = null, bool? enableRbac = null, KubernetesSupportPlan? supportPlan = null, bool? enablePodSecurityPolicy = null, ContainerServiceNetworkProfile networkProfile = null, ManagedClusterAadProfile aadProfile = null, ManagedClusterAutoUpgradeProfile autoUpgradeProfile = null, UpgradeOverrideSettings upgradeOverrideSettings = null, ManagedClusterAutoScalerProfile autoScalerProfile = null, ManagedClusterApiServerAccessProfile apiServerAccessProfile = null, ResourceIdentifier diskEncryptionSetId = null, IDictionary identityProfile = null, IEnumerable privateLinkResources = null, bool? disableLocalAccounts = null, ManagedClusterHttpProxyConfig httpProxyConfig = null, ManagedClusterSecurityProfile securityProfile = null, ManagedClusterStorageProfile storageProfile = null, ContainerServicePublicNetworkAccess? publicNetworkAccess = null, ManagedClusterWorkloadAutoScalerProfile workloadAutoScalerProfile = null, ManagedClusterMonitorProfileMetrics azureMonitorMetrics = null, ServiceMeshProfile serviceMeshProfile = null, ResourceIdentifier resourceId = null) - { - tags ??= new Dictionary(); - agentPoolProfiles ??= new List(); - addonProfiles ??= new Dictionary(); - identityProfile ??= new Dictionary(); - privateLinkResources ??= new List(); - - return new ContainerServiceManagedClusterData(id, name, resourceType, systemData, tags, location, sku, extendedLocation, clusterIdentity, provisioningState, powerStateCode != null ? new ContainerServicePowerState(powerStateCode, serializedAdditionalRawData: null) : null, maxAgentPools, kubernetesVersion, currentKubernetesVersion, dnsPrefix, fqdnSubdomain, fqdn, privateFqdn, azurePortalFqdn, agentPoolProfiles?.ToList(), linuxProfile, windowsProfile, servicePrincipalProfile, addonProfiles, podIdentityProfile, oidcIssuerProfile, nodeResourceGroup, enableRbac, supportPlan, enablePodSecurityPolicy, networkProfile, aadProfile, autoUpgradeProfile, upgradeOverrideSettings != null ? new ClusterUpgradeSettings(upgradeOverrideSettings, serializedAdditionalRawData: null) : null, autoScalerProfile, apiServerAccessProfile, diskEncryptionSetId, identityProfile, privateLinkResources?.ToList(), disableLocalAccounts, httpProxyConfig, securityProfile, storageProfile, publicNetworkAccess, workloadAutoScalerProfile, azureMonitorMetrics != null ? new ManagedClusterAzureMonitorProfile(azureMonitorMetrics, serializedAdditionalRawData: null) : null, serviceMeshProfile, resourceId, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. - /// VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. - /// OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. - /// The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). - /// Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. - /// Determines the type of workload a node can run. - /// If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - /// If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - /// The maximum number of pods that can run on a node. - /// The operating system type. The default is Linux. - /// Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows. - /// The maximum number of nodes for auto-scaling. - /// The minimum number of nodes for auto-scaling. - /// Whether to enable auto-scaler. - /// This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. - /// The type of Agent Pool. - /// A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools. - /// Both patch version <major.minor.patch> (e.g. 1.20.13) and <major.minor> (e.g. 1.20) are supported. When <major.minor> is specified, the latest supported GA patch version is chosen automatically. Updating the cluster with the same <major.minor> once it has been created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). - /// If orchestratorVersion is a fully specified version <major.minor.patch>, this field will be exactly equal to it. If orchestratorVersion is <major.minor>, this field will contain the full <major.minor.patch> version being used. - /// The version of node image. - /// Settings for upgrading the agentpool. - /// The current deployment or provisioning state. - /// When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded. - /// The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. - /// Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). The default is false. - /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. - /// The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. - /// This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. - /// Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing). - /// The tags to be persisted on the agent pool virtual machine scale set. - /// The node labels to be persisted across all nodes in agent pool. - /// The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - /// The ID for Proximity Placement Group. - /// The Kubelet configuration on the agent pool nodes. - /// The OS configuration of Linux agent nodes. - /// This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption. - /// Whether to enable UltraSSD. - /// See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more details. - /// GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. - /// CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot. - /// AKS will associate the specified agent pool with the Capacity Reservation Group. - /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts). - /// Network-related settings of an agent pool. - /// Windows agent pool names must be 6 characters or less. - /// A new instance for mocking. - public static ManagedClusterAgentPoolProfile ManagedClusterAgentPoolProfile(int? count = null, string vmSize = null, int? osDiskSizeInGB = null, ContainerServiceOSDiskType? osDiskType = null, KubeletDiskType? kubeletDiskType = null, WorkloadRuntime? workloadRuntime = null, ResourceIdentifier vnetSubnetId = null, ResourceIdentifier podSubnetId = null, int? maxPods = null, ContainerServiceOSType? osType = null, ContainerServiceOSSku? osSku = null, int? maxCount = null, int? minCount = null, bool? enableAutoScaling = null, ScaleDownMode? scaleDownMode = null, AgentPoolType? agentPoolType = null, AgentPoolMode? mode = null, string orchestratorVersion = null, string currentOrchestratorVersion = null, string nodeImageVersion = null, AgentPoolUpgradeSettings upgradeSettings = null, string provisioningState = null, ContainerServiceStateCode? powerStateCode = null, IEnumerable availabilityZones = null, bool? enableNodePublicIP = null, ResourceIdentifier nodePublicIPPrefixId = null, ScaleSetPriority? scaleSetPriority = null, ScaleSetEvictionPolicy? scaleSetEvictionPolicy = null, float? spotMaxPrice = null, IDictionary tags = null, IDictionary nodeLabels = null, IEnumerable nodeTaints = null, ResourceIdentifier proximityPlacementGroupId = null, KubeletConfig kubeletConfig = null, LinuxOSConfig linuxOSConfig = null, bool? enableEncryptionAtHost = null, bool? enableUltraSsd = null, bool? enableFips = null, GpuInstanceProfile? gpuInstanceProfile = null, ResourceIdentifier creationDataSourceResourceId = null, ResourceIdentifier capacityReservationGroupId = null, ResourceIdentifier hostGroupId = null, AgentPoolNetworkProfile networkProfile = null, string name = null) - { - availabilityZones ??= new List(); - tags ??= new Dictionary(); - nodeLabels ??= new Dictionary(); - nodeTaints ??= new List(); - - return new ManagedClusterAgentPoolProfile(count, vmSize, osDiskSizeInGB, osDiskType, kubeletDiskType, workloadRuntime, vnetSubnetId, podSubnetId, maxPods, osType, osSku, maxCount, minCount, enableAutoScaling, scaleDownMode, agentPoolType, mode, orchestratorVersion, currentOrchestratorVersion, nodeImageVersion, upgradeSettings, provisioningState, powerStateCode != null ? new ContainerServicePowerState(powerStateCode, serializedAdditionalRawData: null) : null, availabilityZones?.ToList(), enableNodePublicIP, nodePublicIPPrefixId, scaleSetPriority, scaleSetEvictionPolicy, spotMaxPrice, tags, nodeLabels, nodeTaints?.ToList(), proximityPlacementGroupId, kubeletConfig, linuxOSConfig, enableEncryptionAtHost, enableUltraSsd, enableFips, gpuInstanceProfile, creationDataSourceResourceId != null ? new ContainerServiceCreationData(creationDataSourceResourceId, serializedAdditionalRawData: null) : null, capacityReservationGroupId, hostGroupId, networkProfile, serializedAdditionalRawData: null, name); - } - - /// Initializes a new instance of . - /// Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. - /// VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. - /// OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. - /// The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). - /// Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. - /// Determines the type of workload a node can run. - /// If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - /// If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - /// The maximum number of pods that can run on a node. - /// The operating system type. The default is Linux. - /// Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows. - /// The maximum number of nodes for auto-scaling. - /// The minimum number of nodes for auto-scaling. - /// Whether to enable auto-scaler. - /// This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. - /// The type of Agent Pool. - /// A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools. - /// Both patch version <major.minor.patch> (e.g. 1.20.13) and <major.minor> (e.g. 1.20) are supported. When <major.minor> is specified, the latest supported GA patch version is chosen automatically. Updating the cluster with the same <major.minor> once it has been created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). - /// If orchestratorVersion is a fully specified version <major.minor.patch>, this field will be exactly equal to it. If orchestratorVersion is <major.minor>, this field will contain the full <major.minor.patch> version being used. - /// The version of node image. - /// Settings for upgrading the agentpool. - /// The current deployment or provisioning state. - /// When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded. - /// The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. - /// Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). The default is false. - /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. - /// The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. - /// This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. - /// Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing). - /// The tags to be persisted on the agent pool virtual machine scale set. - /// The node labels to be persisted across all nodes in agent pool. - /// The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - /// The ID for Proximity Placement Group. - /// The Kubelet configuration on the agent pool nodes. - /// The OS configuration of Linux agent nodes. - /// This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption. - /// Whether to enable UltraSSD. - /// See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more details. - /// GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. - /// CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot. - /// AKS will associate the specified agent pool with the Capacity Reservation Group. - /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts). - /// Network-related settings of an agent pool. - /// A new instance for mocking. - public static ManagedClusterAgentPoolProfileProperties ManagedClusterAgentPoolProfileProperties(int? count = null, string vmSize = null, int? osDiskSizeInGB = null, ContainerServiceOSDiskType? osDiskType = null, KubeletDiskType? kubeletDiskType = null, WorkloadRuntime? workloadRuntime = null, ResourceIdentifier vnetSubnetId = null, ResourceIdentifier podSubnetId = null, int? maxPods = null, ContainerServiceOSType? osType = null, ContainerServiceOSSku? osSku = null, int? maxCount = null, int? minCount = null, bool? enableAutoScaling = null, ScaleDownMode? scaleDownMode = null, AgentPoolType? agentPoolType = null, AgentPoolMode? mode = null, string orchestratorVersion = null, string currentOrchestratorVersion = null, string nodeImageVersion = null, AgentPoolUpgradeSettings upgradeSettings = null, string provisioningState = null, ContainerServiceStateCode? powerStateCode = null, IEnumerable availabilityZones = null, bool? enableNodePublicIP = null, ResourceIdentifier nodePublicIPPrefixId = null, ScaleSetPriority? scaleSetPriority = null, ScaleSetEvictionPolicy? scaleSetEvictionPolicy = null, float? spotMaxPrice = null, IDictionary tags = null, IDictionary nodeLabels = null, IEnumerable nodeTaints = null, ResourceIdentifier proximityPlacementGroupId = null, KubeletConfig kubeletConfig = null, LinuxOSConfig linuxOSConfig = null, bool? enableEncryptionAtHost = null, bool? enableUltraSsd = null, bool? enableFips = null, GpuInstanceProfile? gpuInstanceProfile = null, ResourceIdentifier creationDataSourceResourceId = null, ResourceIdentifier capacityReservationGroupId = null, ResourceIdentifier hostGroupId = null, AgentPoolNetworkProfile networkProfile = null) + /// 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. + /// The status of the last operation. + /// The FleetHubProfile configures the Fleet's hub. + /// 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, ETag? eTag = null, ResourceManager.Models.ManagedServiceIdentity identity = null, FleetProvisioningState? provisioningState = null, FleetHubProfile hubProfile = null) { - availabilityZones ??= new List(); tags ??= new Dictionary(); - nodeLabels ??= new Dictionary(); - nodeTaints ??= new List(); - - return new ManagedClusterAgentPoolProfileProperties(count, vmSize, osDiskSizeInGB, osDiskType, kubeletDiskType, workloadRuntime, vnetSubnetId, podSubnetId, maxPods, osType, osSku, maxCount, minCount, enableAutoScaling, scaleDownMode, agentPoolType, mode, orchestratorVersion, currentOrchestratorVersion, nodeImageVersion, upgradeSettings, provisioningState, powerStateCode != null ? new ContainerServicePowerState(powerStateCode, serializedAdditionalRawData: null) : null, availabilityZones?.ToList(), enableNodePublicIP, nodePublicIPPrefixId, scaleSetPriority, scaleSetEvictionPolicy, spotMaxPrice, tags, nodeLabels, nodeTaints?.ToList(), proximityPlacementGroupId, kubeletConfig, linuxOSConfig, enableEncryptionAtHost, enableUltraSsd, enableFips, gpuInstanceProfile, creationDataSourceResourceId != null ? new ContainerServiceCreationData(creationDataSourceResourceId, serializedAdditionalRawData: null) : null, capacityReservationGroupId, hostGroupId, networkProfile, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Whether the add-on is enabled or not. - /// Key-value pairs for configuring an add-on. - /// Information of user assigned identity used by this add-on. - /// A new instance for mocking. - public static ManagedClusterAddonProfile ManagedClusterAddonProfile(bool isEnabled = default, IDictionary config = null, ManagedClusterAddonProfileIdentity identity = null) - { - config ??= new Dictionary(); - - return new ManagedClusterAddonProfile(isEnabled, config, identity, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The name of the pod identity. - /// The namespace of the pod identity. - /// The binding selector to use for the AzureIdentityBinding resource. - /// The user assigned identity details. - /// The current provisioning state of the pod identity. - /// - /// A new instance for mocking. - public static ManagedClusterPodIdentity ManagedClusterPodIdentity(string name = null, string @namespace = null, string bindingSelector = null, ContainerServiceUserAssignedIdentity identity = null, ManagedClusterPodIdentityProvisioningState? provisioningState = null, ResponseError errorDetail = null) - { - return new ManagedClusterPodIdentity(name, @namespace, bindingSelector, identity, provisioningState, errorDetail != null ? new ManagedClusterPodIdentityProvisioningInfo(new ManagedClusterPodIdentityProvisioningError(errorDetail, serializedAdditionalRawData: null), serializedAdditionalRawData: null) : null, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The OIDC issuer url of the Managed Cluster. - /// Whether the OIDC issuer is enabled. - /// A new instance for mocking. - public static ManagedClusterOidcIssuerProfile ManagedClusterOidcIssuerProfile(string issuerUriInfo = null, bool? isEnabled = null) - { - return new ManagedClusterOidcIssuerProfile(issuerUriInfo, isEnabled, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The ID of the private link resource. - /// The name of the private link resource. - /// The resource type. - /// The group ID of the resource. - /// The RequiredMembers of the resource. - /// The private link service ID of the resource, this field is exposed only to NRP internally. - /// A new instance for mocking. - public static ContainerServicePrivateLinkResourceData ContainerServicePrivateLinkResourceData(ResourceIdentifier id = null, string name = null, ResourceType? resourceType = null, string groupId = null, IEnumerable requiredMembers = null, ResourceIdentifier privateLinkServiceId = null) - { - requiredMembers ??= new List(); - - return new ContainerServicePrivateLinkResourceData(id, name, resourceType, groupId, requiredMembers?.ToList(), privateLinkServiceId, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The list of available upgrade versions for the control plane. - /// The list of available upgrade versions for agent pools. - /// A new instance for mocking. - public static ManagedClusterUpgradeProfileData ManagedClusterUpgradeProfileData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ManagedClusterPoolUpgradeProfile controlPlaneProfile = null, IEnumerable agentPoolProfiles = null) - { - agentPoolProfiles ??= new List(); - - return new ManagedClusterUpgradeProfileData(id, name, resourceType, systemData, controlPlaneProfile, agentPoolProfiles?.ToList(), serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The Kubernetes version (major.minor.patch). - /// The Agent Pool name. - /// The operating system type. The default is Linux. - /// List of orchestrator types and versions available for upgrade. - /// A new instance for mocking. - public static ManagedClusterPoolUpgradeProfile ManagedClusterPoolUpgradeProfile(string kubernetesVersion = null, string name = null, ContainerServiceOSType osType = default, IEnumerable upgrades = null) - { - upgrades ??= new List(); - - return new ManagedClusterPoolUpgradeProfile(kubernetesVersion, name, osType, upgrades?.ToList(), serializedAdditionalRawData: null); - } - /// Initializes a new instance of . - /// The Kubernetes version (major.minor.patch). - /// Whether the Kubernetes version is currently in preview. - /// A new instance for mocking. - public static ManagedClusterPoolUpgradeProfileUpgradesItem ManagedClusterPoolUpgradeProfileUpgradesItem(string kubernetesVersion = null, bool? isPreview = null) - { - return new ManagedClusterPoolUpgradeProfileUpgradesItem(kubernetesVersion, isPreview, serializedAdditionalRawData: null); + return new FleetData(id, name, resourceType, systemData, tags, location, eTag, identity, provisioningState, hubProfile, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// Base64-encoded Kubernetes configuration file. - /// A new instance for mocking. - public static ManagedClusterAccessProfile ManagedClusterAccessProfile(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, byte[] kubeConfig = 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) { - tags ??= new Dictionary(); - - return new ManagedClusterAccessProfile(id, name, resourceType, systemData, tags, location, kubeConfig, serializedAdditionalRawData: null); + return new FleetHubProfile(dnsPrefix, apiServerAccessProfile, agentProfile, fqdn, kubernetesVersion, portalFqdn, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Base64-encoded Kubernetes configuration file. - /// A new instance for mocking. - public static ManagedClusterCredentials ManagedClusterCredentials(IEnumerable kubeconfigs = 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(); + kubeconfigs ??= new List(); - return new ManagedClusterCredentials(kubeconfigs?.ToList(), serializedAdditionalRawData: null); + return new FleetCredentialResults(kubeconfigs?.ToList(), serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The name of the credential. /// Base64-encoded Kubernetes configuration file. - /// A new instance for mocking. - public static ManagedClusterCredential ManagedClusterCredential(string name = null, byte[] value = null) - { - return new ManagedClusterCredential(name, value, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// If two array entries specify the same day of the week, the applied configuration is the union of times in both entries. - /// Time slots on which upgrade is not allowed. - /// Maintenance window for the maintenance configuration. - /// A new instance for mocking. - public static ContainerServiceMaintenanceConfigurationData ContainerServiceMaintenanceConfigurationData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IEnumerable timesInWeek = null, IEnumerable notAllowedTimes = null, ContainerServiceMaintenanceWindow maintenanceWindow = null) - { - timesInWeek ??= new List(); - notAllowedTimes ??= new List(); - - return new ContainerServiceMaintenanceConfigurationData(id, name, resourceType, systemData, timesInWeek?.ToList(), notAllowedTimes?.ToList(), maintenanceWindow, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. - /// VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. - /// OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. - /// The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). - /// Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. - /// Determines the type of workload a node can run. - /// If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - /// If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - /// The maximum number of pods that can run on a node. - /// The operating system type. The default is Linux. - /// Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows. - /// The maximum number of nodes for auto-scaling. - /// The minimum number of nodes for auto-scaling. - /// Whether to enable auto-scaler. - /// This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. - /// The type of Agent Pool. - /// A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools. - /// Both patch version <major.minor.patch> (e.g. 1.20.13) and <major.minor> (e.g. 1.20) are supported. When <major.minor> is specified, the latest supported GA patch version is chosen automatically. Updating the cluster with the same <major.minor> once it has been created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). - /// If orchestratorVersion is a fully specified version <major.minor.patch>, this field will be exactly equal to it. If orchestratorVersion is <major.minor>, this field will contain the full <major.minor.patch> version being used. - /// The version of node image. - /// Settings for upgrading the agentpool. - /// The current deployment or provisioning state. - /// When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded. - /// The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. - /// Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). The default is false. - /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. - /// The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. - /// This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. - /// Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing). - /// The tags to be persisted on the agent pool virtual machine scale set. - /// The node labels to be persisted across all nodes in agent pool. - /// The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - /// The ID for Proximity Placement Group. - /// The Kubelet configuration on the agent pool nodes. - /// The OS configuration of Linux agent nodes. - /// This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption. - /// Whether to enable UltraSSD. - /// See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more details. - /// GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. - /// CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot. - /// AKS will associate the specified agent pool with the Capacity Reservation Group. - /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts). - /// Network-related settings of an agent pool. - /// A new instance for mocking. - public static ContainerServiceAgentPoolData ContainerServiceAgentPoolData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, int? count = null, string vmSize = null, int? osDiskSizeInGB = null, ContainerServiceOSDiskType? osDiskType = null, KubeletDiskType? kubeletDiskType = null, WorkloadRuntime? workloadRuntime = null, ResourceIdentifier vnetSubnetId = null, ResourceIdentifier podSubnetId = null, int? maxPods = null, ContainerServiceOSType? osType = null, ContainerServiceOSSku? osSku = null, int? maxCount = null, int? minCount = null, bool? enableAutoScaling = null, ScaleDownMode? scaleDownMode = null, AgentPoolType? typePropertiesType = null, AgentPoolMode? mode = null, string orchestratorVersion = null, string currentOrchestratorVersion = null, string nodeImageVersion = null, AgentPoolUpgradeSettings upgradeSettings = null, string provisioningState = null, ContainerServiceStateCode? powerStateCode = null, IEnumerable availabilityZones = null, bool? enableNodePublicIP = null, ResourceIdentifier nodePublicIPPrefixId = null, ScaleSetPriority? scaleSetPriority = null, ScaleSetEvictionPolicy? scaleSetEvictionPolicy = null, float? spotMaxPrice = null, IDictionary tags = null, IDictionary nodeLabels = null, IEnumerable nodeTaints = null, ResourceIdentifier proximityPlacementGroupId = null, KubeletConfig kubeletConfig = null, LinuxOSConfig linuxOSConfig = null, bool? enableEncryptionAtHost = null, bool? enableUltraSsd = null, bool? enableFips = null, GpuInstanceProfile? gpuInstanceProfile = null, ResourceIdentifier creationDataSourceResourceId = null, ResourceIdentifier capacityReservationGroupId = null, ResourceIdentifier hostGroupId = null, AgentPoolNetworkProfile networkProfile = null) + /// A new instance for mocking. + public static FleetCredentialResult FleetCredentialResult(string name = null, byte[] value = null) { - availabilityZones ??= new List(); - tags ??= new Dictionary(); - nodeLabels ??= new Dictionary(); - nodeTaints ??= new List(); - - return new ContainerServiceAgentPoolData(id, name, resourceType, systemData, count, vmSize, osDiskSizeInGB, osDiskType, kubeletDiskType, workloadRuntime, vnetSubnetId, podSubnetId, maxPods, osType, osSku, maxCount, minCount, enableAutoScaling, scaleDownMode, typePropertiesType, mode, orchestratorVersion, currentOrchestratorVersion, nodeImageVersion, upgradeSettings, provisioningState, powerStateCode != null ? new ContainerServicePowerState(powerStateCode, serializedAdditionalRawData: null) : null, availabilityZones?.ToList(), enableNodePublicIP, nodePublicIPPrefixId, scaleSetPriority, scaleSetEvictionPolicy, spotMaxPrice, tags, nodeLabels, nodeTaints?.ToList(), proximityPlacementGroupId, kubeletConfig, linuxOSConfig, enableEncryptionAtHost, enableUltraSsd, enableFips, gpuInstanceProfile, creationDataSourceResourceId != null ? new ContainerServiceCreationData(creationDataSourceResourceId, serializedAdditionalRawData: null) : null, capacityReservationGroupId, hostGroupId, networkProfile, serializedAdditionalRawData: null); + return new FleetCredentialResult(name, value, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. - /// The Kubernetes version (major.minor.patch). - /// The operating system type. The default is Linux. - /// List of orchestrator types and versions available for upgrade. - /// The latest AKS supported node image version. - /// A new instance for mocking. - public static AgentPoolUpgradeProfileData AgentPoolUpgradeProfileData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string kubernetesVersion = null, ContainerServiceOSType osType = default, IEnumerable upgrades = null, string latestNodeImageVersion = null) - { - upgrades ??= new List(); - - return new AgentPoolUpgradeProfileData(id, name, resourceType, systemData, kubernetesVersion, osType, upgrades?.ToList(), latestNodeImageVersion, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The Kubernetes version (major.minor.patch). - /// Whether the Kubernetes version is currently in preview. - /// A new instance for mocking. - public static AgentPoolUpgradeProfilePropertiesUpgradesItem AgentPoolUpgradeProfilePropertiesUpgradesItem(string kubernetesVersion = null, bool? isPreview = null) + /// 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. + /// 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. + /// A new instance for mocking. + public static FleetMemberData FleetMemberData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ETag? eTag = null, ResourceIdentifier clusterResourceId = null, string group = null, FleetMemberProvisioningState? provisioningState = null) { - return new AgentPoolUpgradeProfilePropertiesUpgradesItem(kubernetesVersion, isPreview, serializedAdditionalRawData: null); + return new FleetMemberData(id, name, resourceType, systemData, eTag, clusterResourceId, group, provisioningState, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. - /// List of versions available for agent pool. - /// A new instance for mocking. - public static AgentPoolAvailableVersions AgentPoolAvailableVersions(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IEnumerable agentPoolVersions = null) + /// 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. + /// 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. + /// A new instance for mocking. + public static UpdateRunData UpdateRunData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ETag? eTag = null, UpdateRunProvisioningState? provisioningState = null, ResourceIdentifier updateStrategyId = null, IEnumerable strategyStages = null, ManagedClusterUpdate managedClusterUpdate = null, UpdateRunStatus status = null) { - agentPoolVersions ??= new List(); - - return new AgentPoolAvailableVersions(id, name, resourceType, systemData, agentPoolVersions?.ToList(), serializedAdditionalRawData: null); - } + strategyStages ??= new List(); - /// Initializes a new instance of . - /// Whether this version is the default agent pool version. - /// The Kubernetes version (major.minor.patch). - /// Whether Kubernetes version is currently in preview. - /// A new instance for mocking. - public static AgentPoolAvailableVersion AgentPoolAvailableVersion(bool? isDefault = null, string kubernetesVersion = null, bool? isPreview = null) - { - return new AgentPoolAvailableVersion(isDefault, kubernetesVersion, isPreview, serializedAdditionalRawData: null); + return new UpdateRunData(id, name, resourceType, systemData, eTag, provisioningState, updateStrategyId, strategyStages != null ? new UpdateRunStrategy(strategyStages?.ToList(), serializedAdditionalRawData: null) : null, managedClusterUpdate, status, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The current provisioning state. - /// The resource of private endpoint. - /// A collection of information about the state of the connection between service consumer and provider. - /// A new instance for mocking. - public static ContainerServicePrivateEndpointConnectionData ContainerServicePrivateEndpointConnectionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ContainerServicePrivateEndpointConnectionProvisioningState? provisioningState = null, ResourceIdentifier privateEndpointId = null, ContainerServicePrivateLinkServiceConnectionState connectionState = 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) { - return new ContainerServicePrivateEndpointConnectionData(id, name, resourceType, systemData, provisioningState, privateEndpointId != null ? ResourceManagerModelFactory.WritableSubResource(privateEndpointId) : null, connectionState, serializedAdditionalRawData: null); - } + stages ??= new List(); + selectedNodeImageVersions ??= new List(); - /// Initializes a new instance of . - /// The command to run. - /// A base64 encoded zip file containing the files required by the command. - /// AuthToken issued for AKS AAD Server App. - /// A new instance for mocking. - public static ManagedClusterRunCommandContent ManagedClusterRunCommandContent(string command = null, string context = null, string clusterToken = null) - { - return new ManagedClusterRunCommandContent(command, context, clusterToken, serializedAdditionalRawData: null); + return new UpdateRunStatus(status, stages?.ToList(), selectedNodeImageVersions != null ? new NodeImageSelectionStatus(selectedNodeImageVersions?.ToList(), serializedAdditionalRawData: null) : null, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The command id. - /// provisioning State. - /// The exit code of the command. - /// The time when the command started. - /// The time when the command finished. - /// The command output. - /// An explanation of why provisioningState is set to failed (if so). - /// A new instance for mocking. - public static ManagedClusterRunCommandResult ManagedClusterRunCommandResult(string id = null, string provisioningState = null, int? exitCode = null, DateTimeOffset? startedOn = null, DateTimeOffset? finishedOn = null, string logs = null, string reason = 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 ManagedClusterRunCommandResult(id, provisioningState, exitCode, startedOn, finishedOn, logs, reason, serializedAdditionalRawData: null); + return new UpdateStatus(startOn, completedOn, state, error, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The category of endpoints accessed by the AKS agent node, e.g. azure-resource-management, apiserver, etc. - /// The endpoints that AKS agent nodes connect to. - /// A new instance for mocking. - public static ContainerServiceOutboundEnvironmentEndpoint ContainerServiceOutboundEnvironmentEndpoint(string category = null, IEnumerable endpoints = 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) { - endpoints ??= new List(); + groups ??= new List(); - return new ContainerServiceOutboundEnvironmentEndpoint(category, endpoints?.ToList(), serializedAdditionalRawData: null); + return new UpdateStageStatus(status, name, groups?.ToList(), afterStageWaitStatus, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The domain name of the dependency. - /// The Ports and Protocols used when connecting to domainName. - /// A new instance for mocking. - public static ContainerServiceEndpointDependency ContainerServiceEndpointDependency(string domainName = null, IEnumerable endpointDetails = 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) { - endpointDetails ??= new List(); + members ??= new List(); - return new ContainerServiceEndpointDependency(domainName, endpointDetails?.ToList(), serializedAdditionalRawData: null); + return new UpdateGroupStatus(status, name, members?.ToList(), serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// An IP Address that Domain Name currently resolves to. - /// The port an endpoint is connected to. - /// The protocol used for connection. - /// Description of the detail. - /// A new instance for mocking. - public static ContainerServiceEndpointDetail ContainerServiceEndpointDetail(IPAddress ipAddress = null, int? port = null, string protocol = null, string description = null) - { - return new ContainerServiceEndpointDetail(ipAddress, port, protocol, description, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// CreationData to be used to specify the source agent pool resource ID to create this snapshot. - /// The type of a snapshot. The default is NodePool. - /// The version of Kubernetes. - /// The version of node image. - /// The operating system type. The default is Linux. - /// Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows. - /// The size of the VM. - /// Whether to use a FIPS-enabled OS. - /// A new instance for mocking. - public static AgentPoolSnapshotData AgentPoolSnapshotData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ResourceIdentifier creationDataSourceResourceId = null, SnapshotType? snapshotType = null, string kubernetesVersion = null, string nodeImageVersion = null, ContainerServiceOSType? osType = null, ContainerServiceOSSku? osSku = null, string vmSize = null, bool? enableFips = 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, ResourceIdentifier clusterResourceId = null, string operationId = null, string message = null) { - tags ??= new Dictionary(); - - return new AgentPoolSnapshotData(id, name, resourceType, systemData, tags, location, creationDataSourceResourceId != null ? new ContainerServiceCreationData(creationDataSourceResourceId, serializedAdditionalRawData: null) : null, snapshotType, kubernetesVersion, nodeImageVersion, osType, osSku, vmSize, enableFips, serializedAdditionalRawData: null); + return new MemberUpdateStatus(status, name, clusterResourceId, operationId, message, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Mesh revision profile properties for a mesh. - /// A new instance for mocking. - public static MeshRevisionProfileData MeshRevisionProfileData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IEnumerable meshRevisions = 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) { - meshRevisions ??= new List(); - - return new MeshRevisionProfileData(id, name, resourceType, systemData, meshRevisions != null ? new MeshRevisionProfileProperties(meshRevisions?.ToList(), serializedAdditionalRawData: null) : null, serializedAdditionalRawData: null); + return new WaitStatus(status, waitDurationInSeconds, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Mesh upgrade profile properties for a major.minor release. - /// A new instance for mocking. - public static MeshUpgradeProfileData MeshUpgradeProfileData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MeshUpgradeProfileProperties properties = 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 MeshUpgradeProfileData(id, name, resourceType, systemData, properties, serializedAdditionalRawData: null); + return new NodeImageVersion(version, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. - /// The current provisioning state of trusted access role binding. - /// The ARM resource ID of source resource that trusted access is configured for. - /// A list of roles to bind, each item is a resource type qualified role name. For example: 'Microsoft.MachineLearningServices/workspaces/reader'. - /// A new instance for mocking. - public static ContainerServiceTrustedAccessRoleBindingData ContainerServiceTrustedAccessRoleBindingData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ContainerServiceTrustedAccessRoleBindingProvisioningState? provisioningState = null, ResourceIdentifier sourceResourceId = null, IEnumerable roles = null) - { - roles ??= new List(); - - return new ContainerServiceTrustedAccessRoleBindingData(id, name, resourceType, systemData, provisioningState, sourceResourceId, roles?.ToList(), serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Resource type of Azure resource. - /// Name of role, name is unique under a source resource type. - /// List of rules for the role. This maps to 'rules' property of [Kubernetes Cluster Role](https://kubernetes.io/docs/reference/kubernetes-api/authorization-resources/cluster-role-v1/#ClusterRole). - /// A new instance for mocking. - public static ContainerServiceTrustedAccessRole ContainerServiceTrustedAccessRole(string sourceResourceType = null, string name = null, IEnumerable rules = null) - { - rules ??= new List(); - - return new ContainerServiceTrustedAccessRole(sourceResourceType, name, rules?.ToList(), serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// List of allowed verbs. - /// List of allowed apiGroups. - /// List of allowed resources. - /// List of allowed names. - /// List of allowed nonResourceURLs. - /// A new instance for mocking. - public static ContainerServiceTrustedAccessRoleRule ContainerServiceTrustedAccessRoleRule(IEnumerable verbs = null, IEnumerable apiGroups = null, IEnumerable resources = null, IEnumerable resourceNames = null, IEnumerable nonResourceUrls = null) + /// 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. + /// The provisioning state of the UpdateStrategy resource. + /// Defines the update sequence of the clusters. + /// A new instance for mocking. + public static FleetUpdateStrategyData FleetUpdateStrategyData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ETag? eTag = null, FleetUpdateStrategyProvisioningState? provisioningState = null, IEnumerable strategyStages = null) { - verbs ??= new List(); - apiGroups ??= new List(); - resources ??= new List(); - resourceNames ??= new List(); - nonResourceUrls ??= new List(); + strategyStages ??= new List(); - return new ContainerServiceTrustedAccessRoleRule(verbs?.ToList(), apiGroups?.ToList(), resources?.ToList(), resourceNames?.ToList(), nonResourceUrls?.ToList(), serializedAdditionalRawData: null); + return new FleetUpdateStrategyData(id, name, resourceType, systemData, eTag, provisioningState, strategyStages != null ? new UpdateRunStrategy(strategyStages?.ToList(), serializedAdditionalRawData: null) : null, serializedAdditionalRawData: null); } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolCollection.cs deleted file mode 100644 index 3a3f3f978ced2..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolCollection.cs +++ /dev/null @@ -1,495 +0,0 @@ -// 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; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// 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 GetContainerServiceAgentPools method from an instance of . - /// - public partial class ContainerServiceAgentPoolCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _containerServiceAgentPoolAgentPoolsClientDiagnostics; - private readonly AgentPoolsRestOperations _containerServiceAgentPoolAgentPoolsRestClient; - - /// Initializes a new instance of the class for mocking. - protected ContainerServiceAgentPoolCollection() - { - } - - /// 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 ContainerServiceAgentPoolCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _containerServiceAgentPoolAgentPoolsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ContainerServiceAgentPoolResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ContainerServiceAgentPoolResource.ResourceType, out string containerServiceAgentPoolAgentPoolsApiVersion); - _containerServiceAgentPoolAgentPoolsRestClient = new AgentPoolsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerServiceAgentPoolAgentPoolsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ContainerServiceManagedClusterResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ContainerServiceManagedClusterResource.ResourceType), nameof(id)); - } - - /// - /// Creates or updates an agent pool in the specified managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName} - /// - /// - /// Operation Id - /// AgentPools_CreateOrUpdate - /// - /// - /// Default Api Version - /// 2023-10-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 agent pool. - /// The agent pool to create or update. - /// 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 agentPoolName, ContainerServiceAgentPoolData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _containerServiceAgentPoolAgentPoolsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, data, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(new ContainerServiceAgentPoolOperationSource(Client), _containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, data).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2017-08-31"); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or updates an agent pool in the specified managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName} - /// - /// - /// Operation Id - /// AgentPools_CreateOrUpdate - /// - /// - /// Default Api Version - /// 2023-10-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 agent pool. - /// The agent pool to create or update. - /// 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 agentPoolName, ContainerServiceAgentPoolData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _containerServiceAgentPoolAgentPoolsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, data, cancellationToken); - var operation = new ContainerServiceArmOperation(new ContainerServiceAgentPoolOperationSource(Client), _containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, data).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2017-08-31"); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the specified managed cluster agent pool. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName} - /// - /// - /// Operation Id - /// AgentPools_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the agent pool. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string agentPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); - - using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolCollection.Get"); - scope.Start(); - try - { - var response = await _containerServiceAgentPoolAgentPoolsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ContainerServiceAgentPoolResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the specified managed cluster agent pool. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName} - /// - /// - /// Operation Id - /// AgentPools_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the agent pool. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string agentPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); - - using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolCollection.Get"); - scope.Start(); - try - { - var response = _containerServiceAgentPoolAgentPoolsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ContainerServiceAgentPoolResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a list of agent pools in the specified managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools - /// - /// - /// Operation Id - /// AgentPools_List - /// - /// - /// Default Api Version - /// 2023-10-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) => _containerServiceAgentPoolAgentPoolsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerServiceAgentPoolAgentPoolsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerServiceAgentPoolResource(Client, ContainerServiceAgentPoolData.DeserializeContainerServiceAgentPoolData(e)), _containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, "ContainerServiceAgentPoolCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Gets a list of agent pools in the specified managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools - /// - /// - /// Operation Id - /// AgentPools_List - /// - /// - /// Default Api Version - /// 2023-10-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) => _containerServiceAgentPoolAgentPoolsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerServiceAgentPoolAgentPoolsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerServiceAgentPoolResource(Client, ContainerServiceAgentPoolData.DeserializeContainerServiceAgentPoolData(e)), _containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, "ContainerServiceAgentPoolCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName} - /// - /// - /// Operation Id - /// AgentPools_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the agent pool. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string agentPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); - - using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolCollection.Exists"); - scope.Start(); - try - { - var response = await _containerServiceAgentPoolAgentPoolsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, 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/managedClusters/{resourceName}/agentPools/{agentPoolName} - /// - /// - /// Operation Id - /// AgentPools_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the agent pool. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string agentPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); - - using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolCollection.Exists"); - scope.Start(); - try - { - var response = _containerServiceAgentPoolAgentPoolsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, 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/managedClusters/{resourceName}/agentPools/{agentPoolName} - /// - /// - /// Operation Id - /// AgentPools_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the agent pool. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetIfExistsAsync(string agentPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); - - using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolCollection.GetIfExists"); - scope.Start(); - try - { - var response = await _containerServiceAgentPoolAgentPoolsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, cancellationToken: cancellationToken).ConfigureAwait(false); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new ContainerServiceAgentPoolResource(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/managedClusters/{resourceName}/agentPools/{agentPoolName} - /// - /// - /// Operation Id - /// AgentPools_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the agent pool. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual NullableResponse GetIfExists(string agentPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); - - using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolCollection.GetIfExists"); - scope.Start(); - try - { - var response = _containerServiceAgentPoolAgentPoolsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, cancellationToken: cancellationToken); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new ContainerServiceAgentPoolResource(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/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolData.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolData.cs deleted file mode 100644 index 0cba3bcad288f..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolData.cs +++ /dev/null @@ -1,271 +0,0 @@ -// 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.ContainerService.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// A class representing the ContainerServiceAgentPool data model. - /// Agent Pool. - /// - public partial class ContainerServiceAgentPoolData : 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 ContainerServiceAgentPoolData() - { - AvailabilityZones = new ChangeTrackingList(); - Tags = new ChangeTrackingDictionary(); - NodeLabels = new ChangeTrackingDictionary(); - NodeTaints = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. - /// VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. - /// OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. - /// The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). - /// Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. - /// Determines the type of workload a node can run. - /// If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - /// If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - /// The maximum number of pods that can run on a node. - /// The operating system type. The default is Linux. - /// Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows. - /// The maximum number of nodes for auto-scaling. - /// The minimum number of nodes for auto-scaling. - /// Whether to enable auto-scaler. - /// This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. - /// The type of Agent Pool. - /// A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools. - /// Both patch version <major.minor.patch> (e.g. 1.20.13) and <major.minor> (e.g. 1.20) are supported. When <major.minor> is specified, the latest supported GA patch version is chosen automatically. Updating the cluster with the same <major.minor> once it has been created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). - /// If orchestratorVersion is a fully specified version <major.minor.patch>, this field will be exactly equal to it. If orchestratorVersion is <major.minor>, this field will contain the full <major.minor.patch> version being used. - /// The version of node image. - /// Settings for upgrading the agentpool. - /// The current deployment or provisioning state. - /// When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded. - /// The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. - /// Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). The default is false. - /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. - /// The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. - /// This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. - /// Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing). - /// The tags to be persisted on the agent pool virtual machine scale set. - /// The node labels to be persisted across all nodes in agent pool. - /// The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - /// The ID for Proximity Placement Group. - /// The Kubelet configuration on the agent pool nodes. - /// The OS configuration of Linux agent nodes. - /// This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption. - /// Whether to enable UltraSSD. - /// See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more details. - /// GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. - /// CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot. - /// AKS will associate the specified agent pool with the Capacity Reservation Group. - /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts). - /// Network-related settings of an agent pool. - /// Keeps track of any properties unknown to the library. - internal ContainerServiceAgentPoolData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, int? count, string vmSize, int? osDiskSizeInGB, ContainerServiceOSDiskType? osDiskType, KubeletDiskType? kubeletDiskType, WorkloadRuntime? workloadRuntime, ResourceIdentifier vnetSubnetId, ResourceIdentifier podSubnetId, int? maxPods, ContainerServiceOSType? osType, ContainerServiceOSSku? osSku, int? maxCount, int? minCount, bool? enableAutoScaling, ScaleDownMode? scaleDownMode, AgentPoolType? typePropertiesType, AgentPoolMode? mode, string orchestratorVersion, string currentOrchestratorVersion, string nodeImageVersion, AgentPoolUpgradeSettings upgradeSettings, string provisioningState, ContainerServicePowerState powerState, IList availabilityZones, bool? enableNodePublicIP, ResourceIdentifier nodePublicIPPrefixId, ScaleSetPriority? scaleSetPriority, ScaleSetEvictionPolicy? scaleSetEvictionPolicy, float? spotMaxPrice, IDictionary tags, IDictionary nodeLabels, IList nodeTaints, ResourceIdentifier proximityPlacementGroupId, KubeletConfig kubeletConfig, LinuxOSConfig linuxOSConfig, bool? enableEncryptionAtHost, bool? enableUltraSsd, bool? enableFips, GpuInstanceProfile? gpuInstanceProfile, ContainerServiceCreationData creationData, ResourceIdentifier capacityReservationGroupId, ResourceIdentifier hostGroupId, AgentPoolNetworkProfile networkProfile, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) - { - Count = count; - VmSize = vmSize; - OSDiskSizeInGB = osDiskSizeInGB; - OSDiskType = osDiskType; - KubeletDiskType = kubeletDiskType; - WorkloadRuntime = workloadRuntime; - VnetSubnetId = vnetSubnetId; - PodSubnetId = podSubnetId; - MaxPods = maxPods; - OSType = osType; - OSSku = osSku; - MaxCount = maxCount; - MinCount = minCount; - EnableAutoScaling = enableAutoScaling; - ScaleDownMode = scaleDownMode; - TypePropertiesType = typePropertiesType; - Mode = mode; - OrchestratorVersion = orchestratorVersion; - CurrentOrchestratorVersion = currentOrchestratorVersion; - NodeImageVersion = nodeImageVersion; - UpgradeSettings = upgradeSettings; - ProvisioningState = provisioningState; - PowerState = powerState; - AvailabilityZones = availabilityZones; - EnableNodePublicIP = enableNodePublicIP; - NodePublicIPPrefixId = nodePublicIPPrefixId; - ScaleSetPriority = scaleSetPriority; - ScaleSetEvictionPolicy = scaleSetEvictionPolicy; - SpotMaxPrice = spotMaxPrice; - Tags = tags; - NodeLabels = nodeLabels; - NodeTaints = nodeTaints; - ProximityPlacementGroupId = proximityPlacementGroupId; - KubeletConfig = kubeletConfig; - LinuxOSConfig = linuxOSConfig; - EnableEncryptionAtHost = enableEncryptionAtHost; - EnableUltraSsd = enableUltraSsd; - EnableFips = enableFips; - GpuInstanceProfile = gpuInstanceProfile; - CreationData = creationData; - CapacityReservationGroupId = capacityReservationGroupId; - HostGroupId = hostGroupId; - NetworkProfile = networkProfile; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. - public int? Count { get; set; } - /// VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. - public string VmSize { get; set; } - /// OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. - public int? OSDiskSizeInGB { get; set; } - /// The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). - public ContainerServiceOSDiskType? OSDiskType { get; set; } - /// Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. - public KubeletDiskType? KubeletDiskType { get; set; } - /// Determines the type of workload a node can run. - public WorkloadRuntime? WorkloadRuntime { get; set; } - /// If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - public ResourceIdentifier VnetSubnetId { get; set; } - /// If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - public ResourceIdentifier PodSubnetId { get; set; } - /// The maximum number of pods that can run on a node. - public int? MaxPods { get; set; } - /// The operating system type. The default is Linux. - public ContainerServiceOSType? OSType { get; set; } - /// Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows. - public ContainerServiceOSSku? OSSku { get; set; } - /// The maximum number of nodes for auto-scaling. - public int? MaxCount { get; set; } - /// The minimum number of nodes for auto-scaling. - public int? MinCount { get; set; } - /// Whether to enable auto-scaler. - public bool? EnableAutoScaling { get; set; } - /// This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. - public ScaleDownMode? ScaleDownMode { get; set; } - /// The type of Agent Pool. - public AgentPoolType? TypePropertiesType { get; set; } - /// A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools. - public AgentPoolMode? Mode { get; set; } - /// Both patch version <major.minor.patch> (e.g. 1.20.13) and <major.minor> (e.g. 1.20) are supported. When <major.minor> is specified, the latest supported GA patch version is chosen automatically. Updating the cluster with the same <major.minor> once it has been created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). - public string OrchestratorVersion { get; set; } - /// If orchestratorVersion is a fully specified version <major.minor.patch>, this field will be exactly equal to it. If orchestratorVersion is <major.minor>, this field will contain the full <major.minor.patch> version being used. - public string CurrentOrchestratorVersion { get; } - /// The version of node image. - public string NodeImageVersion { get; } - /// Settings for upgrading the agentpool. - public AgentPoolUpgradeSettings UpgradeSettings { get; set; } - /// The current deployment or provisioning state. - public string ProvisioningState { get; } - /// When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded. - internal ContainerServicePowerState PowerState { get; set; } - /// Tells whether the cluster is Running or Stopped. - public ContainerServiceStateCode? PowerStateCode - { - get => PowerState is null ? default : PowerState.Code; - set - { - if (PowerState is null) - PowerState = new ContainerServicePowerState(); - PowerState.Code = value; - } - } - - /// The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. - public IList AvailabilityZones { get; } - /// Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). The default is false. - public bool? EnableNodePublicIP { get; set; } - /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. - public ResourceIdentifier NodePublicIPPrefixId { get; set; } - /// The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. - public ScaleSetPriority? ScaleSetPriority { get; set; } - /// This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. - public ScaleSetEvictionPolicy? ScaleSetEvictionPolicy { get; set; } - /// Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing). - public float? SpotMaxPrice { get; set; } - /// The tags to be persisted on the agent pool virtual machine scale set. - public IDictionary Tags { get; } - /// The node labels to be persisted across all nodes in agent pool. - public IDictionary NodeLabels { get; } - /// The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - public IList NodeTaints { get; } - /// The ID for Proximity Placement Group. - public ResourceIdentifier ProximityPlacementGroupId { get; set; } - /// The Kubelet configuration on the agent pool nodes. - public KubeletConfig KubeletConfig { get; set; } - /// The OS configuration of Linux agent nodes. - public LinuxOSConfig LinuxOSConfig { get; set; } - /// This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption. - public bool? EnableEncryptionAtHost { get; set; } - /// Whether to enable UltraSSD. - public bool? EnableUltraSsd { get; set; } - /// See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more details. - public bool? EnableFips { get; set; } - /// GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. - public GpuInstanceProfile? GpuInstanceProfile { get; set; } - /// CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot. - internal ContainerServiceCreationData CreationData { get; set; } - /// This is the ARM ID of the source object to be used to create the target object. - public ResourceIdentifier CreationDataSourceResourceId - { - get => CreationData is null ? default : CreationData.SourceResourceId; - set - { - if (CreationData is null) - CreationData = new ContainerServiceCreationData(); - CreationData.SourceResourceId = value; - } - } - - /// AKS will associate the specified agent pool with the Capacity Reservation Group. - public ResourceIdentifier CapacityReservationGroupId { get; set; } - /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts). - public ResourceIdentifier HostGroupId { get; set; } - /// Network-related settings of an agent pool. - public AgentPoolNetworkProfile NetworkProfile { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolResource.cs deleted file mode 100644 index 1b013a3a476b1..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolResource.cs +++ /dev/null @@ -1,777 +0,0 @@ -// 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; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// A Class representing a ContainerServiceAgentPool 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 GetContainerServiceAgentPoolResource method. - /// Otherwise you can get one from its parent resource using the GetContainerServiceAgentPool method. - /// - public partial class ContainerServiceAgentPoolResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The resourceName. - /// The agentPoolName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _containerServiceAgentPoolAgentPoolsClientDiagnostics; - private readonly AgentPoolsRestOperations _containerServiceAgentPoolAgentPoolsRestClient; - private readonly ContainerServiceAgentPoolData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.ContainerService/managedClusters/agentPools"; - - /// Initializes a new instance of the class for mocking. - protected ContainerServiceAgentPoolResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal ContainerServiceAgentPoolResource(ArmClient client, ContainerServiceAgentPoolData 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 ContainerServiceAgentPoolResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _containerServiceAgentPoolAgentPoolsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string containerServiceAgentPoolAgentPoolsApiVersion); - _containerServiceAgentPoolAgentPoolsRestClient = new AgentPoolsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerServiceAgentPoolAgentPoolsApiVersion); -#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 ContainerServiceAgentPoolData 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 an object representing a AgentPoolUpgradeProfileResource along with the instance operations that can be performed on it in the ContainerServiceAgentPool. - /// Returns a object. - public virtual AgentPoolUpgradeProfileResource GetAgentPoolUpgradeProfile() - { - return new AgentPoolUpgradeProfileResource(Client, Id.AppendChildResource("upgradeProfiles", "default")); - } - - /// - /// Gets the specified managed cluster agent pool. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName} - /// - /// - /// Operation Id - /// AgentPools_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.Get"); - scope.Start(); - try - { - var response = await _containerServiceAgentPoolAgentPoolsRestClient.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 ContainerServiceAgentPoolResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the specified managed cluster agent pool. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName} - /// - /// - /// Operation Id - /// AgentPools_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.Get"); - scope.Start(); - try - { - var response = _containerServiceAgentPoolAgentPoolsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ContainerServiceAgentPoolResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or updates an agent pool in the specified managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName} - /// - /// - /// Operation Id - /// AgentPools_CreateOrUpdate - /// - /// - /// Default Api Version - /// 2023-10-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 agent pool to create or update. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, ContainerServiceAgentPoolData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.Update"); - scope.Start(); - try - { - var response = await _containerServiceAgentPoolAgentPoolsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(new ContainerServiceAgentPoolOperationSource(Client), _containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2017-08-31"); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or updates an agent pool in the specified managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName} - /// - /// - /// Operation Id - /// AgentPools_CreateOrUpdate - /// - /// - /// Default Api Version - /// 2023-10-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 agent pool to create or update. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, ContainerServiceAgentPoolData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.Update"); - scope.Start(); - try - { - var response = _containerServiceAgentPoolAgentPoolsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); - var operation = new ContainerServiceArmOperation(new ContainerServiceAgentPoolOperationSource(Client), _containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2017-08-31"); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Aborts the currently running operation on the agent pool. The Agent Pool will be moved to a Canceling state and eventually to a Canceled state when cancellation finishes. If the operation completes before cancellation can take place, a 409 error code is returned. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclusters/{resourceName}/agentPools/{agentPoolName}/abort - /// - /// - /// Operation Id - /// AgentPools_AbortLatestOperation - /// - /// - /// Default Api Version - /// 2023-10-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 cancellation token to use. - public virtual async Task AbortLatestOperationAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.AbortLatestOperation"); - scope.Start(); - try - { - var response = await _containerServiceAgentPoolAgentPoolsRestClient.AbortLatestOperationAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(_containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateAbortLatestOperationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Aborts the currently running operation on the agent pool. The Agent Pool will be moved to a Canceling state and eventually to a Canceled state when cancellation finishes. If the operation completes before cancellation can take place, a 409 error code is returned. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclusters/{resourceName}/agentPools/{agentPoolName}/abort - /// - /// - /// Operation Id - /// AgentPools_AbortLatestOperation - /// - /// - /// Default Api Version - /// 2023-10-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 cancellation token to use. - public virtual ArmOperation AbortLatestOperation(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.AbortLatestOperation"); - scope.Start(); - try - { - var response = _containerServiceAgentPoolAgentPoolsRestClient.AbortLatestOperation(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new ContainerServiceArmOperation(_containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateAbortLatestOperationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS provides one new image per week with the latest updates. For more details on node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion - /// - /// - /// Operation Id - /// AgentPools_UpgradeNodeImageVersion - /// - /// - /// Default Api Version - /// 2023-10-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 cancellation token to use. - public virtual async Task UpgradeNodeImageVersionAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.UpgradeNodeImageVersion"); - scope.Start(); - try - { - var response = await _containerServiceAgentPoolAgentPoolsRestClient.UpgradeNodeImageVersionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(_containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateUpgradeNodeImageVersionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2017-08-31"); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS provides one new image per week with the latest updates. For more details on node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion - /// - /// - /// Operation Id - /// AgentPools_UpgradeNodeImageVersion - /// - /// - /// Default Api Version - /// 2023-10-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 cancellation token to use. - public virtual ArmOperation UpgradeNodeImageVersion(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.UpgradeNodeImageVersion"); - scope.Start(); - try - { - var response = _containerServiceAgentPoolAgentPoolsRestClient.UpgradeNodeImageVersion(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new ContainerServiceArmOperation(_containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateUpgradeNodeImageVersionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2017-08-31"); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Add a tag to the current resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName} - /// - /// - /// Operation Id - /// AgentPools_Get - /// - /// - /// Default Api Version - /// 2023-10-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 = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.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 _containerServiceAgentPoolAgentPoolsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new ContainerServiceAgentPoolResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - current.Tags[key] = value; - var result = await UpdateAsync(WaitUntil.Completed, current, 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/managedClusters/{resourceName}/agentPools/{agentPoolName} - /// - /// - /// Operation Id - /// AgentPools_Get - /// - /// - /// Default Api Version - /// 2023-10-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 = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.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 = _containerServiceAgentPoolAgentPoolsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new ContainerServiceAgentPoolResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - current.Tags[key] = value; - var result = Update(WaitUntil.Completed, current, 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/managedClusters/{resourceName}/agentPools/{agentPoolName} - /// - /// - /// Operation Id - /// AgentPools_Get - /// - /// - /// Default Api Version - /// 2023-10-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 = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.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 _containerServiceAgentPoolAgentPoolsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new ContainerServiceAgentPoolResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - current.Tags.ReplaceWith(tags); - var result = await UpdateAsync(WaitUntil.Completed, current, 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/managedClusters/{resourceName}/agentPools/{agentPoolName} - /// - /// - /// Operation Id - /// AgentPools_Get - /// - /// - /// Default Api Version - /// 2023-10-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 = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.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 = _containerServiceAgentPoolAgentPoolsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new ContainerServiceAgentPoolResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - current.Tags.ReplaceWith(tags); - var result = Update(WaitUntil.Completed, current, 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/managedClusters/{resourceName}/agentPools/{agentPoolName} - /// - /// - /// Operation Id - /// AgentPools_Get - /// - /// - /// Default Api Version - /// 2023-10-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 = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.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 _containerServiceAgentPoolAgentPoolsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new ContainerServiceAgentPoolResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - current.Tags.Remove(key); - var result = await UpdateAsync(WaitUntil.Completed, current, 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/managedClusters/{resourceName}/agentPools/{agentPoolName} - /// - /// - /// Operation Id - /// AgentPools_Get - /// - /// - /// Default Api Version - /// 2023-10-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 = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.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 = _containerServiceAgentPoolAgentPoolsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new ContainerServiceAgentPoolResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - current.Tags.Remove(key); - var result = Update(WaitUntil.Completed, current, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationCollection.cs deleted file mode 100644 index 1a4e94d94ece4..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationCollection.cs +++ /dev/null @@ -1,495 +0,0 @@ -// 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; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// 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 GetContainerServiceMaintenanceConfigurations method from an instance of . - /// - public partial class ContainerServiceMaintenanceConfigurationCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics; - private readonly MaintenanceConfigurationsRestOperations _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient; - - /// Initializes a new instance of the class for mocking. - protected ContainerServiceMaintenanceConfigurationCollection() - { - } - - /// 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 ContainerServiceMaintenanceConfigurationCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ContainerServiceMaintenanceConfigurationResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ContainerServiceMaintenanceConfigurationResource.ResourceType, out string containerServiceMaintenanceConfigurationMaintenanceConfigurationsApiVersion); - _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient = new MaintenanceConfigurationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerServiceMaintenanceConfigurationMaintenanceConfigurationsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ContainerServiceManagedClusterResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ContainerServiceManagedClusterResource.ResourceType), nameof(id)); - } - - /// - /// Creates or updates a maintenance configuration in the specified managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName} - /// - /// - /// Operation Id - /// MaintenanceConfigurations_CreateOrUpdate - /// - /// - /// Default Api Version - /// 2023-10-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 maintenance configuration. - /// The maintenance configuration to create or update. - /// 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 configName, ContainerServiceMaintenanceConfigurationData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(configName, nameof(configName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics.CreateScope("ContainerServiceMaintenanceConfigurationCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configName, data, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(Response.FromValue(new ContainerServiceMaintenanceConfigurationResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or updates a maintenance configuration in the specified managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName} - /// - /// - /// Operation Id - /// MaintenanceConfigurations_CreateOrUpdate - /// - /// - /// Default Api Version - /// 2023-10-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 maintenance configuration. - /// The maintenance configuration to create or update. - /// 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 configName, ContainerServiceMaintenanceConfigurationData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(configName, nameof(configName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics.CreateScope("ContainerServiceMaintenanceConfigurationCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configName, data, cancellationToken); - var operation = new ContainerServiceArmOperation(Response.FromValue(new ContainerServiceMaintenanceConfigurationResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the specified maintenance configuration of a managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName} - /// - /// - /// Operation Id - /// MaintenanceConfigurations_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the maintenance configuration. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string configName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(configName, nameof(configName)); - - using var scope = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics.CreateScope("ContainerServiceMaintenanceConfigurationCollection.Get"); - scope.Start(); - try - { - var response = await _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ContainerServiceMaintenanceConfigurationResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the specified maintenance configuration of a managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName} - /// - /// - /// Operation Id - /// MaintenanceConfigurations_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the maintenance configuration. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string configName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(configName, nameof(configName)); - - using var scope = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics.CreateScope("ContainerServiceMaintenanceConfigurationCollection.Get"); - scope.Start(); - try - { - var response = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ContainerServiceMaintenanceConfigurationResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a list of maintenance configurations in the specified managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations - /// - /// - /// Operation Id - /// MaintenanceConfigurations_ListByManagedCluster - /// - /// - /// Default Api Version - /// 2023-10-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) => _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.CreateListByManagedClusterRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.CreateListByManagedClusterNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerServiceMaintenanceConfigurationResource(Client, ContainerServiceMaintenanceConfigurationData.DeserializeContainerServiceMaintenanceConfigurationData(e)), _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics, Pipeline, "ContainerServiceMaintenanceConfigurationCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Gets a list of maintenance configurations in the specified managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations - /// - /// - /// Operation Id - /// MaintenanceConfigurations_ListByManagedCluster - /// - /// - /// Default Api Version - /// 2023-10-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) => _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.CreateListByManagedClusterRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.CreateListByManagedClusterNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerServiceMaintenanceConfigurationResource(Client, ContainerServiceMaintenanceConfigurationData.DeserializeContainerServiceMaintenanceConfigurationData(e)), _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics, Pipeline, "ContainerServiceMaintenanceConfigurationCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName} - /// - /// - /// Operation Id - /// MaintenanceConfigurations_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the maintenance configuration. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string configName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(configName, nameof(configName)); - - using var scope = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics.CreateScope("ContainerServiceMaintenanceConfigurationCollection.Exists"); - scope.Start(); - try - { - var response = await _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configName, 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/managedClusters/{resourceName}/maintenanceConfigurations/{configName} - /// - /// - /// Operation Id - /// MaintenanceConfigurations_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the maintenance configuration. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string configName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(configName, nameof(configName)); - - using var scope = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics.CreateScope("ContainerServiceMaintenanceConfigurationCollection.Exists"); - scope.Start(); - try - { - var response = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configName, 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/managedClusters/{resourceName}/maintenanceConfigurations/{configName} - /// - /// - /// Operation Id - /// MaintenanceConfigurations_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the maintenance configuration. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetIfExistsAsync(string configName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(configName, nameof(configName)); - - using var scope = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics.CreateScope("ContainerServiceMaintenanceConfigurationCollection.GetIfExists"); - scope.Start(); - try - { - var response = await _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configName, cancellationToken: cancellationToken).ConfigureAwait(false); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new ContainerServiceMaintenanceConfigurationResource(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/managedClusters/{resourceName}/maintenanceConfigurations/{configName} - /// - /// - /// Operation Id - /// MaintenanceConfigurations_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the maintenance configuration. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual NullableResponse GetIfExists(string configName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(configName, nameof(configName)); - - using var scope = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics.CreateScope("ContainerServiceMaintenanceConfigurationCollection.GetIfExists"); - scope.Start(); - try - { - var response = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configName, cancellationToken: cancellationToken); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new ContainerServiceMaintenanceConfigurationResource(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/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationData.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationData.cs deleted file mode 100644 index 6f75ba50accbd..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationData.cs +++ /dev/null @@ -1,85 +0,0 @@ -// 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.ContainerService.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// A class representing the ContainerServiceMaintenanceConfiguration data model. - /// See [planned maintenance](https://docs.microsoft.com/azure/aks/planned-maintenance) for more information about planned maintenance. - /// - public partial class ContainerServiceMaintenanceConfigurationData : 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 ContainerServiceMaintenanceConfigurationData() - { - TimesInWeek = new ChangeTrackingList(); - NotAllowedTimes = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// If two array entries specify the same day of the week, the applied configuration is the union of times in both entries. - /// Time slots on which upgrade is not allowed. - /// Maintenance window for the maintenance configuration. - /// Keeps track of any properties unknown to the library. - internal ContainerServiceMaintenanceConfigurationData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IList timesInWeek, IList notAllowedTimes, ContainerServiceMaintenanceWindow maintenanceWindow, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) - { - TimesInWeek = timesInWeek; - NotAllowedTimes = notAllowedTimes; - MaintenanceWindow = maintenanceWindow; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// If two array entries specify the same day of the week, the applied configuration is the union of times in both entries. - public IList TimesInWeek { get; } - /// Time slots on which upgrade is not allowed. - public IList NotAllowedTimes { get; } - /// Maintenance window for the maintenance configuration. - public ContainerServiceMaintenanceWindow MaintenanceWindow { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterCollection.cs deleted file mode 100644 index e16c9b6d8786b..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterCollection.cs +++ /dev/null @@ -1,496 +0,0 @@ -// 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; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// 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 GetContainerServiceManagedClusters method from an instance of . - /// - public partial class ContainerServiceManagedClusterCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _containerServiceManagedClusterManagedClustersClientDiagnostics; - private readonly ManagedClustersRestOperations _containerServiceManagedClusterManagedClustersRestClient; - - /// Initializes a new instance of the class for mocking. - protected ContainerServiceManagedClusterCollection() - { - } - - /// 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 ContainerServiceManagedClusterCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _containerServiceManagedClusterManagedClustersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ContainerServiceManagedClusterResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ContainerServiceManagedClusterResource.ResourceType, out string containerServiceManagedClusterManagedClustersApiVersion); - _containerServiceManagedClusterManagedClustersRestClient = new ManagedClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerServiceManagedClusterManagedClustersApiVersion); -#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 managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName} - /// - /// - /// Operation Id - /// ManagedClusters_CreateOrUpdate - /// - /// - /// Default Api Version - /// 2023-10-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 managed cluster resource. - /// The managed cluster to create or update. - /// 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 resourceName, ContainerServiceManagedClusterData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _containerServiceManagedClusterManagedClustersRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, resourceName, data, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(new ContainerServiceManagedClusterOperationSource(Client), _containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, resourceName, data).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2017-08-31"); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or updates a managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName} - /// - /// - /// Operation Id - /// ManagedClusters_CreateOrUpdate - /// - /// - /// Default Api Version - /// 2023-10-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 managed cluster resource. - /// The managed cluster to create or update. - /// 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 resourceName, ContainerServiceManagedClusterData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _containerServiceManagedClusterManagedClustersRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, resourceName, data, cancellationToken); - var operation = new ContainerServiceArmOperation(new ContainerServiceManagedClusterOperationSource(Client), _containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, resourceName, data).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2017-08-31"); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName} - /// - /// - /// Operation Id - /// ManagedClusters_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the managed cluster 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 resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterCollection.Get"); - scope.Start(); - try - { - var response = await _containerServiceManagedClusterManagedClustersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, resourceName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ContainerServiceManagedClusterResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName} - /// - /// - /// Operation Id - /// ManagedClusters_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterCollection.Get"); - scope.Start(); - try - { - var response = _containerServiceManagedClusterManagedClustersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, resourceName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ContainerServiceManagedClusterResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Lists managed clusters in the specified subscription and resource group. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters - /// - /// - /// Operation Id - /// ManagedClusters_ListByResourceGroup - /// - /// - /// Default Api Version - /// 2023-10-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) => _containerServiceManagedClusterManagedClustersRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerServiceManagedClusterManagedClustersRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerServiceManagedClusterResource(Client, ContainerServiceManagedClusterData.DeserializeContainerServiceManagedClusterData(e)), _containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, "ContainerServiceManagedClusterCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Lists managed clusters in the specified subscription and resource group. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters - /// - /// - /// Operation Id - /// ManagedClusters_ListByResourceGroup - /// - /// - /// Default Api Version - /// 2023-10-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) => _containerServiceManagedClusterManagedClustersRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerServiceManagedClusterManagedClustersRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerServiceManagedClusterResource(Client, ContainerServiceManagedClusterData.DeserializeContainerServiceManagedClusterData(e)), _containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, "ContainerServiceManagedClusterCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName} - /// - /// - /// Operation Id - /// ManagedClusters_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the managed cluster 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 resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterCollection.Exists"); - scope.Start(); - try - { - var response = await _containerServiceManagedClusterManagedClustersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, resourceName, 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/managedClusters/{resourceName} - /// - /// - /// Operation Id - /// ManagedClusters_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterCollection.Exists"); - scope.Start(); - try - { - var response = _containerServiceManagedClusterManagedClustersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, resourceName, 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/managedClusters/{resourceName} - /// - /// - /// Operation Id - /// ManagedClusters_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the managed cluster 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 resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterCollection.GetIfExists"); - scope.Start(); - try - { - var response = await _containerServiceManagedClusterManagedClustersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, resourceName, cancellationToken: cancellationToken).ConfigureAwait(false); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new ContainerServiceManagedClusterResource(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/managedClusters/{resourceName} - /// - /// - /// Operation Id - /// ManagedClusters_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual NullableResponse GetIfExists(string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterCollection.GetIfExists"); - scope.Start(); - try - { - var response = _containerServiceManagedClusterManagedClustersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, resourceName, cancellationToken: cancellationToken); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new ContainerServiceManagedClusterResource(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/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterData.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterData.cs deleted file mode 100644 index 2d5de45be2387..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterData.cs +++ /dev/null @@ -1,282 +0,0 @@ -// 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.ContainerService.Models; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// A class representing the ContainerServiceManagedCluster data model. - /// Managed cluster. - /// - public partial class ContainerServiceManagedClusterData : 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 ContainerServiceManagedClusterData(AzureLocation location) : base(location) - { - AgentPoolProfiles = new ChangeTrackingList(); - AddonProfiles = new ChangeTrackingDictionary(); - IdentityProfile = new ChangeTrackingDictionary(); - PrivateLinkResources = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// The managed cluster SKU. - /// The extended location of the Virtual Machine. - /// The identity of the managed cluster, if configured. - /// The current provisioning state. - /// The Power State of the cluster. - /// The max number of agent pools for the managed cluster. - /// Both patch version <major.minor.patch> (e.g. 1.20.13) and <major.minor> (e.g. 1.20) are supported. When <major.minor> is specified, the latest supported GA patch version is chosen automatically. Updating the cluster with the same <major.minor> once it has been created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. When you upgrade a supported AKS cluster, Kubernetes minor versions cannot be skipped. All upgrades must be performed sequentially by major version number. For example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, however 1.14.x -> 1.16.x is not allowed. See [upgrading an AKS cluster](https://docs.microsoft.com/azure/aks/upgrade-cluster) for more details. - /// If kubernetesVersion was a fully specified version <major.minor.patch>, this field will be exactly equal to it. If kubernetesVersion was <major.minor>, this field will contain the full <major.minor.patch> version being used. - /// This cannot be updated once the Managed Cluster has been created. - /// This cannot be updated once the Managed Cluster has been created. - /// The FQDN of the master pool. - /// The FQDN of private cluster. - /// The Azure Portal requires certain Cross-Origin Resource Sharing (CORS) headers to be sent in some responses, which Kubernetes APIServer doesn't handle by default. This special FQDN supports CORS, allowing the Azure Portal to function properly. - /// The agent pool properties. - /// The profile for Linux VMs in the Managed Cluster. - /// The profile for Windows VMs in the Managed Cluster. - /// Information about a service principal identity for the cluster to use for manipulating Azure APIs. - /// The profile of managed cluster add-on. - /// See [use AAD pod identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity) for more details on AAD pod identity integration. - /// The OIDC issuer profile of the Managed Cluster. - /// The name of the resource group containing agent pool nodes. - /// Whether to enable Kubernetes Role-Based Access Control. - /// The support plan for the Managed Cluster. If unspecified, the default is 'KubernetesOfficial'. - /// (DEPRECATED) Whether to enable Kubernetes pod security policy (preview). PodSecurityPolicy was deprecated in Kubernetes v1.21, and removed from Kubernetes in v1.25. Learn more at https://aka.ms/k8s/psp and https://aka.ms/aks/psp. - /// The network configuration profile. - /// The Azure Active Directory configuration. - /// The auto upgrade configuration. - /// Settings for upgrading a cluster. - /// Parameters to be applied to the cluster-autoscaler when enabled. - /// The access profile for managed cluster API server. - /// This is of the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. - /// Identities associated with the cluster. - /// Private link resources associated with the cluster. - /// If set to true, getting static credentials will be disabled for this cluster. This must only be used on Managed Clusters that are AAD enabled. For more details see [disable local accounts](https://docs.microsoft.com/azure/aks/managed-aad#disable-local-accounts-preview). - /// Configurations for provisioning the cluster with HTTP proxy servers. - /// Security profile for the managed cluster. - /// Storage profile for the managed cluster. - /// Allow or deny public network access for AKS. - /// Workload Auto-scaler profile for the managed cluster. - /// Azure Monitor addon profiles for monitoring the managed cluster. - /// Service mesh profile for a managed cluster. - /// The resourceUID uniquely identifies ManagedClusters that reuse ARM ResourceIds (i.e: create, delete, create sequence). - /// Keeps track of any properties unknown to the library. - internal ContainerServiceManagedClusterData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ManagedClusterSku sku, ExtendedLocation extendedLocation, ManagedClusterIdentity clusterIdentity, string provisioningState, ContainerServicePowerState powerState, int? maxAgentPools, string kubernetesVersion, string currentKubernetesVersion, string dnsPrefix, string fqdnSubdomain, string fqdn, string privateFqdn, string azurePortalFqdn, IList agentPoolProfiles, ContainerServiceLinuxProfile linuxProfile, ManagedClusterWindowsProfile windowsProfile, ManagedClusterServicePrincipalProfile servicePrincipalProfile, IDictionary addonProfiles, ManagedClusterPodIdentityProfile podIdentityProfile, ManagedClusterOidcIssuerProfile oidcIssuerProfile, string nodeResourceGroup, bool? enableRbac, KubernetesSupportPlan? supportPlan, bool? enablePodSecurityPolicy, ContainerServiceNetworkProfile networkProfile, ManagedClusterAadProfile aadProfile, ManagedClusterAutoUpgradeProfile autoUpgradeProfile, ClusterUpgradeSettings upgradeSettings, ManagedClusterAutoScalerProfile autoScalerProfile, ManagedClusterApiServerAccessProfile apiServerAccessProfile, ResourceIdentifier diskEncryptionSetId, IDictionary identityProfile, IList privateLinkResources, bool? disableLocalAccounts, ManagedClusterHttpProxyConfig httpProxyConfig, ManagedClusterSecurityProfile securityProfile, ManagedClusterStorageProfile storageProfile, ContainerServicePublicNetworkAccess? publicNetworkAccess, ManagedClusterWorkloadAutoScalerProfile workloadAutoScalerProfile, ManagedClusterAzureMonitorProfile azureMonitorProfile, ServiceMeshProfile serviceMeshProfile, ResourceIdentifier resourceId, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) - { - Sku = sku; - ExtendedLocation = extendedLocation; - ClusterIdentity = clusterIdentity; - ProvisioningState = provisioningState; - PowerState = powerState; - MaxAgentPools = maxAgentPools; - KubernetesVersion = kubernetesVersion; - CurrentKubernetesVersion = currentKubernetesVersion; - DnsPrefix = dnsPrefix; - FqdnSubdomain = fqdnSubdomain; - Fqdn = fqdn; - PrivateFqdn = privateFqdn; - AzurePortalFqdn = azurePortalFqdn; - AgentPoolProfiles = agentPoolProfiles; - LinuxProfile = linuxProfile; - WindowsProfile = windowsProfile; - ServicePrincipalProfile = servicePrincipalProfile; - AddonProfiles = addonProfiles; - PodIdentityProfile = podIdentityProfile; - OidcIssuerProfile = oidcIssuerProfile; - NodeResourceGroup = nodeResourceGroup; - EnableRbac = enableRbac; - SupportPlan = supportPlan; - EnablePodSecurityPolicy = enablePodSecurityPolicy; - NetworkProfile = networkProfile; - AadProfile = aadProfile; - AutoUpgradeProfile = autoUpgradeProfile; - UpgradeSettings = upgradeSettings; - AutoScalerProfile = autoScalerProfile; - ApiServerAccessProfile = apiServerAccessProfile; - DiskEncryptionSetId = diskEncryptionSetId; - IdentityProfile = identityProfile; - PrivateLinkResources = privateLinkResources; - DisableLocalAccounts = disableLocalAccounts; - HttpProxyConfig = httpProxyConfig; - SecurityProfile = securityProfile; - StorageProfile = storageProfile; - PublicNetworkAccess = publicNetworkAccess; - WorkloadAutoScalerProfile = workloadAutoScalerProfile; - AzureMonitorProfile = azureMonitorProfile; - ServiceMeshProfile = serviceMeshProfile; - ResourceId = resourceId; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ContainerServiceManagedClusterData() - { - } - - /// The managed cluster SKU. - public ManagedClusterSku Sku { get; set; } - /// The extended location of the Virtual Machine. - public ExtendedLocation ExtendedLocation { get; set; } - /// The identity of the managed cluster, if configured. - public ManagedClusterIdentity ClusterIdentity { get; set; } - /// The current provisioning state. - public string ProvisioningState { get; } - /// The Power State of the cluster. - internal ContainerServicePowerState PowerState { get; } - /// Tells whether the cluster is Running or Stopped. - public ContainerServiceStateCode? PowerStateCode - { - get => PowerState?.Code; - } - - /// The max number of agent pools for the managed cluster. - public int? MaxAgentPools { get; } - /// Both patch version <major.minor.patch> (e.g. 1.20.13) and <major.minor> (e.g. 1.20) are supported. When <major.minor> is specified, the latest supported GA patch version is chosen automatically. Updating the cluster with the same <major.minor> once it has been created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. When you upgrade a supported AKS cluster, Kubernetes minor versions cannot be skipped. All upgrades must be performed sequentially by major version number. For example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, however 1.14.x -> 1.16.x is not allowed. See [upgrading an AKS cluster](https://docs.microsoft.com/azure/aks/upgrade-cluster) for more details. - public string KubernetesVersion { get; set; } - /// If kubernetesVersion was a fully specified version <major.minor.patch>, this field will be exactly equal to it. If kubernetesVersion was <major.minor>, this field will contain the full <major.minor.patch> version being used. - public string CurrentKubernetesVersion { get; } - /// This cannot be updated once the Managed Cluster has been created. - public string DnsPrefix { get; set; } - /// This cannot be updated once the Managed Cluster has been created. - public string FqdnSubdomain { get; set; } - /// The FQDN of the master pool. - public string Fqdn { get; } - /// The FQDN of private cluster. - public string PrivateFqdn { get; } - /// The Azure Portal requires certain Cross-Origin Resource Sharing (CORS) headers to be sent in some responses, which Kubernetes APIServer doesn't handle by default. This special FQDN supports CORS, allowing the Azure Portal to function properly. - public string AzurePortalFqdn { get; } - /// The agent pool properties. - public IList AgentPoolProfiles { get; } - /// The profile for Linux VMs in the Managed Cluster. - public ContainerServiceLinuxProfile LinuxProfile { get; set; } - /// The profile for Windows VMs in the Managed Cluster. - public ManagedClusterWindowsProfile WindowsProfile { get; set; } - /// Information about a service principal identity for the cluster to use for manipulating Azure APIs. - public ManagedClusterServicePrincipalProfile ServicePrincipalProfile { get; set; } - /// The profile of managed cluster add-on. - public IDictionary AddonProfiles { get; } - /// See [use AAD pod identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity) for more details on AAD pod identity integration. - public ManagedClusterPodIdentityProfile PodIdentityProfile { get; set; } - /// The OIDC issuer profile of the Managed Cluster. - public ManagedClusterOidcIssuerProfile OidcIssuerProfile { get; set; } - /// The name of the resource group containing agent pool nodes. - public string NodeResourceGroup { get; set; } - /// Whether to enable Kubernetes Role-Based Access Control. - public bool? EnableRbac { get; set; } - /// The support plan for the Managed Cluster. If unspecified, the default is 'KubernetesOfficial'. - public KubernetesSupportPlan? SupportPlan { get; set; } - /// (DEPRECATED) Whether to enable Kubernetes pod security policy (preview). PodSecurityPolicy was deprecated in Kubernetes v1.21, and removed from Kubernetes in v1.25. Learn more at https://aka.ms/k8s/psp and https://aka.ms/aks/psp. - public bool? EnablePodSecurityPolicy { get; set; } - /// The network configuration profile. - public ContainerServiceNetworkProfile NetworkProfile { get; set; } - /// The Azure Active Directory configuration. - public ManagedClusterAadProfile AadProfile { get; set; } - /// The auto upgrade configuration. - public ManagedClusterAutoUpgradeProfile AutoUpgradeProfile { get; set; } - /// Settings for upgrading a cluster. - internal ClusterUpgradeSettings UpgradeSettings { get; set; } - /// Settings for overrides. - public UpgradeOverrideSettings UpgradeOverrideSettings - { - get => UpgradeSettings is null ? default : UpgradeSettings.OverrideSettings; - set - { - if (UpgradeSettings is null) - UpgradeSettings = new ClusterUpgradeSettings(); - UpgradeSettings.OverrideSettings = value; - } - } - - /// Parameters to be applied to the cluster-autoscaler when enabled. - public ManagedClusterAutoScalerProfile AutoScalerProfile { get; set; } - /// The access profile for managed cluster API server. - public ManagedClusterApiServerAccessProfile ApiServerAccessProfile { get; set; } - /// This is of the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. - public ResourceIdentifier DiskEncryptionSetId { get; set; } - /// Identities associated with the cluster. - public IDictionary IdentityProfile { get; } - /// Private link resources associated with the cluster. - public IList PrivateLinkResources { get; } - /// If set to true, getting static credentials will be disabled for this cluster. This must only be used on Managed Clusters that are AAD enabled. For more details see [disable local accounts](https://docs.microsoft.com/azure/aks/managed-aad#disable-local-accounts-preview). - public bool? DisableLocalAccounts { get; set; } - /// Configurations for provisioning the cluster with HTTP proxy servers. - public ManagedClusterHttpProxyConfig HttpProxyConfig { get; set; } - /// Security profile for the managed cluster. - public ManagedClusterSecurityProfile SecurityProfile { get; set; } - /// Storage profile for the managed cluster. - public ManagedClusterStorageProfile StorageProfile { get; set; } - /// Allow or deny public network access for AKS. - public ContainerServicePublicNetworkAccess? PublicNetworkAccess { get; set; } - /// Workload Auto-scaler profile for the managed cluster. - public ManagedClusterWorkloadAutoScalerProfile WorkloadAutoScalerProfile { get; set; } - /// Azure Monitor addon profiles for monitoring the managed cluster. - internal ManagedClusterAzureMonitorProfile AzureMonitorProfile { get; set; } - /// Metrics profile for the Azure Monitor managed service for Prometheus addon. Collect out-of-the-box Kubernetes infrastructure metrics to send to an Azure Monitor Workspace and configure additional scraping for custom targets. See aka.ms/AzureManagedPrometheus for an overview. - public ManagedClusterMonitorProfileMetrics AzureMonitorMetrics - { - get => AzureMonitorProfile is null ? default : AzureMonitorProfile.Metrics; - set - { - if (AzureMonitorProfile is null) - AzureMonitorProfile = new ManagedClusterAzureMonitorProfile(); - AzureMonitorProfile.Metrics = value; - } - } - - /// Service mesh profile for a managed cluster. - public ServiceMeshProfile ServiceMeshProfile { get; set; } - /// The resourceUID uniquely identifies ManagedClusters that reuse ARM ResourceIds (i.e: create, delete, create sequence). - public ResourceIdentifier ResourceId { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterResource.cs deleted file mode 100644 index 8418f1b4477bf..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterResource.cs +++ /dev/null @@ -1,2332 +0,0 @@ -// 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 Autorest.CSharp.Core; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.ContainerService.Models; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// A Class representing a ContainerServiceManagedCluster 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 GetContainerServiceManagedClusterResource method. - /// Otherwise you can get one from its parent resource using the GetContainerServiceManagedCluster method. - /// - public partial class ContainerServiceManagedClusterResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The resourceName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string resourceName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _containerServiceManagedClusterManagedClustersClientDiagnostics; - private readonly ManagedClustersRestOperations _containerServiceManagedClusterManagedClustersRestClient; - private readonly ClientDiagnostics _agentPoolsClientDiagnostics; - private readonly AgentPoolsRestOperations _agentPoolsRestClient; - private readonly ClientDiagnostics _privateLinkResourcesClientDiagnostics; - private readonly PrivateLinkResourcesRestOperations _privateLinkResourcesRestClient; - private readonly ClientDiagnostics _resolvePrivateLinkServiceIdClientDiagnostics; - private readonly ResolvePrivateLinkServiceIdRestOperations _resolvePrivateLinkServiceIdRestClient; - private readonly ContainerServiceManagedClusterData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.ContainerService/managedClusters"; - - /// Initializes a new instance of the class for mocking. - protected ContainerServiceManagedClusterResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal ContainerServiceManagedClusterResource(ArmClient client, ContainerServiceManagedClusterData 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 ContainerServiceManagedClusterResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _containerServiceManagedClusterManagedClustersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string containerServiceManagedClusterManagedClustersApiVersion); - _containerServiceManagedClusterManagedClustersRestClient = new ManagedClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerServiceManagedClusterManagedClustersApiVersion); - _agentPoolsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ProviderConstants.DefaultProviderNamespace, Diagnostics); - _agentPoolsRestClient = new AgentPoolsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - _privateLinkResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ProviderConstants.DefaultProviderNamespace, Diagnostics); - _privateLinkResourcesRestClient = new PrivateLinkResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - _resolvePrivateLinkServiceIdClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ProviderConstants.DefaultProviderNamespace, Diagnostics); - _resolvePrivateLinkServiceIdRestClient = new ResolvePrivateLinkServiceIdRestOperations(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 ContainerServiceManagedClusterData 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 an object representing a ManagedClusterUpgradeProfileResource along with the instance operations that can be performed on it in the ContainerServiceManagedCluster. - /// Returns a object. - public virtual ManagedClusterUpgradeProfileResource GetManagedClusterUpgradeProfile() - { - return new ManagedClusterUpgradeProfileResource(Client, Id.AppendChildResource("upgradeProfiles", "default")); - } - - /// Gets a collection of MeshUpgradeProfileResources in the ContainerServiceManagedCluster. - /// An object representing collection of MeshUpgradeProfileResources and their operations over a MeshUpgradeProfileResource. - public virtual MeshUpgradeProfileCollection GetMeshUpgradeProfiles() - { - return GetCachedClient(client => new MeshUpgradeProfileCollection(client, Id)); - } - - /// - /// Gets available upgrades for a service mesh in a cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshUpgradeProfiles/{mode} - /// - /// - /// Operation Id - /// ManagedClusters_GetMeshUpgradeProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The mode of the mesh. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetMeshUpgradeProfileAsync(string mode, CancellationToken cancellationToken = default) - { - return await GetMeshUpgradeProfiles().GetAsync(mode, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets available upgrades for a service mesh in a cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshUpgradeProfiles/{mode} - /// - /// - /// Operation Id - /// ManagedClusters_GetMeshUpgradeProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The mode of the mesh. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetMeshUpgradeProfile(string mode, CancellationToken cancellationToken = default) - { - return GetMeshUpgradeProfiles().Get(mode, cancellationToken); - } - - /// Gets a collection of ContainerServiceMaintenanceConfigurationResources in the ContainerServiceManagedCluster. - /// An object representing collection of ContainerServiceMaintenanceConfigurationResources and their operations over a ContainerServiceMaintenanceConfigurationResource. - public virtual ContainerServiceMaintenanceConfigurationCollection GetContainerServiceMaintenanceConfigurations() - { - return GetCachedClient(client => new ContainerServiceMaintenanceConfigurationCollection(client, Id)); - } - - /// - /// Gets the specified maintenance configuration of a managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName} - /// - /// - /// Operation Id - /// MaintenanceConfigurations_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the maintenance configuration. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetContainerServiceMaintenanceConfigurationAsync(string configName, CancellationToken cancellationToken = default) - { - return await GetContainerServiceMaintenanceConfigurations().GetAsync(configName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets the specified maintenance configuration of a managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName} - /// - /// - /// Operation Id - /// MaintenanceConfigurations_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the maintenance configuration. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetContainerServiceMaintenanceConfiguration(string configName, CancellationToken cancellationToken = default) - { - return GetContainerServiceMaintenanceConfigurations().Get(configName, cancellationToken); - } - - /// Gets a collection of ContainerServiceAgentPoolResources in the ContainerServiceManagedCluster. - /// An object representing collection of ContainerServiceAgentPoolResources and their operations over a ContainerServiceAgentPoolResource. - public virtual ContainerServiceAgentPoolCollection GetContainerServiceAgentPools() - { - return GetCachedClient(client => new ContainerServiceAgentPoolCollection(client, Id)); - } - - /// - /// Gets the specified managed cluster agent pool. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName} - /// - /// - /// Operation Id - /// AgentPools_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the agent pool. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetContainerServiceAgentPoolAsync(string agentPoolName, CancellationToken cancellationToken = default) - { - return await GetContainerServiceAgentPools().GetAsync(agentPoolName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets the specified managed cluster agent pool. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName} - /// - /// - /// Operation Id - /// AgentPools_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the agent pool. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetContainerServiceAgentPool(string agentPoolName, CancellationToken cancellationToken = default) - { - return GetContainerServiceAgentPools().Get(agentPoolName, cancellationToken); - } - - /// Gets a collection of ContainerServicePrivateEndpointConnectionResources in the ContainerServiceManagedCluster. - /// An object representing collection of ContainerServicePrivateEndpointConnectionResources and their operations over a ContainerServicePrivateEndpointConnectionResource. - public virtual ContainerServicePrivateEndpointConnectionCollection GetContainerServicePrivateEndpointConnections() - { - return GetCachedClient(client => new ContainerServicePrivateEndpointConnectionCollection(client, Id)); - } - - /// - /// To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName} - /// - /// - /// Operation Id - /// PrivateEndpointConnections_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the private endpoint connection. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetContainerServicePrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) - { - return await GetContainerServicePrivateEndpointConnections().GetAsync(privateEndpointConnectionName, cancellationToken).ConfigureAwait(false); - } - - /// - /// To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName} - /// - /// - /// Operation Id - /// PrivateEndpointConnections_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the private endpoint connection. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetContainerServicePrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) - { - return GetContainerServicePrivateEndpointConnections().Get(privateEndpointConnectionName, cancellationToken); - } - - /// Gets a collection of ContainerServiceTrustedAccessRoleBindingResources in the ContainerServiceManagedCluster. - /// An object representing collection of ContainerServiceTrustedAccessRoleBindingResources and their operations over a ContainerServiceTrustedAccessRoleBindingResource. - public virtual ContainerServiceTrustedAccessRoleBindingCollection GetContainerServiceTrustedAccessRoleBindings() - { - return GetCachedClient(client => new ContainerServiceTrustedAccessRoleBindingCollection(client, Id)); - } - - /// - /// Get a trusted access role binding. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName} - /// - /// - /// Operation Id - /// TrustedAccessRoleBindings_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of trusted access role binding. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetContainerServiceTrustedAccessRoleBindingAsync(string trustedAccessRoleBindingName, CancellationToken cancellationToken = default) - { - return await GetContainerServiceTrustedAccessRoleBindings().GetAsync(trustedAccessRoleBindingName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get a trusted access role binding. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName} - /// - /// - /// Operation Id - /// TrustedAccessRoleBindings_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of trusted access role binding. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetContainerServiceTrustedAccessRoleBinding(string trustedAccessRoleBindingName, CancellationToken cancellationToken = default) - { - return GetContainerServiceTrustedAccessRoleBindings().Get(trustedAccessRoleBindingName, cancellationToken); - } - - /// - /// Gets a managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName} - /// - /// - /// Operation Id - /// ManagedClusters_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.Get"); - scope.Start(); - try - { - var response = await _containerServiceManagedClusterManagedClustersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ContainerServiceManagedClusterResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName} - /// - /// - /// Operation Id - /// ManagedClusters_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.Get"); - scope.Start(); - try - { - var response = _containerServiceManagedClusterManagedClustersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ContainerServiceManagedClusterResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Updates tags on a managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName} - /// - /// - /// Operation Id - /// ManagedClusters_UpdateTags - /// - /// - /// Default Api Version - /// 2023-10-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. - /// Parameters supplied to the Update Managed Cluster Tags operation. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, ContainerServiceTagsObject containerServiceTagsObject, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(containerServiceTagsObject, nameof(containerServiceTagsObject)); - - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.Update"); - scope.Start(); - try - { - var response = await _containerServiceManagedClusterManagedClustersRestClient.UpdateTagsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, containerServiceTagsObject, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(new ContainerServiceManagedClusterOperationSource(Client), _containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateUpdateTagsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, containerServiceTagsObject).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2017-08-31"); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Updates tags on a managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName} - /// - /// - /// Operation Id - /// ManagedClusters_UpdateTags - /// - /// - /// Default Api Version - /// 2023-10-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. - /// Parameters supplied to the Update Managed Cluster Tags operation. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, ContainerServiceTagsObject containerServiceTagsObject, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(containerServiceTagsObject, nameof(containerServiceTagsObject)); - - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.Update"); - scope.Start(); - try - { - var response = _containerServiceManagedClusterManagedClustersRestClient.UpdateTags(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, containerServiceTagsObject, cancellationToken); - var operation = new ContainerServiceArmOperation(new ContainerServiceManagedClusterOperationSource(Client), _containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateUpdateTagsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, containerServiceTagsObject).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2017-08-31"); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// **WARNING**: This API will be deprecated. Instead use [ListClusterUserCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusterusercredentials) or [ListClusterAdminCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusteradmincredentials) . - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential - /// - /// - /// Operation Id - /// ManagedClusters_GetAccessProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// - /// The name of the role for managed cluster accessProfile resource. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAccessProfileAsync(string roleName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(roleName, nameof(roleName)); - - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.GetAccessProfile"); - scope.Start(); - try - { - var response = await _containerServiceManagedClusterManagedClustersRestClient.GetAccessProfileAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleName, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// **WARNING**: This API will be deprecated. Instead use [ListClusterUserCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusterusercredentials) or [ListClusterAdminCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusteradmincredentials) . - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential - /// - /// - /// Operation Id - /// ManagedClusters_GetAccessProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// - /// The name of the role for managed cluster accessProfile resource. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response GetAccessProfile(string roleName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(roleName, nameof(roleName)); - - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.GetAccessProfile"); - scope.Start(); - try - { - var response = _containerServiceManagedClusterManagedClustersRestClient.GetAccessProfile(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleName, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Lists the admin credentials of a managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential - /// - /// - /// Operation Id - /// ManagedClusters_ListClusterAdminCredentials - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// server fqdn type for credentials to be returned. - /// The cancellation token to use. - public virtual async Task> GetClusterAdminCredentialsAsync(string serverFqdn = null, CancellationToken cancellationToken = default) - { - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.GetClusterAdminCredentials"); - scope.Start(); - try - { - var response = await _containerServiceManagedClusterManagedClustersRestClient.ListClusterAdminCredentialsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, serverFqdn, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Lists the admin credentials of a managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential - /// - /// - /// Operation Id - /// ManagedClusters_ListClusterAdminCredentials - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// server fqdn type for credentials to be returned. - /// The cancellation token to use. - public virtual Response GetClusterAdminCredentials(string serverFqdn = null, CancellationToken cancellationToken = default) - { - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.GetClusterAdminCredentials"); - scope.Start(); - try - { - var response = _containerServiceManagedClusterManagedClustersRestClient.ListClusterAdminCredentials(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, serverFqdn, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Lists the user credentials of a managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential - /// - /// - /// Operation Id - /// ManagedClusters_ListClusterUserCredentials - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// server fqdn type for credentials to be returned. - /// Only apply to AAD clusters, specifies the format of returned kubeconfig. Format 'azure' will return azure auth-provider kubeconfig; format 'exec' will return exec format kubeconfig, which requires kubelogin binary in the path. - /// The cancellation token to use. - public virtual async Task> GetClusterUserCredentialsAsync(string serverFqdn = null, KubeConfigFormat? format = null, CancellationToken cancellationToken = default) - { - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.GetClusterUserCredentials"); - scope.Start(); - try - { - var response = await _containerServiceManagedClusterManagedClustersRestClient.ListClusterUserCredentialsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, serverFqdn, format, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Lists the user credentials of a managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential - /// - /// - /// Operation Id - /// ManagedClusters_ListClusterUserCredentials - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// server fqdn type for credentials to be returned. - /// Only apply to AAD clusters, specifies the format of returned kubeconfig. Format 'azure' will return azure auth-provider kubeconfig; format 'exec' will return exec format kubeconfig, which requires kubelogin binary in the path. - /// The cancellation token to use. - public virtual Response GetClusterUserCredentials(string serverFqdn = null, KubeConfigFormat? format = null, CancellationToken cancellationToken = default) - { - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.GetClusterUserCredentials"); - scope.Start(); - try - { - var response = _containerServiceManagedClusterManagedClustersRestClient.ListClusterUserCredentials(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, serverFqdn, format, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Lists the cluster monitoring user credentials of a managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential - /// - /// - /// Operation Id - /// ManagedClusters_ListClusterMonitoringUserCredentials - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// server fqdn type for credentials to be returned. - /// The cancellation token to use. - public virtual async Task> GetClusterMonitoringUserCredentialsAsync(string serverFqdn = null, CancellationToken cancellationToken = default) - { - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.GetClusterMonitoringUserCredentials"); - scope.Start(); - try - { - var response = await _containerServiceManagedClusterManagedClustersRestClient.ListClusterMonitoringUserCredentialsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, serverFqdn, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Lists the cluster monitoring user credentials of a managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential - /// - /// - /// Operation Id - /// ManagedClusters_ListClusterMonitoringUserCredentials - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// server fqdn type for credentials to be returned. - /// The cancellation token to use. - public virtual Response GetClusterMonitoringUserCredentials(string serverFqdn = null, CancellationToken cancellationToken = default) - { - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.GetClusterMonitoringUserCredentials"); - scope.Start(); - try - { - var response = _containerServiceManagedClusterManagedClustersRestClient.ListClusterMonitoringUserCredentials(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, serverFqdn, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// This action cannot be performed on a cluster that is not using a service principal - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile - /// - /// - /// Operation Id - /// ManagedClusters_ResetServicePrincipalProfile - /// - /// - /// Default Api Version - /// 2023-10-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 service principal profile to set on the managed cluster. - /// The cancellation token to use. - /// is null. - public virtual async Task ResetServicePrincipalProfileAsync(WaitUntil waitUntil, ManagedClusterServicePrincipalProfile managedClusterServicePrincipalProfile, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(managedClusterServicePrincipalProfile, nameof(managedClusterServicePrincipalProfile)); - - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.ResetServicePrincipalProfile"); - scope.Start(); - try - { - var response = await _containerServiceManagedClusterManagedClustersRestClient.ResetServicePrincipalProfileAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, managedClusterServicePrincipalProfile, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(_containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateResetServicePrincipalProfileRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, managedClusterServicePrincipalProfile).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2017-08-31"); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// This action cannot be performed on a cluster that is not using a service principal - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile - /// - /// - /// Operation Id - /// ManagedClusters_ResetServicePrincipalProfile - /// - /// - /// Default Api Version - /// 2023-10-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 service principal profile to set on the managed cluster. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation ResetServicePrincipalProfile(WaitUntil waitUntil, ManagedClusterServicePrincipalProfile managedClusterServicePrincipalProfile, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(managedClusterServicePrincipalProfile, nameof(managedClusterServicePrincipalProfile)); - - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.ResetServicePrincipalProfile"); - scope.Start(); - try - { - var response = _containerServiceManagedClusterManagedClustersRestClient.ResetServicePrincipalProfile(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, managedClusterServicePrincipalProfile, cancellationToken); - var operation = new ContainerServiceArmOperation(_containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateResetServicePrincipalProfileRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, managedClusterServicePrincipalProfile).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2017-08-31"); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// **WARNING**: This API will be deprecated. Please see [AKS-managed Azure Active Directory integration](https://aka.ms/aks-managed-aad) to update your cluster with AKS-managed Azure AD. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile - /// - /// - /// Operation Id - /// ManagedClusters_ResetAADProfile - /// - /// - /// Default Api Version - /// 2023-10-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 AAD profile to set on the Managed Cluster. - /// The cancellation token to use. - /// is null. - public virtual async Task ResetAadProfileAsync(WaitUntil waitUntil, ManagedClusterAadProfile managedClusterAadProfile, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(managedClusterAadProfile, nameof(managedClusterAadProfile)); - - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.ResetAadProfile"); - scope.Start(); - try - { - var response = await _containerServiceManagedClusterManagedClustersRestClient.ResetAadProfileAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, managedClusterAadProfile, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(_containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateResetAadProfileRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, managedClusterAadProfile).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2017-08-31"); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// **WARNING**: This API will be deprecated. Please see [AKS-managed Azure Active Directory integration](https://aka.ms/aks-managed-aad) to update your cluster with AKS-managed Azure AD. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile - /// - /// - /// Operation Id - /// ManagedClusters_ResetAADProfile - /// - /// - /// Default Api Version - /// 2023-10-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 AAD profile to set on the Managed Cluster. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation ResetAadProfile(WaitUntil waitUntil, ManagedClusterAadProfile managedClusterAadProfile, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(managedClusterAadProfile, nameof(managedClusterAadProfile)); - - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.ResetAadProfile"); - scope.Start(); - try - { - var response = _containerServiceManagedClusterManagedClustersRestClient.ResetAadProfile(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, managedClusterAadProfile, cancellationToken); - var operation = new ContainerServiceArmOperation(_containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateResetAadProfileRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, managedClusterAadProfile).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2017-08-31"); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about rotating managed cluster certificates. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates - /// - /// - /// Operation Id - /// ManagedClusters_RotateClusterCertificates - /// - /// - /// Default Api Version - /// 2023-10-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 cancellation token to use. - public virtual async Task RotateClusterCertificatesAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.RotateClusterCertificates"); - scope.Start(); - try - { - var response = await _containerServiceManagedClusterManagedClustersRestClient.RotateClusterCertificatesAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(_containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateRotateClusterCertificatesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2017-08-31"); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about rotating managed cluster certificates. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates - /// - /// - /// Operation Id - /// ManagedClusters_RotateClusterCertificates - /// - /// - /// Default Api Version - /// 2023-10-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 cancellation token to use. - public virtual ArmOperation RotateClusterCertificates(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.RotateClusterCertificates"); - scope.Start(); - try - { - var response = _containerServiceManagedClusterManagedClustersRestClient.RotateClusterCertificates(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new ContainerServiceArmOperation(_containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateRotateClusterCertificatesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2017-08-31"); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Aborts the currently running operation on the managed cluster. The Managed Cluster will be moved to a Canceling state and eventually to a Canceled state when cancellation finishes. If the operation completes before cancellation can take place, a 409 error code is returned. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclusters/{resourceName}/abort - /// - /// - /// Operation Id - /// ManagedClusters_AbortLatestOperation - /// - /// - /// Default Api Version - /// 2023-10-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 cancellation token to use. - public virtual async Task AbortLatestOperationAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.AbortLatestOperation"); - scope.Start(); - try - { - var response = await _containerServiceManagedClusterManagedClustersRestClient.AbortLatestOperationAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(_containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateAbortLatestOperationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Aborts the currently running operation on the managed cluster. The Managed Cluster will be moved to a Canceling state and eventually to a Canceled state when cancellation finishes. If the operation completes before cancellation can take place, a 409 error code is returned. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclusters/{resourceName}/abort - /// - /// - /// Operation Id - /// ManagedClusters_AbortLatestOperation - /// - /// - /// Default Api Version - /// 2023-10-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 cancellation token to use. - public virtual ArmOperation AbortLatestOperation(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.AbortLatestOperation"); - scope.Start(); - try - { - var response = _containerServiceManagedClusterManagedClustersRestClient.AbortLatestOperation(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new ContainerServiceArmOperation(_containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateAbortLatestOperationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Rotates the service account signing keys of a managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateServiceAccountSigningKeys - /// - /// - /// Operation Id - /// ManagedClusters_RotateServiceAccountSigningKeys - /// - /// - /// Default Api Version - /// 2023-10-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 cancellation token to use. - public virtual async Task RotateServiceAccountSigningKeysAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.RotateServiceAccountSigningKeys"); - scope.Start(); - try - { - var response = await _containerServiceManagedClusterManagedClustersRestClient.RotateServiceAccountSigningKeysAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(_containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateRotateServiceAccountSigningKeysRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Rotates the service account signing keys of a managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateServiceAccountSigningKeys - /// - /// - /// Operation Id - /// ManagedClusters_RotateServiceAccountSigningKeys - /// - /// - /// Default Api Version - /// 2023-10-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 cancellation token to use. - public virtual ArmOperation RotateServiceAccountSigningKeys(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.RotateServiceAccountSigningKeys"); - scope.Start(); - try - { - var response = _containerServiceManagedClusterManagedClustersRestClient.RotateServiceAccountSigningKeys(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new ContainerServiceArmOperation(_containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateRotateServiceAccountSigningKeysRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the control plane and agent nodes entirely, while maintaining all object and cluster state. A cluster does not accrue charges while it is stopped. See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about stopping a cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop - /// - /// - /// Operation Id - /// ManagedClusters_Stop - /// - /// - /// Default Api Version - /// 2023-10-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 cancellation token to use. - public virtual async Task StopAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.Stop"); - scope.Start(); - try - { - var response = await _containerServiceManagedClusterManagedClustersRestClient.StopAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(_containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateStopRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2017-08-31"); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the control plane and agent nodes entirely, while maintaining all object and cluster state. A cluster does not accrue charges while it is stopped. See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about stopping a cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop - /// - /// - /// Operation Id - /// ManagedClusters_Stop - /// - /// - /// Default Api Version - /// 2023-10-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 cancellation token to use. - public virtual ArmOperation Stop(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.Stop"); - scope.Start(); - try - { - var response = _containerServiceManagedClusterManagedClustersRestClient.Stop(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new ContainerServiceArmOperation(_containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateStopRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2017-08-31"); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting a cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start - /// - /// - /// Operation Id - /// ManagedClusters_Start - /// - /// - /// Default Api Version - /// 2023-10-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 cancellation token to use. - public virtual async Task StartAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.Start"); - scope.Start(); - try - { - var response = await _containerServiceManagedClusterManagedClustersRestClient.StartAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(_containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateStartRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2017-08-31"); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting a cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start - /// - /// - /// Operation Id - /// ManagedClusters_Start - /// - /// - /// Default Api Version - /// 2023-10-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 cancellation token to use. - public virtual ArmOperation Start(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.Start"); - scope.Start(); - try - { - var response = _containerServiceManagedClusterManagedClustersRestClient.Start(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new ContainerServiceArmOperation(_containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateStartRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2017-08-31"); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand - /// - /// - /// Operation Id - /// ManagedClusters_RunCommand - /// - /// - /// Default Api Version - /// 2023-10-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 run command request. - /// The cancellation token to use. - /// is null. - public virtual async Task> RunCommandAsync(WaitUntil waitUntil, ManagedClusterRunCommandContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.RunCommand"); - scope.Start(); - try - { - var response = await _containerServiceManagedClusterManagedClustersRestClient.RunCommandAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(new ManagedClusterRunCommandResultOperationSource(), _containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateRunCommandRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2017-08-31"); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand - /// - /// - /// Operation Id - /// ManagedClusters_RunCommand - /// - /// - /// Default Api Version - /// 2023-10-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 run command request. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation RunCommand(WaitUntil waitUntil, ManagedClusterRunCommandContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.RunCommand"); - scope.Start(); - try - { - var response = _containerServiceManagedClusterManagedClustersRestClient.RunCommand(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); - var operation = new ContainerServiceArmOperation(new ManagedClusterRunCommandResultOperationSource(), _containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateRunCommandRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2017-08-31"); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the results of a command which has been run on the Managed Cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId} - /// - /// - /// Operation Id - /// ManagedClusters_GetCommandResult - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// - /// Id of the command. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetCommandResultAsync(string commandId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(commandId, nameof(commandId)); - - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.GetCommandResult"); - scope.Start(); - try - { - var response = await _containerServiceManagedClusterManagedClustersRestClient.GetCommandResultAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, commandId, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the results of a command which has been run on the Managed Cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId} - /// - /// - /// Operation Id - /// ManagedClusters_GetCommandResult - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// - /// Id of the command. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response GetCommandResult(string commandId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(commandId, nameof(commandId)); - - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.GetCommandResult"); - scope.Start(); - try - { - var response = _containerServiceManagedClusterManagedClustersRestClient.GetCommandResult(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, commandId, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. The operation returns properties of each egress endpoint. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/outboundNetworkDependenciesEndpoints - /// - /// - /// Operation Id - /// ManagedClusters_ListOutboundNetworkDependenciesEndpoints - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetOutboundNetworkDependenciesEndpointsAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _containerServiceManagedClusterManagedClustersRestClient.CreateListOutboundNetworkDependenciesEndpointsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerServiceManagedClusterManagedClustersRestClient.CreateListOutboundNetworkDependenciesEndpointsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => ContainerServiceOutboundEnvironmentEndpoint.DeserializeContainerServiceOutboundEnvironmentEndpoint(e), _containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, "ContainerServiceManagedClusterResource.GetOutboundNetworkDependenciesEndpoints", "value", "nextLink", cancellationToken); - } - - /// - /// Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. The operation returns properties of each egress endpoint. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/outboundNetworkDependenciesEndpoints - /// - /// - /// Operation Id - /// ManagedClusters_ListOutboundNetworkDependenciesEndpoints - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetOutboundNetworkDependenciesEndpoints(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _containerServiceManagedClusterManagedClustersRestClient.CreateListOutboundNetworkDependenciesEndpointsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerServiceManagedClusterManagedClustersRestClient.CreateListOutboundNetworkDependenciesEndpointsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => ContainerServiceOutboundEnvironmentEndpoint.DeserializeContainerServiceOutboundEnvironmentEndpoint(e), _containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, "ContainerServiceManagedClusterResource.GetOutboundNetworkDependenciesEndpoints", "value", "nextLink", cancellationToken); - } - - /// - /// See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more details about the version lifecycle. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions - /// - /// - /// Operation Id - /// AgentPools_GetAvailableAgentPoolVersions - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAvailableAgentPoolVersionsAsync(CancellationToken cancellationToken = default) - { - using var scope = _agentPoolsClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.GetAvailableAgentPoolVersions"); - scope.Start(); - try - { - var response = await _agentPoolsRestClient.GetAvailableAgentPoolVersionsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more details about the version lifecycle. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions - /// - /// - /// Operation Id - /// AgentPools_GetAvailableAgentPoolVersions - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// - /// The cancellation token to use. - public virtual Response GetAvailableAgentPoolVersions(CancellationToken cancellationToken = default) - { - using var scope = _agentPoolsClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.GetAvailableAgentPoolVersions"); - scope.Start(); - try - { - var response = _agentPoolsRestClient.GetAvailableAgentPoolVersions(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources - /// - /// - /// Operation Id - /// PrivateLinkResources_List - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetPrivateLinkResourcesAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _privateLinkResourcesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => ContainerServicePrivateLinkResourceData.DeserializeContainerServicePrivateLinkResourceData(e), _privateLinkResourcesClientDiagnostics, Pipeline, "ContainerServiceManagedClusterResource.GetPrivateLinkResources", "value", null, cancellationToken); - } - - /// - /// To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources - /// - /// - /// Operation Id - /// PrivateLinkResources_List - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetPrivateLinkResources(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _privateLinkResourcesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => ContainerServicePrivateLinkResourceData.DeserializeContainerServicePrivateLinkResourceData(e), _privateLinkResourcesClientDiagnostics, Pipeline, "ContainerServiceManagedClusterResource.GetPrivateLinkResources", "value", null, cancellationToken); - } - - /// - /// Gets the private link service ID for the specified managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId - /// - /// - /// Operation Id - /// ResolvePrivateLinkServiceId_POST - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// - /// Parameters required in order to resolve a private link service ID. - /// The cancellation token to use. - /// is null. - public virtual async Task> ResolvePrivateLinkServiceIdAsync(ContainerServicePrivateLinkResourceData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _resolvePrivateLinkServiceIdClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.ResolvePrivateLinkServiceId"); - scope.Start(); - try - { - var response = await _resolvePrivateLinkServiceIdRestClient.PostAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, data, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the private link service ID for the specified managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId - /// - /// - /// Operation Id - /// ResolvePrivateLinkServiceId_POST - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// - /// Parameters required in order to resolve a private link service ID. - /// The cancellation token to use. - /// is null. - public virtual Response ResolvePrivateLinkServiceId(ContainerServicePrivateLinkResourceData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _resolvePrivateLinkServiceIdClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.ResolvePrivateLinkServiceId"); - scope.Start(); - try - { - var response = _resolvePrivateLinkServiceIdRestClient.Post(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, data, 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/managedClusters/{resourceName} - /// - /// - /// Operation Id - /// ManagedClusters_Get - /// - /// - /// Default Api Version - /// 2023-10-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 = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.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 _containerServiceManagedClusterManagedClustersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new ContainerServiceManagedClusterResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new ContainerServiceTagsObject(); - 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/managedClusters/{resourceName} - /// - /// - /// Operation Id - /// ManagedClusters_Get - /// - /// - /// Default Api Version - /// 2023-10-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 = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.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 = _containerServiceManagedClusterManagedClustersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new ContainerServiceManagedClusterResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new ContainerServiceTagsObject(); - 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/managedClusters/{resourceName} - /// - /// - /// Operation Id - /// ManagedClusters_Get - /// - /// - /// Default Api Version - /// 2023-10-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 = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.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 _containerServiceManagedClusterManagedClustersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new ContainerServiceManagedClusterResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new ContainerServiceTagsObject(); - 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/managedClusters/{resourceName} - /// - /// - /// Operation Id - /// ManagedClusters_Get - /// - /// - /// Default Api Version - /// 2023-10-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 = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.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 = _containerServiceManagedClusterManagedClustersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new ContainerServiceManagedClusterResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new ContainerServiceTagsObject(); - 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/managedClusters/{resourceName} - /// - /// - /// Operation Id - /// ManagedClusters_Get - /// - /// - /// Default Api Version - /// 2023-10-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 = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.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 _containerServiceManagedClusterManagedClustersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new ContainerServiceManagedClusterResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new ContainerServiceTagsObject(); - 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/managedClusters/{resourceName} - /// - /// - /// Operation Id - /// ManagedClusters_Get - /// - /// - /// Default Api Version - /// 2023-10-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 = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.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 = _containerServiceManagedClusterManagedClustersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new ContainerServiceManagedClusterResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new ContainerServiceTagsObject(); - 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/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServicePrivateEndpointConnectionCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServicePrivateEndpointConnectionCollection.cs deleted file mode 100644 index 35be2871f0a73..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServicePrivateEndpointConnectionCollection.cs +++ /dev/null @@ -1,493 +0,0 @@ -// 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; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// 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 GetContainerServicePrivateEndpointConnections method from an instance of . - /// - public partial class ContainerServicePrivateEndpointConnectionCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics; - private readonly PrivateEndpointConnectionsRestOperations _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient; - - /// Initializes a new instance of the class for mocking. - protected ContainerServicePrivateEndpointConnectionCollection() - { - } - - /// 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 ContainerServicePrivateEndpointConnectionCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ContainerServicePrivateEndpointConnectionResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ContainerServicePrivateEndpointConnectionResource.ResourceType, out string containerServicePrivateEndpointConnectionPrivateEndpointConnectionsApiVersion); - _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient = new PrivateEndpointConnectionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerServicePrivateEndpointConnectionPrivateEndpointConnectionsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ContainerServiceManagedClusterResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ContainerServiceManagedClusterResource.ResourceType), nameof(id)); - } - - /// - /// Updates a private endpoint connection. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName} - /// - /// - /// Operation Id - /// PrivateEndpointConnections_Update - /// - /// - /// Default Api Version - /// 2023-10-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 private endpoint connection. - /// The updated private endpoint connection. - /// 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 privateEndpointConnectionName, ContainerServicePrivateEndpointConnectionData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("ContainerServicePrivateEndpointConnectionCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, data, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(Response.FromValue(new ContainerServicePrivateEndpointConnectionResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Updates a private endpoint connection. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName} - /// - /// - /// Operation Id - /// PrivateEndpointConnections_Update - /// - /// - /// Default Api Version - /// 2023-10-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 private endpoint connection. - /// The updated private endpoint connection. - /// 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 privateEndpointConnectionName, ContainerServicePrivateEndpointConnectionData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("ContainerServicePrivateEndpointConnectionCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, data, cancellationToken); - var operation = new ContainerServiceArmOperation(Response.FromValue(new ContainerServicePrivateEndpointConnectionResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName} - /// - /// - /// Operation Id - /// PrivateEndpointConnections_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the private endpoint connection. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); - - using var scope = _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("ContainerServicePrivateEndpointConnectionCollection.Get"); - scope.Start(); - try - { - var response = await _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ContainerServicePrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName} - /// - /// - /// Operation Id - /// PrivateEndpointConnections_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the private endpoint connection. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string privateEndpointConnectionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); - - using var scope = _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("ContainerServicePrivateEndpointConnectionCollection.Get"); - scope.Start(); - try - { - var response = _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ContainerServicePrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections - /// - /// - /// Operation Id - /// PrivateEndpointConnections_List - /// - /// - /// Default Api Version - /// 2023-10-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) => _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new ContainerServicePrivateEndpointConnectionResource(Client, ContainerServicePrivateEndpointConnectionData.DeserializeContainerServicePrivateEndpointConnectionData(e)), _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, "ContainerServicePrivateEndpointConnectionCollection.GetAll", "value", null, cancellationToken); - } - - /// - /// To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections - /// - /// - /// Operation Id - /// PrivateEndpointConnections_List - /// - /// - /// Default Api Version - /// 2023-10-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) => _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new ContainerServicePrivateEndpointConnectionResource(Client, ContainerServicePrivateEndpointConnectionData.DeserializeContainerServicePrivateEndpointConnectionData(e)), _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, "ContainerServicePrivateEndpointConnectionCollection.GetAll", "value", null, cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName} - /// - /// - /// Operation Id - /// PrivateEndpointConnections_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the private endpoint connection. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); - - using var scope = _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("ContainerServicePrivateEndpointConnectionCollection.Exists"); - scope.Start(); - try - { - var response = await _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, 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/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName} - /// - /// - /// Operation Id - /// PrivateEndpointConnections_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the private endpoint connection. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string privateEndpointConnectionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); - - using var scope = _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("ContainerServicePrivateEndpointConnectionCollection.Exists"); - scope.Start(); - try - { - var response = _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, 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/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName} - /// - /// - /// Operation Id - /// PrivateEndpointConnections_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the private endpoint connection. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetIfExistsAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); - - using var scope = _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("ContainerServicePrivateEndpointConnectionCollection.GetIfExists"); - scope.Start(); - try - { - var response = await _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken: cancellationToken).ConfigureAwait(false); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new ContainerServicePrivateEndpointConnectionResource(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/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName} - /// - /// - /// Operation Id - /// PrivateEndpointConnections_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the private endpoint connection. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual NullableResponse GetIfExists(string privateEndpointConnectionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); - - using var scope = _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("ContainerServicePrivateEndpointConnectionCollection.GetIfExists"); - scope.Start(); - try - { - var response = _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken: cancellationToken); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new ContainerServicePrivateEndpointConnectionResource(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/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServicePrivateEndpointConnectionData.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServicePrivateEndpointConnectionData.cs deleted file mode 100644 index 0ad96e21b6929..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServicePrivateEndpointConnectionData.cs +++ /dev/null @@ -1,96 +0,0 @@ -// 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.ContainerService.Models; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// A class representing the ContainerServicePrivateEndpointConnection data model. - /// A private endpoint connection - /// - public partial class ContainerServicePrivateEndpointConnectionData : 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 ContainerServicePrivateEndpointConnectionData() - { - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The current provisioning state. - /// The resource of private endpoint. - /// A collection of information about the state of the connection between service consumer and provider. - /// Keeps track of any properties unknown to the library. - internal ContainerServicePrivateEndpointConnectionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ContainerServicePrivateEndpointConnectionProvisioningState? provisioningState, WritableSubResource privateEndpoint, ContainerServicePrivateLinkServiceConnectionState connectionState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) - { - ProvisioningState = provisioningState; - PrivateEndpoint = privateEndpoint; - ConnectionState = connectionState; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The current provisioning state. - public ContainerServicePrivateEndpointConnectionProvisioningState? ProvisioningState { get; } - /// The resource of private endpoint. - internal WritableSubResource PrivateEndpoint { get; set; } - /// Gets or sets Id. - public ResourceIdentifier PrivateEndpointId - { - get => PrivateEndpoint is null ? default : PrivateEndpoint.Id; - set - { - if (PrivateEndpoint is null) - PrivateEndpoint = new WritableSubResource(); - PrivateEndpoint.Id = value; - } - } - - /// A collection of information about the state of the connection between service consumer and provider. - public ContainerServicePrivateLinkServiceConnectionState ConnectionState { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBindingCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBindingCollection.cs deleted file mode 100644 index d25d0bbd2dc31..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBindingCollection.cs +++ /dev/null @@ -1,495 +0,0 @@ -// 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; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// 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 GetContainerServiceTrustedAccessRoleBindings method from an instance of . - /// - public partial class ContainerServiceTrustedAccessRoleBindingCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics; - private readonly TrustedAccessRoleBindingsRestOperations _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient; - - /// Initializes a new instance of the class for mocking. - protected ContainerServiceTrustedAccessRoleBindingCollection() - { - } - - /// 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 ContainerServiceTrustedAccessRoleBindingCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ContainerServiceTrustedAccessRoleBindingResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ContainerServiceTrustedAccessRoleBindingResource.ResourceType, out string containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsApiVersion); - _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient = new TrustedAccessRoleBindingsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ContainerServiceManagedClusterResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ContainerServiceManagedClusterResource.ResourceType), nameof(id)); - } - - /// - /// Create or update a trusted access role binding - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName} - /// - /// - /// Operation Id - /// TrustedAccessRoleBindings_CreateOrUpdate - /// - /// - /// Default Api Version - /// 2023-10-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 trusted access role binding. - /// A trusted access role binding. - /// 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 trustedAccessRoleBindingName, ContainerServiceTrustedAccessRoleBindingData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(trustedAccessRoleBindingName, nameof(trustedAccessRoleBindingName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics.CreateScope("ContainerServiceTrustedAccessRoleBindingCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, trustedAccessRoleBindingName, data, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(new ContainerServiceTrustedAccessRoleBindingOperationSource(Client), _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics, Pipeline, _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, trustedAccessRoleBindingName, data).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create or update a trusted access role binding - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName} - /// - /// - /// Operation Id - /// TrustedAccessRoleBindings_CreateOrUpdate - /// - /// - /// Default Api Version - /// 2023-10-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 trusted access role binding. - /// A trusted access role binding. - /// 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 trustedAccessRoleBindingName, ContainerServiceTrustedAccessRoleBindingData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(trustedAccessRoleBindingName, nameof(trustedAccessRoleBindingName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics.CreateScope("ContainerServiceTrustedAccessRoleBindingCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, trustedAccessRoleBindingName, data, cancellationToken); - var operation = new ContainerServiceArmOperation(new ContainerServiceTrustedAccessRoleBindingOperationSource(Client), _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics, Pipeline, _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, trustedAccessRoleBindingName, data).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a trusted access role binding. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName} - /// - /// - /// Operation Id - /// TrustedAccessRoleBindings_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of trusted access role binding. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string trustedAccessRoleBindingName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(trustedAccessRoleBindingName, nameof(trustedAccessRoleBindingName)); - - using var scope = _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics.CreateScope("ContainerServiceTrustedAccessRoleBindingCollection.Get"); - scope.Start(); - try - { - var response = await _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, trustedAccessRoleBindingName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ContainerServiceTrustedAccessRoleBindingResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a trusted access role binding. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName} - /// - /// - /// Operation Id - /// TrustedAccessRoleBindings_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of trusted access role binding. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string trustedAccessRoleBindingName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(trustedAccessRoleBindingName, nameof(trustedAccessRoleBindingName)); - - using var scope = _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics.CreateScope("ContainerServiceTrustedAccessRoleBindingCollection.Get"); - scope.Start(); - try - { - var response = _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, trustedAccessRoleBindingName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ContainerServiceTrustedAccessRoleBindingResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// List trusted access role bindings. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings - /// - /// - /// Operation Id - /// TrustedAccessRoleBindings_List - /// - /// - /// Default Api Version - /// 2023-10-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) => _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerServiceTrustedAccessRoleBindingResource(Client, ContainerServiceTrustedAccessRoleBindingData.DeserializeContainerServiceTrustedAccessRoleBindingData(e)), _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics, Pipeline, "ContainerServiceTrustedAccessRoleBindingCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// List trusted access role bindings. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings - /// - /// - /// Operation Id - /// TrustedAccessRoleBindings_List - /// - /// - /// Default Api Version - /// 2023-10-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) => _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerServiceTrustedAccessRoleBindingResource(Client, ContainerServiceTrustedAccessRoleBindingData.DeserializeContainerServiceTrustedAccessRoleBindingData(e)), _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics, Pipeline, "ContainerServiceTrustedAccessRoleBindingCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName} - /// - /// - /// Operation Id - /// TrustedAccessRoleBindings_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of trusted access role binding. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string trustedAccessRoleBindingName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(trustedAccessRoleBindingName, nameof(trustedAccessRoleBindingName)); - - using var scope = _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics.CreateScope("ContainerServiceTrustedAccessRoleBindingCollection.Exists"); - scope.Start(); - try - { - var response = await _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, trustedAccessRoleBindingName, 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/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName} - /// - /// - /// Operation Id - /// TrustedAccessRoleBindings_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of trusted access role binding. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string trustedAccessRoleBindingName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(trustedAccessRoleBindingName, nameof(trustedAccessRoleBindingName)); - - using var scope = _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics.CreateScope("ContainerServiceTrustedAccessRoleBindingCollection.Exists"); - scope.Start(); - try - { - var response = _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, trustedAccessRoleBindingName, 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/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName} - /// - /// - /// Operation Id - /// TrustedAccessRoleBindings_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of trusted access role binding. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetIfExistsAsync(string trustedAccessRoleBindingName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(trustedAccessRoleBindingName, nameof(trustedAccessRoleBindingName)); - - using var scope = _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics.CreateScope("ContainerServiceTrustedAccessRoleBindingCollection.GetIfExists"); - scope.Start(); - try - { - var response = await _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, trustedAccessRoleBindingName, cancellationToken: cancellationToken).ConfigureAwait(false); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new ContainerServiceTrustedAccessRoleBindingResource(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/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName} - /// - /// - /// Operation Id - /// TrustedAccessRoleBindings_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of trusted access role binding. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual NullableResponse GetIfExists(string trustedAccessRoleBindingName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(trustedAccessRoleBindingName, nameof(trustedAccessRoleBindingName)); - - using var scope = _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics.CreateScope("ContainerServiceTrustedAccessRoleBindingCollection.GetIfExists"); - scope.Start(); - try - { - var response = _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, trustedAccessRoleBindingName, cancellationToken: cancellationToken); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new ContainerServiceTrustedAccessRoleBindingResource(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/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBindingData.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBindingData.cs deleted file mode 100644 index 5405d11d531fa..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBindingData.cs +++ /dev/null @@ -1,97 +0,0 @@ -// 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.ContainerService.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// A class representing the ContainerServiceTrustedAccessRoleBinding data model. - /// Defines binding between a resource and role - /// - public partial class ContainerServiceTrustedAccessRoleBindingData : 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 . - /// The ARM resource ID of source resource that trusted access is configured for. - /// A list of roles to bind, each item is a resource type qualified role name. For example: 'Microsoft.MachineLearningServices/workspaces/reader'. - /// or is null. - public ContainerServiceTrustedAccessRoleBindingData(ResourceIdentifier sourceResourceId, IEnumerable roles) - { - Argument.AssertNotNull(sourceResourceId, nameof(sourceResourceId)); - Argument.AssertNotNull(roles, nameof(roles)); - - SourceResourceId = sourceResourceId; - Roles = roles.ToList(); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The current provisioning state of trusted access role binding. - /// The ARM resource ID of source resource that trusted access is configured for. - /// A list of roles to bind, each item is a resource type qualified role name. For example: 'Microsoft.MachineLearningServices/workspaces/reader'. - /// Keeps track of any properties unknown to the library. - internal ContainerServiceTrustedAccessRoleBindingData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ContainerServiceTrustedAccessRoleBindingProvisioningState? provisioningState, ResourceIdentifier sourceResourceId, IList roles, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) - { - ProvisioningState = provisioningState; - SourceResourceId = sourceResourceId; - Roles = roles; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ContainerServiceTrustedAccessRoleBindingData() - { - } - - /// The current provisioning state of trusted access role binding. - public ContainerServiceTrustedAccessRoleBindingProvisioningState? ProvisioningState { get; } - /// The ARM resource ID of source resource that trusted access is configured for. - public ResourceIdentifier SourceResourceId { get; set; } - /// A list of roles to bind, each item is a resource type qualified role name. For example: 'Microsoft.MachineLearningServices/workspaces/reader'. - public IList Roles { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBindingResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBindingResource.cs deleted file mode 100644 index 87346b74f98f4..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBindingResource.cs +++ /dev/null @@ -1,349 +0,0 @@ -// 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; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// A Class representing a ContainerServiceTrustedAccessRoleBinding 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 GetContainerServiceTrustedAccessRoleBindingResource method. - /// Otherwise you can get one from its parent resource using the GetContainerServiceTrustedAccessRoleBinding method. - /// - public partial class ContainerServiceTrustedAccessRoleBindingResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The resourceName. - /// The trustedAccessRoleBindingName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string resourceName, string trustedAccessRoleBindingName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics; - private readonly TrustedAccessRoleBindingsRestOperations _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient; - private readonly ContainerServiceTrustedAccessRoleBindingData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.ContainerService/managedClusters/trustedAccessRoleBindings"; - - /// Initializes a new instance of the class for mocking. - protected ContainerServiceTrustedAccessRoleBindingResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal ContainerServiceTrustedAccessRoleBindingResource(ArmClient client, ContainerServiceTrustedAccessRoleBindingData 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 ContainerServiceTrustedAccessRoleBindingResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsApiVersion); - _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient = new TrustedAccessRoleBindingsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsApiVersion); -#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 ContainerServiceTrustedAccessRoleBindingData 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 trusted access role binding. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName} - /// - /// - /// Operation Id - /// TrustedAccessRoleBindings_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics.CreateScope("ContainerServiceTrustedAccessRoleBindingResource.Get"); - scope.Start(); - try - { - var response = await _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient.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 ContainerServiceTrustedAccessRoleBindingResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a trusted access role binding. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName} - /// - /// - /// Operation Id - /// TrustedAccessRoleBindings_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics.CreateScope("ContainerServiceTrustedAccessRoleBindingResource.Get"); - scope.Start(); - try - { - var response = _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ContainerServiceTrustedAccessRoleBindingResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Delete a trusted access role binding. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName} - /// - /// - /// Operation Id - /// TrustedAccessRoleBindings_Delete - /// - /// - /// Default Api Version - /// 2023-10-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 cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics.CreateScope("ContainerServiceTrustedAccessRoleBindingResource.Delete"); - scope.Start(); - try - { - var response = await _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(_containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics, Pipeline, _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).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 trusted access role binding. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName} - /// - /// - /// Operation Id - /// TrustedAccessRoleBindings_Delete - /// - /// - /// Default Api Version - /// 2023-10-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 cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics.CreateScope("ContainerServiceTrustedAccessRoleBindingResource.Delete"); - scope.Start(); - try - { - var response = _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new ContainerServiceArmOperation(_containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics, Pipeline, _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create or update a trusted access role binding - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName} - /// - /// - /// Operation Id - /// TrustedAccessRoleBindings_CreateOrUpdate - /// - /// - /// Default Api Version - /// 2023-10-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. - /// A trusted access role binding. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, ContainerServiceTrustedAccessRoleBindingData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics.CreateScope("ContainerServiceTrustedAccessRoleBindingResource.Update"); - scope.Start(); - try - { - var response = await _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(new ContainerServiceTrustedAccessRoleBindingOperationSource(Client), _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics, Pipeline, _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create or update a trusted access role binding - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName} - /// - /// - /// Operation Id - /// TrustedAccessRoleBindings_CreateOrUpdate - /// - /// - /// Default Api Version - /// 2023-10-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. - /// A trusted access role binding. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, ContainerServiceTrustedAccessRoleBindingData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics.CreateScope("ContainerServiceTrustedAccessRoleBindingResource.Update"); - scope.Start(); - try - { - var response = _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); - var operation = new ContainerServiceArmOperation(new ContainerServiceTrustedAccessRoleBindingOperationSource(Client), _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics, Pipeline, _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/ContainerServiceExtensions.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/ContainerServiceExtensions.cs index 6471d0725cc5e..191a1ae79a301 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/ContainerServiceExtensions.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/ContainerServiceExtensions.cs @@ -12,7 +12,6 @@ using Azure.Core; using Azure.ResourceManager; using Azure.ResourceManager.ContainerService.Mocking; -using Azure.ResourceManager.ContainerService.Models; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.ContainerService @@ -36,768 +35,244 @@ private static MockableContainerServiceSubscriptionResource GetMockableContainer } /// - /// 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. + /// 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. + /// 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 OSOptionProfileResource GetOSOptionProfileResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static FleetResource GetFleetResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableContainerServiceArmClient(client).GetOSOptionProfileResource(id); + return GetMockableContainerServiceArmClient(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. + /// 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. + /// 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 ManagedClusterUpgradeProfileResource GetManagedClusterUpgradeProfileResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static FleetMemberResource GetFleetMemberResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableContainerServiceArmClient(client).GetManagedClusterUpgradeProfileResource(id); + return GetMockableContainerServiceArmClient(client).GetFleetMemberResource(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. + /// 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. + /// 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 ContainerServiceManagedClusterResource GetContainerServiceManagedClusterResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static UpdateRunResource GetUpdateRunResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableContainerServiceArmClient(client).GetContainerServiceManagedClusterResource(id); + return GetMockableContainerServiceArmClient(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. + /// 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. + /// 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 MeshRevisionProfileResource GetMeshRevisionProfileResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static FleetUpdateStrategyResource GetFleetUpdateStrategyResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableContainerServiceArmClient(client).GetMeshRevisionProfileResource(id); + return GetMockableContainerServiceArmClient(client).GetFleetUpdateStrategyResource(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. + /// Gets a collection of FleetResources in the ResourceGroupResource. /// /// 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 MeshUpgradeProfileResource GetMeshUpgradeProfileResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableContainerServiceArmClient(client).GetMeshUpgradeProfileResource(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 ContainerServiceMaintenanceConfigurationResource GetContainerServiceMaintenanceConfigurationResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableContainerServiceArmClient(client).GetContainerServiceMaintenanceConfigurationResource(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 ContainerServiceAgentPoolResource GetContainerServiceAgentPoolResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableContainerServiceArmClient(client).GetContainerServiceAgentPoolResource(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 AgentPoolUpgradeProfileResource GetAgentPoolUpgradeProfileResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableContainerServiceArmClient(client).GetAgentPoolUpgradeProfileResource(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 ContainerServicePrivateEndpointConnectionResource GetContainerServicePrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableContainerServiceArmClient(client).GetContainerServicePrivateEndpointConnectionResource(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 AgentPoolSnapshotResource GetAgentPoolSnapshotResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableContainerServiceArmClient(client).GetAgentPoolSnapshotResource(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 ContainerServiceTrustedAccessRoleBindingResource GetContainerServiceTrustedAccessRoleBindingResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableContainerServiceArmClient(client).GetContainerServiceTrustedAccessRoleBindingResource(id); - } - - /// - /// Gets a collection of ContainerServiceManagedClusterResources in the ResourceGroupResource. - /// - /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// is null. - /// An object representing collection of ContainerServiceManagedClusterResources and their operations over a ContainerServiceManagedClusterResource. - public static ContainerServiceManagedClusterCollection GetContainerServiceManagedClusters(this ResourceGroupResource resourceGroupResource) + /// 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 GetMockableContainerServiceResourceGroupResource(resourceGroupResource).GetContainerServiceManagedClusters(); + return GetMockableContainerServiceResourceGroupResource(resourceGroupResource).GetFleets(); } /// - /// Gets a managed cluster. + /// Gets a Fleet. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} /// /// /// Operation Id - /// ManagedClusters_Get + /// Fleets_Get /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-02-02-preview /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// The name of the managed cluster resource. + /// 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. + /// or is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static async Task> GetContainerServiceManagedClusterAsync(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) + public static async Task> GetFleetAsync(this ResourceGroupResource resourceGroupResource, string fleetName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return await GetMockableContainerServiceResourceGroupResource(resourceGroupResource).GetContainerServiceManagedClusterAsync(resourceName, cancellationToken).ConfigureAwait(false); + return await GetMockableContainerServiceResourceGroupResource(resourceGroupResource).GetFleetAsync(fleetName, cancellationToken).ConfigureAwait(false); } /// - /// Gets a managed cluster. + /// Gets a Fleet. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} /// /// /// Operation Id - /// ManagedClusters_Get + /// Fleets_Get /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-02-02-preview /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// The name of the managed cluster resource. + /// 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. + /// or is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static Response GetContainerServiceManagedCluster(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) + public static Response GetFleet(this ResourceGroupResource resourceGroupResource, string fleetName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return GetMockableContainerServiceResourceGroupResource(resourceGroupResource).GetContainerServiceManagedCluster(resourceName, cancellationToken); + return GetMockableContainerServiceResourceGroupResource(resourceGroupResource).GetFleet(fleetName, cancellationToken); } /// - /// Gets a collection of AgentPoolSnapshotResources 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 AgentPoolSnapshotResources and their operations over a AgentPoolSnapshotResource. - public static AgentPoolSnapshotCollection GetAgentPoolSnapshots(this ResourceGroupResource resourceGroupResource) - { - Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - - return GetMockableContainerServiceResourceGroupResource(resourceGroupResource).GetAgentPoolSnapshots(); - } - - /// - /// Gets a snapshot. + /// Lists fleets in the specified subscription. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName} + /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/fleets /// /// /// Operation Id - /// Snapshots_Get + /// Fleets_ListBySubscription /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-02-02-preview /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The name of the managed cluster 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> GetAgentPoolSnapshotAsync(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - - return await GetMockableContainerServiceResourceGroupResource(resourceGroupResource).GetAgentPoolSnapshotAsync(resourceName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets a snapshot. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName} - /// - /// - /// Operation Id - /// Snapshots_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public static Response GetAgentPoolSnapshot(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - - return GetMockableContainerServiceResourceGroupResource(resourceGroupResource).GetAgentPoolSnapshot(resourceName, cancellationToken); - } - - /// - /// Gets a collection of MeshRevisionProfileResources in the SubscriptionResource. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The name of the Azure region. - /// is null. - /// An object representing collection of MeshRevisionProfileResources and their operations over a MeshRevisionProfileResource. - public static MeshRevisionProfileCollection GetMeshRevisionProfiles(this SubscriptionResource subscriptionResource, AzureLocation location) - { - Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - - return GetMockableContainerServiceSubscriptionResource(subscriptionResource).GetMeshRevisionProfiles(location); - } - - /// - /// Contains extra metadata on the revision, including supported revisions, cluster compatibility and available upgrades - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles/{mode} - /// - /// - /// Operation Id - /// ManagedClusters_GetMeshRevisionProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The name of the Azure region. - /// The mode of the mesh. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public static async Task> GetMeshRevisionProfileAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string mode, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - - return await GetMockableContainerServiceSubscriptionResource(subscriptionResource).GetMeshRevisionProfileAsync(location, mode, cancellationToken).ConfigureAwait(false); - } - - /// - /// Contains extra metadata on the revision, including supported revisions, cluster compatibility and available upgrades - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles/{mode} - /// - /// - /// Operation Id - /// ManagedClusters_GetMeshRevisionProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The name of the Azure region. - /// The mode of the mesh. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public static Response GetMeshRevisionProfile(this SubscriptionResource subscriptionResource, AzureLocation location, string mode, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - - return GetMockableContainerServiceSubscriptionResource(subscriptionResource).GetMeshRevisionProfile(location, mode, cancellationToken); - } - - /// - /// Contains extra metadata on the version, including supported patch versions, capabilities, available upgrades, and details on preview status of the version - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/kubernetesVersions - /// - /// - /// Operation Id - /// ManagedClusters_ListKubernetesVersions - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The name of the Azure region. - /// The cancellation token to use. - /// is null. - public static async Task> GetKubernetesVersionsManagedClusterAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - - return await GetMockableContainerServiceSubscriptionResource(subscriptionResource).GetKubernetesVersionsManagedClusterAsync(location, cancellationToken).ConfigureAwait(false); - } - - /// - /// Contains extra metadata on the version, including supported patch versions, capabilities, available upgrades, and details on preview status of the version - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/kubernetesVersions - /// - /// - /// Operation Id - /// ManagedClusters_ListKubernetesVersions - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The name of the Azure region. - /// The cancellation token to use. - /// is null. - public static Response GetKubernetesVersionsManagedCluster(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - - return GetMockableContainerServiceSubscriptionResource(subscriptionResource).GetKubernetesVersionsManagedCluster(location, cancellationToken); - } - - /// - /// Gets a list of managed clusters in the specified subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters - /// - /// - /// Operation Id - /// ManagedClusters_List - /// - /// - /// Default Api Version - /// 2023-10-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 GetContainerServiceManagedClustersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - - return GetMockableContainerServiceSubscriptionResource(subscriptionResource).GetContainerServiceManagedClustersAsync(cancellationToken); - } - - /// - /// Gets a list of managed clusters in the specified subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters - /// - /// - /// Operation Id - /// ManagedClusters_List - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. + /// 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 GetContainerServiceManagedClusters(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + /// 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 GetMockableContainerServiceSubscriptionResource(subscriptionResource).GetContainerServiceManagedClusters(cancellationToken); + return GetMockableContainerServiceSubscriptionResource(subscriptionResource).GetFleetsAsync(cancellationToken); } /// - /// Gets a list of snapshots in the specified subscription. + /// Lists fleets in the specified subscription. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/snapshots + /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/fleets /// /// /// Operation Id - /// Snapshots_List + /// Fleets_ListBySubscription /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-02-02-preview /// /// /// 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 GetAgentPoolSnapshotsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - - return GetMockableContainerServiceSubscriptionResource(subscriptionResource).GetAgentPoolSnapshotsAsync(cancellationToken); - } - - /// - /// Gets a list of snapshots in the specified subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/snapshots - /// - /// - /// Operation Id - /// Snapshots_List - /// - /// - /// Default Api Version - /// 2023-10-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 GetAgentPoolSnapshots(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - - return GetMockableContainerServiceSubscriptionResource(subscriptionResource).GetAgentPoolSnapshots(cancellationToken); - } - - /// - /// List supported trusted access roles. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/trustedAccessRoles - /// - /// - /// Operation Id - /// TrustedAccessRoles_List - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The name of the Azure region. - /// The cancellation token to use. - /// is null. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetTrustedAccessRolesAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - - return GetMockableContainerServiceSubscriptionResource(subscriptionResource).GetTrustedAccessRolesAsync(location, cancellationToken); - } - - /// - /// List supported trusted access roles. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/trustedAccessRoles - /// - /// - /// Operation Id - /// TrustedAccessRoles_List - /// - /// - /// Default Api Version - /// 2023-10-01 + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// The name of the Azure region. /// The cancellation token to use. /// is null. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetTrustedAccessRoles(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) + /// 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 GetMockableContainerServiceSubscriptionResource(subscriptionResource).GetTrustedAccessRoles(location, cancellationToken); + return GetMockableContainerServiceSubscriptionResource(subscriptionResource).GetFleets(cancellationToken); } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/MockableContainerServiceArmClient.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/MockableContainerServiceArmClient.cs index 53f0aaff95107..4587232bf8f2c 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/MockableContainerServiceArmClient.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/MockableContainerServiceArmClient.cs @@ -37,135 +37,51 @@ private string GetApiVersionOrNull(ResourceType resourceType) } /// - /// 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. + /// 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 OSOptionProfileResource GetOSOptionProfileResource(ResourceIdentifier id) + /// Returns a object. + public virtual FleetResource GetFleetResource(ResourceIdentifier id) { - OSOptionProfileResource.ValidateResourceId(id); - return new OSOptionProfileResource(Client, 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. + /// 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 ManagedClusterUpgradeProfileResource GetManagedClusterUpgradeProfileResource(ResourceIdentifier id) + /// Returns a object. + public virtual FleetMemberResource GetFleetMemberResource(ResourceIdentifier id) { - ManagedClusterUpgradeProfileResource.ValidateResourceId(id); - return new ManagedClusterUpgradeProfileResource(Client, id); + FleetMemberResource.ValidateResourceId(id); + return new FleetMemberResource(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. + /// 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 ContainerServiceManagedClusterResource GetContainerServiceManagedClusterResource(ResourceIdentifier id) + /// Returns a object. + public virtual UpdateRunResource GetUpdateRunResource(ResourceIdentifier id) { - ContainerServiceManagedClusterResource.ValidateResourceId(id); - return new ContainerServiceManagedClusterResource(Client, 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. + /// 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 MeshRevisionProfileResource GetMeshRevisionProfileResource(ResourceIdentifier id) + /// Returns a object. + public virtual FleetUpdateStrategyResource GetFleetUpdateStrategyResource(ResourceIdentifier id) { - MeshRevisionProfileResource.ValidateResourceId(id); - return new MeshRevisionProfileResource(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 MeshUpgradeProfileResource GetMeshUpgradeProfileResource(ResourceIdentifier id) - { - MeshUpgradeProfileResource.ValidateResourceId(id); - return new MeshUpgradeProfileResource(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 ContainerServiceMaintenanceConfigurationResource GetContainerServiceMaintenanceConfigurationResource(ResourceIdentifier id) - { - ContainerServiceMaintenanceConfigurationResource.ValidateResourceId(id); - return new ContainerServiceMaintenanceConfigurationResource(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 ContainerServiceAgentPoolResource GetContainerServiceAgentPoolResource(ResourceIdentifier id) - { - ContainerServiceAgentPoolResource.ValidateResourceId(id); - return new ContainerServiceAgentPoolResource(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 AgentPoolUpgradeProfileResource GetAgentPoolUpgradeProfileResource(ResourceIdentifier id) - { - AgentPoolUpgradeProfileResource.ValidateResourceId(id); - return new AgentPoolUpgradeProfileResource(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 ContainerServicePrivateEndpointConnectionResource GetContainerServicePrivateEndpointConnectionResource(ResourceIdentifier id) - { - ContainerServicePrivateEndpointConnectionResource.ValidateResourceId(id); - return new ContainerServicePrivateEndpointConnectionResource(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 AgentPoolSnapshotResource GetAgentPoolSnapshotResource(ResourceIdentifier id) - { - AgentPoolSnapshotResource.ValidateResourceId(id); - return new AgentPoolSnapshotResource(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 ContainerServiceTrustedAccessRoleBindingResource GetContainerServiceTrustedAccessRoleBindingResource(ResourceIdentifier id) - { - ContainerServiceTrustedAccessRoleBindingResource.ValidateResourceId(id); - return new ContainerServiceTrustedAccessRoleBindingResource(Client, id); + FleetUpdateStrategyResource.ValidateResourceId(id); + return new FleetUpdateStrategyResource(Client, id); } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/MockableContainerServiceResourceGroupResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/MockableContainerServiceResourceGroupResource.cs index 5e5c64d1cc447..a40eb46096f8a 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/MockableContainerServiceResourceGroupResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/MockableContainerServiceResourceGroupResource.cs @@ -36,142 +36,73 @@ private string GetApiVersionOrNull(ResourceType resourceType) return apiVersion; } - /// Gets a collection of ContainerServiceManagedClusterResources in the ResourceGroupResource. - /// An object representing collection of ContainerServiceManagedClusterResources and their operations over a ContainerServiceManagedClusterResource. - public virtual ContainerServiceManagedClusterCollection GetContainerServiceManagedClusters() + /// 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 ContainerServiceManagedClusterCollection(client, Id)); + return GetCachedClient(client => new FleetCollection(client, Id)); } /// - /// Gets a managed cluster. + /// Gets a Fleet. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} /// /// /// Operation Id - /// ManagedClusters_Get + /// Fleets_Get /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-02-02-preview /// /// /// Resource - /// + /// /// /// /// - /// The name of the managed cluster 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. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetContainerServiceManagedClusterAsync(string resourceName, CancellationToken cancellationToken = default) + public virtual async Task> GetFleetAsync(string fleetName, CancellationToken cancellationToken = default) { - return await GetContainerServiceManagedClusters().GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + return await GetFleets().GetAsync(fleetName, cancellationToken).ConfigureAwait(false); } /// - /// Gets a managed cluster. + /// Gets a Fleet. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} /// /// /// Operation Id - /// ManagedClusters_Get + /// Fleets_Get /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-02-02-preview /// /// /// Resource - /// + /// /// /// /// - /// The name of the managed cluster 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. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetContainerServiceManagedCluster(string resourceName, CancellationToken cancellationToken = default) + public virtual Response GetFleet(string fleetName, CancellationToken cancellationToken = default) { - return GetContainerServiceManagedClusters().Get(resourceName, cancellationToken); - } - - /// Gets a collection of AgentPoolSnapshotResources in the ResourceGroupResource. - /// An object representing collection of AgentPoolSnapshotResources and their operations over a AgentPoolSnapshotResource. - public virtual AgentPoolSnapshotCollection GetAgentPoolSnapshots() - { - return GetCachedClient(client => new AgentPoolSnapshotCollection(client, Id)); - } - - /// - /// Gets a snapshot. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName} - /// - /// - /// Operation Id - /// Snapshots_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetAgentPoolSnapshotAsync(string resourceName, CancellationToken cancellationToken = default) - { - return await GetAgentPoolSnapshots().GetAsync(resourceName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets a snapshot. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName} - /// - /// - /// Operation Id - /// Snapshots_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetAgentPoolSnapshot(string resourceName, CancellationToken cancellationToken = default) - { - return GetAgentPoolSnapshots().Get(resourceName, cancellationToken); + return GetFleets().Get(fleetName, cancellationToken); } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/MockableContainerServiceSubscriptionResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/MockableContainerServiceSubscriptionResource.cs index a01fbd3f099cc..c0b9a64d57b07 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/MockableContainerServiceSubscriptionResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/MockableContainerServiceSubscriptionResource.cs @@ -5,30 +5,21 @@ #nullable disable -using System; using System.Threading; -using System.Threading.Tasks; using Autorest.CSharp.Core; using Azure; using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; using Azure.ResourceManager.ContainerService; -using Azure.ResourceManager.ContainerService.Models; namespace Azure.ResourceManager.ContainerService.Mocking { /// A class to add extension methods to SubscriptionResource. public partial class MockableContainerServiceSubscriptionResource : ArmResource { - private ClientDiagnostics _managedClustersClientDiagnostics; - private ManagedClustersRestOperations _managedClustersRestClient; - private ClientDiagnostics _containerServiceManagedClusterManagedClustersClientDiagnostics; - private ManagedClustersRestOperations _containerServiceManagedClusterManagedClustersRestClient; - private ClientDiagnostics _agentPoolSnapshotSnapshotsClientDiagnostics; - private SnapshotsRestOperations _agentPoolSnapshotSnapshotsRestClient; - private ClientDiagnostics _trustedAccessRolesClientDiagnostics; - private TrustedAccessRolesRestOperations _trustedAccessRolesRestClient; + private ClientDiagnostics _fleetClientDiagnostics; + private FleetsRestOperations _fleetRestClient; /// Initializes a new instance of the class for mocking. protected MockableContainerServiceSubscriptionResource() @@ -42,14 +33,8 @@ internal MockableContainerServiceSubscriptionResource(ArmClient client, Resource { } - private ClientDiagnostics ManagedClustersClientDiagnostics => _managedClustersClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ContainerService", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private ManagedClustersRestOperations ManagedClustersRestClient => _managedClustersRestClient ??= new ManagedClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - private ClientDiagnostics ContainerServiceManagedClusterManagedClustersClientDiagnostics => _containerServiceManagedClusterManagedClustersClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ContainerService", ContainerServiceManagedClusterResource.ResourceType.Namespace, Diagnostics); - private ManagedClustersRestOperations ContainerServiceManagedClusterManagedClustersRestClient => _containerServiceManagedClusterManagedClustersRestClient ??= new ManagedClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(ContainerServiceManagedClusterResource.ResourceType)); - private ClientDiagnostics AgentPoolSnapshotSnapshotsClientDiagnostics => _agentPoolSnapshotSnapshotsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ContainerService", AgentPoolSnapshotResource.ResourceType.Namespace, Diagnostics); - private SnapshotsRestOperations AgentPoolSnapshotSnapshotsRestClient => _agentPoolSnapshotSnapshotsRestClient ??= new SnapshotsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(AgentPoolSnapshotResource.ResourceType)); - private ClientDiagnostics TrustedAccessRolesClientDiagnostics => _trustedAccessRolesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ContainerService", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private TrustedAccessRolesRestOperations TrustedAccessRolesRestClient => _trustedAccessRolesRestClient ??= new TrustedAccessRolesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private ClientDiagnostics FleetClientDiagnostics => _fleetClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ContainerService", FleetResource.ResourceType.Namespace, Diagnostics); + private FleetsRestOperations FleetRestClient => _fleetRestClient ??= new FleetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(FleetResource.ResourceType)); private string GetApiVersionOrNull(ResourceType resourceType) { @@ -57,320 +42,64 @@ private string GetApiVersionOrNull(ResourceType resourceType) return apiVersion; } - /// Gets a collection of MeshRevisionProfileResources in the SubscriptionResource. - /// The name of the Azure region. - /// An object representing collection of MeshRevisionProfileResources and their operations over a MeshRevisionProfileResource. - public virtual MeshRevisionProfileCollection GetMeshRevisionProfiles(AzureLocation location) - { - return new MeshRevisionProfileCollection(Client, Id, location); - } - - /// - /// Contains extra metadata on the revision, including supported revisions, cluster compatibility and available upgrades - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles/{mode} - /// - /// - /// Operation Id - /// ManagedClusters_GetMeshRevisionProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the Azure region. - /// The mode of the mesh. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetMeshRevisionProfileAsync(AzureLocation location, string mode, CancellationToken cancellationToken = default) - { - return await GetMeshRevisionProfiles(location).GetAsync(mode, cancellationToken).ConfigureAwait(false); - } - /// - /// Contains extra metadata on the revision, including supported revisions, cluster compatibility and available upgrades + /// Lists fleets in the specified subscription. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles/{mode} + /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/fleets /// /// /// Operation Id - /// ManagedClusters_GetMeshRevisionProfile + /// Fleets_ListBySubscription /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-02-02-preview /// /// /// Resource - /// - /// - /// - /// - /// The name of the Azure region. - /// The mode of the mesh. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetMeshRevisionProfile(AzureLocation location, string mode, CancellationToken cancellationToken = default) - { - return GetMeshRevisionProfiles(location).Get(mode, cancellationToken); - } - - /// - /// Contains extra metadata on the version, including supported patch versions, capabilities, available upgrades, and details on preview status of the version - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/kubernetesVersions - /// - /// - /// Operation Id - /// ManagedClusters_ListKubernetesVersions - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// - /// The name of the Azure region. - /// The cancellation token to use. - public virtual async Task> GetKubernetesVersionsManagedClusterAsync(AzureLocation location, CancellationToken cancellationToken = default) - { - using var scope = ManagedClustersClientDiagnostics.CreateScope("MockableContainerServiceSubscriptionResource.GetKubernetesVersionsManagedCluster"); - scope.Start(); - try - { - var response = await ManagedClustersRestClient.ListKubernetesVersionsAsync(Id.SubscriptionId, location, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Contains extra metadata on the version, including supported patch versions, capabilities, available upgrades, and details on preview status of the version - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/kubernetesVersions - /// - /// - /// Operation Id - /// ManagedClusters_ListKubernetesVersions - /// - /// - /// Default Api Version - /// 2023-10-01 + /// /// /// /// - /// The name of the Azure region. /// The cancellation token to use. - public virtual Response GetKubernetesVersionsManagedCluster(AzureLocation location, CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetFleetsAsync(CancellationToken cancellationToken = default) { - using var scope = ManagedClustersClientDiagnostics.CreateScope("MockableContainerServiceSubscriptionResource.GetKubernetesVersionsManagedCluster"); - scope.Start(); - try - { - var response = ManagedClustersRestClient.ListKubernetesVersions(Id.SubscriptionId, location, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } + 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, "MockableContainerServiceSubscriptionResource.GetFleets", "value", "nextLink", cancellationToken); } /// - /// Gets a list of managed clusters in the specified subscription. + /// Lists fleets in the specified subscription. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters + /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/fleets /// /// /// Operation Id - /// ManagedClusters_List + /// Fleets_ListBySubscription /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-02-02-preview /// /// /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetContainerServiceManagedClustersAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => ContainerServiceManagedClusterManagedClustersRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ContainerServiceManagedClusterManagedClustersRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerServiceManagedClusterResource(Client, ContainerServiceManagedClusterData.DeserializeContainerServiceManagedClusterData(e)), ContainerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, "MockableContainerServiceSubscriptionResource.GetContainerServiceManagedClusters", "value", "nextLink", cancellationToken); - } - - /// - /// Gets a list of managed clusters in the specified subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters - /// - /// - /// Operation Id - /// ManagedClusters_List - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetContainerServiceManagedClusters(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => ContainerServiceManagedClusterManagedClustersRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ContainerServiceManagedClusterManagedClustersRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerServiceManagedClusterResource(Client, ContainerServiceManagedClusterData.DeserializeContainerServiceManagedClusterData(e)), ContainerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, "MockableContainerServiceSubscriptionResource.GetContainerServiceManagedClusters", "value", "nextLink", cancellationToken); - } - - /// - /// Gets a list of snapshots in the specified subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/snapshots - /// - /// - /// Operation Id - /// Snapshots_List - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAgentPoolSnapshotsAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => AgentPoolSnapshotSnapshotsRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AgentPoolSnapshotSnapshotsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AgentPoolSnapshotResource(Client, AgentPoolSnapshotData.DeserializeAgentPoolSnapshotData(e)), AgentPoolSnapshotSnapshotsClientDiagnostics, Pipeline, "MockableContainerServiceSubscriptionResource.GetAgentPoolSnapshots", "value", "nextLink", cancellationToken); - } - - /// - /// Gets a list of snapshots in the specified subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/snapshots - /// - /// - /// Operation Id - /// Snapshots_List - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAgentPoolSnapshots(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => AgentPoolSnapshotSnapshotsRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AgentPoolSnapshotSnapshotsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AgentPoolSnapshotResource(Client, AgentPoolSnapshotData.DeserializeAgentPoolSnapshotData(e)), AgentPoolSnapshotSnapshotsClientDiagnostics, Pipeline, "MockableContainerServiceSubscriptionResource.GetAgentPoolSnapshots", "value", "nextLink", cancellationToken); - } - - /// - /// List supported trusted access roles. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/trustedAccessRoles - /// - /// - /// Operation Id - /// TrustedAccessRoles_List - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// - /// The name of the Azure region. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetTrustedAccessRolesAsync(AzureLocation location, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => TrustedAccessRolesRestClient.CreateListRequest(Id.SubscriptionId, location); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => TrustedAccessRolesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => ContainerServiceTrustedAccessRole.DeserializeContainerServiceTrustedAccessRole(e), TrustedAccessRolesClientDiagnostics, Pipeline, "MockableContainerServiceSubscriptionResource.GetTrustedAccessRoles", "value", "nextLink", cancellationToken); - } - - /// - /// List supported trusted access roles. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/trustedAccessRoles - /// - /// - /// Operation Id - /// TrustedAccessRoles_List - /// - /// - /// Default Api Version - /// 2023-10-01 + /// /// /// /// - /// The name of the Azure region. /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetTrustedAccessRoles(AzureLocation location, CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetFleets(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => TrustedAccessRolesRestClient.CreateListRequest(Id.SubscriptionId, location); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => TrustedAccessRolesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => ContainerServiceTrustedAccessRole.DeserializeContainerServiceTrustedAccessRole(e), TrustedAccessRolesClientDiagnostics, Pipeline, "MockableContainerServiceSubscriptionResource.GetTrustedAccessRoles", "value", "nextLink", cancellationToken); + 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, "MockableContainerServiceSubscriptionResource.GetFleets", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetCollection.cs similarity index 50% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotCollection.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetCollection.cs index 36546b877fd3c..813843036c0fc 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotCollection.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetCollection.cs @@ -21,28 +21,28 @@ namespace Azure.ResourceManager.ContainerService { /// - /// 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 GetAgentPoolSnapshots method from an instance of . + /// 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 AgentPoolSnapshotCollection : ArmCollection, IEnumerable, IAsyncEnumerable + public partial class FleetCollection : ArmCollection, IEnumerable, IAsyncEnumerable { - private readonly ClientDiagnostics _agentPoolSnapshotSnapshotsClientDiagnostics; - private readonly SnapshotsRestOperations _agentPoolSnapshotSnapshotsRestClient; + private readonly ClientDiagnostics _fleetClientDiagnostics; + private readonly FleetsRestOperations _fleetRestClient; - /// Initializes a new instance of the class for mocking. - protected AgentPoolSnapshotCollection() + /// Initializes a new instance of the class for mocking. + protected FleetCollection() { } - /// Initializes a new instance of the class. + /// 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 AgentPoolSnapshotCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + internal FleetCollection(ArmClient client, ResourceIdentifier id) : base(client, id) { - _agentPoolSnapshotSnapshotsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", AgentPoolSnapshotResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(AgentPoolSnapshotResource.ResourceType, out string agentPoolSnapshotSnapshotsApiVersion); - _agentPoolSnapshotSnapshotsRestClient = new SnapshotsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, agentPoolSnapshotSnapshotsApiVersion); + _fleetClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", FleetResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(FleetResource.ResourceType, out string fleetApiVersion); + _fleetRestClient = new FleetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -55,43 +55,45 @@ internal static void ValidateResourceId(ResourceIdentifier id) } /// - /// Creates or updates a snapshot. + /// Creates or updates a Fleet. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} /// /// /// Operation Id - /// Snapshots_CreateOrUpdate + /// Fleets_CreateOrUpdate /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-02-02-preview /// /// /// 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 managed cluster resource. - /// The snapshot to create or update. + /// 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 resourceName, AgentPoolSnapshotData data, CancellationToken cancellationToken = default) + /// 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(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotCollection.CreateOrUpdate"); + using var scope = _fleetClientDiagnostics.CreateScope("FleetCollection.CreateOrUpdate"); scope.Start(); try { - var response = await _agentPoolSnapshotSnapshotsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, resourceName, data, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(Response.FromValue(new AgentPoolSnapshotResource(Client, response), response.GetRawResponse())); + var response = await _fleetRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, fleetName, data, ifMatch, ifNoneMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceArmOperation(new FleetOperationSource(Client), _fleetClientDiagnostics, Pipeline, _fleetRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, fleetName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -104,43 +106,45 @@ public virtual async Task> CreateOrUpdat } /// - /// Creates or updates a snapshot. + /// Creates or updates a Fleet. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} /// /// /// Operation Id - /// Snapshots_CreateOrUpdate + /// Fleets_CreateOrUpdate /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-02-02-preview /// /// /// 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 managed cluster resource. - /// The snapshot to create or update. + /// 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 resourceName, AgentPoolSnapshotData data, CancellationToken cancellationToken = default) + /// 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(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotCollection.CreateOrUpdate"); + using var scope = _fleetClientDiagnostics.CreateScope("FleetCollection.CreateOrUpdate"); scope.Start(); try { - var response = _agentPoolSnapshotSnapshotsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, resourceName, data, cancellationToken); - var operation = new ContainerServiceArmOperation(Response.FromValue(new AgentPoolSnapshotResource(Client, response), response.GetRawResponse())); + var response = _fleetRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, fleetName, data, ifMatch, ifNoneMatch, cancellationToken); + var operation = new ContainerServiceArmOperation(new FleetOperationSource(Client), _fleetClientDiagnostics, Pipeline, _fleetRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, fleetName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -153,42 +157,42 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil } /// - /// Gets a snapshot. + /// Gets a Fleet. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} /// /// /// Operation Id - /// Snapshots_Get + /// Fleets_Get /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-02-02-preview /// /// /// Resource - /// + /// /// /// /// - /// The name of the managed cluster 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 resourceName, CancellationToken cancellationToken = default) + /// 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(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); - using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotCollection.Get"); + using var scope = _fleetClientDiagnostics.CreateScope("FleetCollection.Get"); scope.Start(); try { - var response = await _agentPoolSnapshotSnapshotsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, resourceName, cancellationToken).ConfigureAwait(false); + 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 AgentPoolSnapshotResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new FleetResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -198,42 +202,42 @@ public virtual async Task> GetAsync(string r } /// - /// Gets a snapshot. + /// Gets a Fleet. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} /// /// /// Operation Id - /// Snapshots_Get + /// Fleets_Get /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-02-02-preview /// /// /// Resource - /// + /// /// /// /// - /// The name of the managed cluster 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 resourceName, CancellationToken cancellationToken = default) + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string fleetName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); - using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotCollection.Get"); + using var scope = _fleetClientDiagnostics.CreateScope("FleetCollection.Get"); scope.Start(); try { - var response = _agentPoolSnapshotSnapshotsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, resourceName, cancellationToken); + var response = _fleetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new AgentPoolSnapshotResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new FleetResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -243,63 +247,63 @@ public virtual Response Get(string resourceName, Canc } /// - /// Lists snapshots in the specified subscription and resource group. + /// Lists fleets in the specified subscription and resource group. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets /// /// /// Operation Id - /// Snapshots_ListByResourceGroup + /// Fleets_ListByResourceGroup /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-02-02-preview /// /// /// 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) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _agentPoolSnapshotSnapshotsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _agentPoolSnapshotSnapshotsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AgentPoolSnapshotResource(Client, AgentPoolSnapshotData.DeserializeAgentPoolSnapshotData(e)), _agentPoolSnapshotSnapshotsClientDiagnostics, Pipeline, "AgentPoolSnapshotCollection.GetAll", "value", "nextLink", cancellationToken); + 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 snapshots in the specified subscription and resource group. + /// Lists fleets in the specified subscription and resource group. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets /// /// /// Operation Id - /// Snapshots_ListByResourceGroup + /// Fleets_ListByResourceGroup /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-02-02-preview /// /// /// 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) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _agentPoolSnapshotSnapshotsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _agentPoolSnapshotSnapshotsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AgentPoolSnapshotResource(Client, AgentPoolSnapshotData.DeserializeAgentPoolSnapshotData(e)), _agentPoolSnapshotSnapshotsClientDiagnostics, Pipeline, "AgentPoolSnapshotCollection.GetAll", "value", "nextLink", cancellationToken); + 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); } /// @@ -307,35 +311,35 @@ public virtual Pageable GetAll(CancellationToken canc /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} /// /// /// Operation Id - /// Snapshots_Get + /// Fleets_Get /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-02-02-preview /// /// /// Resource - /// + /// /// /// /// - /// The name of the managed cluster 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 resourceName, CancellationToken cancellationToken = default) + /// 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(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); - using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotCollection.Exists"); + using var scope = _fleetClientDiagnostics.CreateScope("FleetCollection.Exists"); scope.Start(); try { - var response = await _agentPoolSnapshotSnapshotsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, resourceName, cancellationToken: cancellationToken).ConfigureAwait(false); + 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) @@ -350,35 +354,35 @@ public virtual async Task> ExistsAsync(string resourceName, Cance /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} /// /// /// Operation Id - /// Snapshots_Get + /// Fleets_Get /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-02-02-preview /// /// /// Resource - /// + /// /// /// /// - /// The name of the managed cluster 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 resourceName, CancellationToken cancellationToken = default) + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string fleetName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); - using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotCollection.Exists"); + using var scope = _fleetClientDiagnostics.CreateScope("FleetCollection.Exists"); scope.Start(); try { - var response = _agentPoolSnapshotSnapshotsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, resourceName, cancellationToken: cancellationToken); + var response = _fleetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -393,38 +397,38 @@ public virtual Response Exists(string resourceName, CancellationToken canc /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} /// /// /// Operation Id - /// Snapshots_Get + /// Fleets_Get /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-02-02-preview /// /// /// Resource - /// + /// /// /// /// - /// The name of the managed cluster 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 resourceName, CancellationToken cancellationToken = default) + /// 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(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); - using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotCollection.GetIfExists"); + using var scope = _fleetClientDiagnostics.CreateScope("FleetCollection.GetIfExists"); scope.Start(); try { - var response = await _agentPoolSnapshotSnapshotsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, resourceName, cancellationToken: cancellationToken).ConfigureAwait(false); + 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 AgentPoolSnapshotResource(Client, response.Value), response.GetRawResponse()); + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FleetResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -438,38 +442,38 @@ public virtual async Task> GetIfExis /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} /// /// /// Operation Id - /// Snapshots_Get + /// Fleets_Get /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-02-02-preview /// /// /// Resource - /// + /// /// /// /// - /// The name of the managed cluster 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 resourceName, CancellationToken cancellationToken = default) + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string fleetName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); - using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotCollection.GetIfExists"); + using var scope = _fleetClientDiagnostics.CreateScope("FleetCollection.GetIfExists"); scope.Start(); try { - var response = _agentPoolSnapshotSnapshotsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, resourceName, cancellationToken: cancellationToken); + var response = _fleetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken: cancellationToken); if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new AgentPoolSnapshotResource(Client, response.Value), response.GetRawResponse()); + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FleetResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -478,7 +482,7 @@ public virtual NullableResponse GetIfExists(string re } } - IEnumerator IEnumerable.GetEnumerator() + IEnumerator IEnumerable.GetEnumerator() { return GetAll().GetEnumerator(); } @@ -488,7 +492,7 @@ IEnumerator IEnumerable.GetEnumerator() return GetAll().GetEnumerator(); } - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) { return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetData.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetData.cs new file mode 100644 index 0000000000000..67aa7ac41adc2 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetData.cs @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure; +using Azure.Core; +using Azure.ResourceManager.ContainerService.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerService +{ + /// + /// 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. + /// 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. + /// The status of the last operation. + /// The FleetHubProfile configures the Fleet's hub. + /// Keeps track of any properties unknown to the library. + internal FleetData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ETag? eTag, ResourceManager.Models.ManagedServiceIdentity identity, FleetProvisioningState? provisioningState, FleetHubProfile hubProfile, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + ETag = eTag; + Identity = identity; + ProvisioningState = provisioningState; + HubProfile = hubProfile; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FleetData() + { + } + + /// 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 ETag? ETag { get; } + /// Managed identity. + public ResourceManager.Models.ManagedServiceIdentity Identity { get; set; } + /// The status of the last operation. + public FleetProvisioningState? ProvisioningState { get; } + /// The FleetHubProfile configures the Fleet's hub. + public FleetHubProfile HubProfile { get; set; } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetMemberCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetMemberCollection.cs new file mode 100644 index 0000000000000..257aa0c650d45 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetMemberCollection.cs @@ -0,0 +1,499 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.ContainerService +{ + /// + /// 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.ContainerService", 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 + /// FleetMembers_Create + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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 ContainerServiceArmOperation(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 + /// FleetMembers_Create + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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 ContainerServiceArmOperation(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 + /// FleetMembers_Get + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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 + /// FleetMembers_Get + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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 + /// FleetMembers_ListByFleet + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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 + /// FleetMembers_ListByFleet + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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 + /// FleetMembers_Get + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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 + /// FleetMembers_Get + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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 + /// FleetMembers_Get + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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 + /// FleetMembers_Get + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetMemberData.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetMemberData.cs new file mode 100644 index 0000000000000..c283286089212 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetMemberData.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure; +using Azure.Core; +using Azure.ResourceManager.ContainerService.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerService +{ + /// + /// 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. + /// 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. + /// 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. + /// Keeps track of any properties unknown to the library. + internal FleetMemberData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ETag? eTag, ResourceIdentifier clusterResourceId, string group, FleetMemberProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + ETag = eTag; + ClusterResourceId = clusterResourceId; + Group = group; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// 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 ETag? ETag { get; } + /// 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; } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServicePrivateEndpointConnectionResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetMemberResource.cs similarity index 53% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServicePrivateEndpointConnectionResource.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetMemberResource.cs index 545bf76756d79..729c381e5cf0e 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServicePrivateEndpointConnectionResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetMemberResource.cs @@ -13,57 +13,58 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.ContainerService.Models; namespace Azure.ResourceManager.ContainerService { /// - /// A Class representing a ContainerServicePrivateEndpointConnection 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 GetContainerServicePrivateEndpointConnectionResource method. - /// Otherwise you can get one from its parent resource using the GetContainerServicePrivateEndpointConnection method. + /// 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 ContainerServicePrivateEndpointConnectionResource : ArmResource + public partial class FleetMemberResource : ArmResource { - /// Generate the resource identifier of a instance. + /// Generate the resource identifier of a instance. /// The subscriptionId. /// The resourceGroupName. - /// The resourceName. - /// The privateEndpointConnectionName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName) + /// 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/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}"; + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName}"; return new ResourceIdentifier(resourceId); } - private readonly ClientDiagnostics _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics; - private readonly PrivateEndpointConnectionsRestOperations _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient; - private readonly ContainerServicePrivateEndpointConnectionData _data; + 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/managedClusters/privateEndpointConnections"; + public static readonly ResourceType ResourceType = "Microsoft.ContainerService/fleets/members"; - /// Initializes a new instance of the class for mocking. - protected ContainerServicePrivateEndpointConnectionResource() + /// Initializes a new instance of the class for mocking. + protected FleetMemberResource() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The resource that is the target of operations. - internal ContainerServicePrivateEndpointConnectionResource(ArmClient client, ContainerServicePrivateEndpointConnectionData data) : this(client, data.Id) + internal FleetMemberResource(ArmClient client, FleetMemberData data) : this(client, data.Id) { HasData = true; _data = data; } - /// Initializes a new instance of the class. + /// 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 ContainerServicePrivateEndpointConnectionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + internal FleetMemberResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string containerServicePrivateEndpointConnectionPrivateEndpointConnectionsApiVersion); - _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient = new PrivateEndpointConnectionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerServicePrivateEndpointConnectionPrivateEndpointConnectionsApiVersion); + _fleetMemberClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string fleetMemberApiVersion); + _fleetMemberRestClient = new FleetMembersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetMemberApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -74,7 +75,7 @@ internal ContainerServicePrivateEndpointConnectionResource(ArmClient client, Res /// Gets the data representing this Feature. /// Throws if there is no data loaded in the current instance. - public virtual ContainerServicePrivateEndpointConnectionData Data + public virtual FleetMemberData Data { get { @@ -91,37 +92,37 @@ internal static void ValidateResourceId(ResourceIdentifier id) } /// - /// To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters + /// Get a FleetMember /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName} /// /// /// Operation Id - /// PrivateEndpointConnections_Get + /// FleetMembers_Get /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-02-02-preview /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("ContainerServicePrivateEndpointConnectionResource.Get"); + using var scope = _fleetMemberClientDiagnostics.CreateScope("FleetMemberResource.Get"); scope.Start(); try { - var response = await _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + 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 ContainerServicePrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new FleetMemberResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -131,37 +132,37 @@ public virtual async Task - /// To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters + /// Get a FleetMember /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName} /// /// /// Operation Id - /// PrivateEndpointConnections_Get + /// FleetMembers_Get /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-02-02-preview /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) + public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("ContainerServicePrivateEndpointConnectionResource.Get"); + using var scope = _fleetMemberClientDiagnostics.CreateScope("FleetMemberResource.Get"); scope.Start(); try { - var response = _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + 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 ContainerServicePrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new FleetMemberResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -171,36 +172,37 @@ public virtual Response Get(C } /// - /// Deletes a private endpoint connection. + /// Delete a FleetMember /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName} /// /// /// Operation Id - /// PrivateEndpointConnections_Delete + /// FleetMembers_Delete /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-02-02-preview /// /// /// 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, CancellationToken cancellationToken = default) + public virtual async Task DeleteAsync(WaitUntil waitUntil, string ifMatch = null, CancellationToken cancellationToken = default) { - using var scope = _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("ContainerServicePrivateEndpointConnectionResource.Delete"); + using var scope = _fleetMemberClientDiagnostics.CreateScope("FleetMemberResource.Delete"); scope.Start(); try { - var response = await _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(_containerServicePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2017-08-31"); + var response = await _fleetMemberRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceArmOperation(_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; @@ -213,36 +215,37 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell } /// - /// Deletes a private endpoint connection. + /// Delete a FleetMember /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName} /// /// /// Operation Id - /// PrivateEndpointConnections_Delete + /// FleetMembers_Delete /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-02-02-preview /// /// /// 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, CancellationToken cancellationToken = default) + public virtual ArmOperation Delete(WaitUntil waitUntil, string ifMatch = null, CancellationToken cancellationToken = default) { - using var scope = _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("ContainerServicePrivateEndpointConnectionResource.Delete"); + using var scope = _fleetMemberClientDiagnostics.CreateScope("FleetMemberResource.Delete"); scope.Start(); try { - var response = _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new ContainerServiceArmOperation(_containerServicePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2017-08-31"); + var response = _fleetMemberRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch, cancellationToken); + var operation = new ContainerServiceArmOperation(_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; @@ -255,40 +258,41 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel } /// - /// Updates a private endpoint connection. + /// Update a FleetMember /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName} /// /// /// Operation Id - /// PrivateEndpointConnections_Update + /// FleetMembers_Update /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-02-02-preview /// /// /// 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 updated private endpoint connection. + /// 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, ContainerServicePrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, FleetMemberPatch patch, string ifMatch = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(data, nameof(data)); + Argument.AssertNotNull(patch, nameof(patch)); - using var scope = _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("ContainerServicePrivateEndpointConnectionResource.Update"); + using var scope = _fleetMemberClientDiagnostics.CreateScope("FleetMemberResource.Update"); scope.Start(); try { - var response = await _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(Response.FromValue(new ContainerServicePrivateEndpointConnectionResource(Client, response), response.GetRawResponse())); + var response = await _fleetMemberRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, ifMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceArmOperation(new FleetMemberOperationSource(Client), _fleetMemberClientDiagnostics, Pipeline, _fleetMemberRestClient.CreateUpdateRequest(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; @@ -301,40 +305,41 @@ public virtual async Task - /// Updates a private endpoint connection. + /// Update a FleetMember /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName} /// /// /// Operation Id - /// PrivateEndpointConnections_Update + /// FleetMembers_Update /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-02-02-preview /// /// /// 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 updated private endpoint connection. + /// 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, ContainerServicePrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, FleetMemberPatch patch, string ifMatch = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(data, nameof(data)); + Argument.AssertNotNull(patch, nameof(patch)); - using var scope = _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("ContainerServicePrivateEndpointConnectionResource.Update"); + using var scope = _fleetMemberClientDiagnostics.CreateScope("FleetMemberResource.Update"); scope.Start(); try { - var response = _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); - var operation = new ContainerServiceArmOperation(Response.FromValue(new ContainerServicePrivateEndpointConnectionResource(Client, response), response.GetRawResponse())); + var response = _fleetMemberRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, ifMatch, cancellationToken); + var operation = new ContainerServiceArmOperation(new FleetMemberOperationSource(Client), _fleetMemberClientDiagnostics, Pipeline, _fleetMemberRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, ifMatch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetResource.cs new file mode 100644 index 0000000000000..b3d8d28614551 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetResource.cs @@ -0,0 +1,996 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.ContainerService.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.ContainerService +{ + /// + /// 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.ContainerService", 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 + /// FleetMembers_Get + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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 + /// FleetMembers_Get + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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 + /// UpdateRuns_Get + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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 + /// UpdateRuns_Get + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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 + /// FleetUpdateStrategies_Get + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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 + /// FleetUpdateStrategies_Get + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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 Fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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 + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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 + /// Fleets_Delete + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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 ContainerServiceArmOperation(_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 + /// Fleets_Delete + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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 ContainerServiceArmOperation(_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 + /// Fleets_Update + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceArmOperation(new FleetOperationSource(Client), _fleetClientDiagnostics, Pipeline, _fleetRestClient.CreateUpdateRequest(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 + /// Fleets_Update + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch, cancellationToken); + var operation = new ContainerServiceArmOperation(new FleetOperationSource(Client), _fleetClientDiagnostics, Pipeline, _fleetRestClient.CreateUpdateRequest(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 + /// 2024-02-02-preview + /// + /// + /// 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 + /// 2024-02-02-preview + /// + /// + /// 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 + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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 + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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 + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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 + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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 + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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 + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetUpdateStrategyCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetUpdateStrategyCollection.cs new file mode 100644 index 0000000000000..659913745f599 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetUpdateStrategyCollection.cs @@ -0,0 +1,499 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.ContainerService +{ + /// + /// 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.ContainerService", 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 + /// FleetUpdateStrategies_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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 ContainerServiceArmOperation(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 + /// FleetUpdateStrategies_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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 ContainerServiceArmOperation(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 + /// FleetUpdateStrategies_Get + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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 + /// FleetUpdateStrategies_Get + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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 + /// FleetUpdateStrategies_ListByFleet + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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 + /// FleetUpdateStrategies_ListByFleet + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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 + /// FleetUpdateStrategies_Get + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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 + /// FleetUpdateStrategies_Get + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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 + /// FleetUpdateStrategies_Get + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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 + /// FleetUpdateStrategies_Get + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetUpdateStrategyData.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetUpdateStrategyData.cs new file mode 100644 index 0000000000000..171bfbb6fe711 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/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; +using Azure.Core; +using Azure.ResourceManager.ContainerService.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerService +{ + /// + /// 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. + /// 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. + /// The provisioning state of the UpdateStrategy resource. + /// Defines the update sequence of the clusters. + /// Keeps track of any properties unknown to the library. + internal FleetUpdateStrategyData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ETag? eTag, FleetUpdateStrategyProvisioningState? provisioningState, UpdateRunStrategy strategy, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + ETag = eTag; + ProvisioningState = provisioningState; + Strategy = strategy; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// 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 ETag? ETag { get; } + /// 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); + } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetUpdateStrategyResource.cs similarity index 56% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationResource.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetUpdateStrategyResource.cs index ea1bd576970b3..185a4c58c594d 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetUpdateStrategyResource.cs @@ -17,53 +17,53 @@ namespace Azure.ResourceManager.ContainerService { /// - /// A Class representing a ContainerServiceMaintenanceConfiguration 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 GetContainerServiceMaintenanceConfigurationResource method. - /// Otherwise you can get one from its parent resource using the GetContainerServiceMaintenanceConfiguration method. + /// 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 ContainerServiceMaintenanceConfigurationResource : ArmResource + public partial class FleetUpdateStrategyResource : ArmResource { - /// Generate the resource identifier of a instance. + /// Generate the resource identifier of a instance. /// The subscriptionId. /// The resourceGroupName. - /// The resourceName. - /// The configName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string resourceName, string configName) + /// 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/managedClusters/{resourceName}/maintenanceConfigurations/{configName}"; + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName}"; return new ResourceIdentifier(resourceId); } - private readonly ClientDiagnostics _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics; - private readonly MaintenanceConfigurationsRestOperations _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient; - private readonly ContainerServiceMaintenanceConfigurationData _data; + 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/managedClusters/maintenanceConfigurations"; + public static readonly ResourceType ResourceType = "Microsoft.ContainerService/fleets/updateStrategies"; - /// Initializes a new instance of the class for mocking. - protected ContainerServiceMaintenanceConfigurationResource() + /// Initializes a new instance of the class for mocking. + protected FleetUpdateStrategyResource() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The resource that is the target of operations. - internal ContainerServiceMaintenanceConfigurationResource(ArmClient client, ContainerServiceMaintenanceConfigurationData data) : this(client, data.Id) + internal FleetUpdateStrategyResource(ArmClient client, FleetUpdateStrategyData data) : this(client, data.Id) { HasData = true; _data = data; } - /// Initializes a new instance of the class. + /// 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 ContainerServiceMaintenanceConfigurationResource(ArmClient client, ResourceIdentifier id) : base(client, id) + internal FleetUpdateStrategyResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string containerServiceMaintenanceConfigurationMaintenanceConfigurationsApiVersion); - _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient = new MaintenanceConfigurationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerServiceMaintenanceConfigurationMaintenanceConfigurationsApiVersion); + _fleetUpdateStrategyClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string fleetUpdateStrategyApiVersion); + _fleetUpdateStrategyRestClient = new FleetUpdateStrategiesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetUpdateStrategyApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -74,7 +74,7 @@ internal ContainerServiceMaintenanceConfigurationResource(ArmClient client, Reso /// Gets the data representing this Feature. /// Throws if there is no data loaded in the current instance. - public virtual ContainerServiceMaintenanceConfigurationData Data + public virtual FleetUpdateStrategyData Data { get { @@ -91,37 +91,37 @@ internal static void ValidateResourceId(ResourceIdentifier id) } /// - /// Gets the specified maintenance configuration of a managed cluster. + /// Get a FleetUpdateStrategy /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} /// /// /// Operation Id - /// MaintenanceConfigurations_Get + /// FleetUpdateStrategies_Get /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-02-02-preview /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics.CreateScope("ContainerServiceMaintenanceConfigurationResource.Get"); + using var scope = _fleetUpdateStrategyClientDiagnostics.CreateScope("FleetUpdateStrategyResource.Get"); scope.Start(); try { - var response = await _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + 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 ContainerServiceMaintenanceConfigurationResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new FleetUpdateStrategyResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -131,37 +131,37 @@ public virtual async Task - /// Gets the specified maintenance configuration of a managed cluster. + /// Get a FleetUpdateStrategy /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} /// /// /// Operation Id - /// MaintenanceConfigurations_Get + /// FleetUpdateStrategies_Get /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-02-02-preview /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) + public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics.CreateScope("ContainerServiceMaintenanceConfigurationResource.Get"); + using var scope = _fleetUpdateStrategyClientDiagnostics.CreateScope("FleetUpdateStrategyResource.Get"); scope.Start(); try { - var response = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + 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 ContainerServiceMaintenanceConfigurationResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new FleetUpdateStrategyResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -171,36 +171,37 @@ public virtual Response Get(Ca } /// - /// Deletes a maintenance configuration. + /// Delete a FleetUpdateStrategy /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} /// /// /// Operation Id - /// MaintenanceConfigurations_Delete + /// FleetUpdateStrategies_Delete /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-02-02-preview /// /// /// 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, CancellationToken cancellationToken = default) + public virtual async Task DeleteAsync(WaitUntil waitUntil, string ifMatch = null, CancellationToken cancellationToken = default) { - using var scope = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics.CreateScope("ContainerServiceMaintenanceConfigurationResource.Delete"); + using var scope = _fleetUpdateStrategyClientDiagnostics.CreateScope("FleetUpdateStrategyResource.Delete"); scope.Start(); try { - var response = await _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(response); + var response = await _fleetUpdateStrategyRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceArmOperation(_fleetUpdateStrategyClientDiagnostics, Pipeline, _fleetUpdateStrategyRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -213,36 +214,37 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell } /// - /// Deletes a maintenance configuration. + /// Delete a FleetUpdateStrategy /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} /// /// /// Operation Id - /// MaintenanceConfigurations_Delete + /// FleetUpdateStrategies_Delete /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-02-02-preview /// /// /// 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, CancellationToken cancellationToken = default) + public virtual ArmOperation Delete(WaitUntil waitUntil, string ifMatch = null, CancellationToken cancellationToken = default) { - using var scope = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics.CreateScope("ContainerServiceMaintenanceConfigurationResource.Delete"); + using var scope = _fleetUpdateStrategyClientDiagnostics.CreateScope("FleetUpdateStrategyResource.Delete"); scope.Start(); try { - var response = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new ContainerServiceArmOperation(response); + var response = _fleetUpdateStrategyRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch, cancellationToken); + var operation = new ContainerServiceArmOperation(_fleetUpdateStrategyClientDiagnostics, Pipeline, _fleetUpdateStrategyRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -255,40 +257,42 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel } /// - /// Creates or updates a maintenance configuration in the specified managed cluster. + /// Create a FleetUpdateStrategy /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} /// /// /// Operation Id - /// MaintenanceConfigurations_CreateOrUpdate + /// FleetUpdateStrategies_CreateOrUpdate /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-02-02-preview /// /// /// 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 maintenance configuration to create or update. + /// 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, ContainerServiceMaintenanceConfigurationData data, CancellationToken cancellationToken = default) + 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 = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics.CreateScope("ContainerServiceMaintenanceConfigurationResource.Update"); + using var scope = _fleetUpdateStrategyClientDiagnostics.CreateScope("FleetUpdateStrategyResource.Update"); scope.Start(); try { - var response = await _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(Response.FromValue(new ContainerServiceMaintenanceConfigurationResource(Client, response), response.GetRawResponse())); + var response = await _fleetUpdateStrategyRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceArmOperation(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; @@ -301,40 +305,42 @@ public virtual async Task - /// Creates or updates a maintenance configuration in the specified managed cluster. + /// Create a FleetUpdateStrategy /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} /// /// /// Operation Id - /// MaintenanceConfigurations_CreateOrUpdate + /// FleetUpdateStrategies_CreateOrUpdate /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-02-02-preview /// /// /// 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 maintenance configuration to create or update. + /// 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, ContainerServiceMaintenanceConfigurationData data, CancellationToken cancellationToken = default) + 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 = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics.CreateScope("ContainerServiceMaintenanceConfigurationResource.Update"); + using var scope = _fleetUpdateStrategyClientDiagnostics.CreateScope("FleetUpdateStrategyResource.Update"); scope.Start(); try { - var response = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); - var operation = new ContainerServiceArmOperation(Response.FromValue(new ContainerServiceMaintenanceConfigurationResource(Client, response), response.GetRawResponse())); + var response = _fleetUpdateStrategyRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch, cancellationToken); + var operation = new ContainerServiceArmOperation(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; diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/ContainerServiceAgentPoolOperationSource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/ContainerServiceAgentPoolOperationSource.cs deleted file mode 100644 index 82e36572f301e..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/ContainerServiceAgentPoolOperationSource.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.ContainerService -{ - internal class ContainerServiceAgentPoolOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal ContainerServiceAgentPoolOperationSource(ArmClient client) - { - _client = client; - } - - ContainerServiceAgentPoolResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = ContainerServiceAgentPoolData.DeserializeContainerServiceAgentPoolData(document.RootElement); - return new ContainerServiceAgentPoolResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = ContainerServiceAgentPoolData.DeserializeContainerServiceAgentPoolData(document.RootElement); - return new ContainerServiceAgentPoolResource(_client, data); - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/ContainerServiceManagedClusterOperationSource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/ContainerServiceManagedClusterOperationSource.cs deleted file mode 100644 index fc210e9b16c11..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/ContainerServiceManagedClusterOperationSource.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.ContainerService -{ - internal class ContainerServiceManagedClusterOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal ContainerServiceManagedClusterOperationSource(ArmClient client) - { - _client = client; - } - - ContainerServiceManagedClusterResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = ContainerServiceManagedClusterData.DeserializeContainerServiceManagedClusterData(document.RootElement); - return new ContainerServiceManagedClusterResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = ContainerServiceManagedClusterData.DeserializeContainerServiceManagedClusterData(document.RootElement); - return new ContainerServiceManagedClusterResource(_client, data); - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/ContainerServiceTrustedAccessRoleBindingOperationSource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/ContainerServiceTrustedAccessRoleBindingOperationSource.cs deleted file mode 100644 index 017676506cb12..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/ContainerServiceTrustedAccessRoleBindingOperationSource.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.ContainerService -{ - internal class ContainerServiceTrustedAccessRoleBindingOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal ContainerServiceTrustedAccessRoleBindingOperationSource(ArmClient client) - { - _client = client; - } - - ContainerServiceTrustedAccessRoleBindingResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = ContainerServiceTrustedAccessRoleBindingData.DeserializeContainerServiceTrustedAccessRoleBindingData(document.RootElement); - return new ContainerServiceTrustedAccessRoleBindingResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = ContainerServiceTrustedAccessRoleBindingData.DeserializeContainerServiceTrustedAccessRoleBindingData(document.RootElement); - return new ContainerServiceTrustedAccessRoleBindingResource(_client, data); - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/FleetMemberOperationSource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/FleetMemberOperationSource.cs new file mode 100644 index 0000000000000..04250be973cb7 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/FleetMemberOperationSource.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.ContainerService +{ + internal class FleetMemberOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal FleetMemberOperationSource(ArmClient client) + { + _client = client; + } + + FleetMemberResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = FleetMemberData.DeserializeFleetMemberData(document.RootElement); + return new FleetMemberResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = FleetMemberData.DeserializeFleetMemberData(document.RootElement); + return new FleetMemberResource(_client, data); + } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/FleetOperationSource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/FleetOperationSource.cs new file mode 100644 index 0000000000000..5feaf728a048b --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/FleetOperationSource.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.ContainerService +{ + internal class FleetOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal FleetOperationSource(ArmClient client) + { + _client = client; + } + + FleetResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = FleetData.DeserializeFleetData(document.RootElement); + return new FleetResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = FleetData.DeserializeFleetData(document.RootElement); + return new FleetResource(_client, data); + } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/FleetUpdateStrategyOperationSource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/FleetUpdateStrategyOperationSource.cs new file mode 100644 index 0000000000000..cce753fa3f5e9 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/FleetUpdateStrategyOperationSource.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.ContainerService +{ + internal class FleetUpdateStrategyOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal FleetUpdateStrategyOperationSource(ArmClient client) + { + _client = client; + } + + FleetUpdateStrategyResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = FleetUpdateStrategyData.DeserializeFleetUpdateStrategyData(document.RootElement); + return new FleetUpdateStrategyResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = FleetUpdateStrategyData.DeserializeFleetUpdateStrategyData(document.RootElement); + return new FleetUpdateStrategyResource(_client, data); + } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/ManagedClusterRunCommandResultOperationSource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/ManagedClusterRunCommandResultOperationSource.cs deleted file mode 100644 index e7f407e1289dc..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/ManagedClusterRunCommandResultOperationSource.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.ResourceManager.ContainerService.Models; - -namespace Azure.ResourceManager.ContainerService -{ - internal class ManagedClusterRunCommandResultOperationSource : IOperationSource - { - ManagedClusterRunCommandResult IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - return ManagedClusterRunCommandResult.DeserializeManagedClusterRunCommandResult(document.RootElement); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - return ManagedClusterRunCommandResult.DeserializeManagedClusterRunCommandResult(document.RootElement); - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/UpdateRunOperationSource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/UpdateRunOperationSource.cs new file mode 100644 index 0000000000000..8147cba644ea7 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/UpdateRunOperationSource.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.ContainerService +{ + internal class UpdateRunOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal UpdateRunOperationSource(ArmClient client) + { + _client = client; + } + + UpdateRunResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = UpdateRunData.DeserializeUpdateRunData(document.RootElement); + return new UpdateRunResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = UpdateRunData.DeserializeUpdateRunData(document.RootElement); + return new UpdateRunResource(_client, data); + } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ManagedClusterUpgradeProfileData.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ManagedClusterUpgradeProfileData.cs deleted file mode 100644 index 60e8ec5bb262c..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ManagedClusterUpgradeProfileData.cs +++ /dev/null @@ -1,93 +0,0 @@ -// 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.ContainerService.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// A class representing the ManagedClusterUpgradeProfile data model. - /// The list of available upgrades for compute pools. - /// - public partial class ManagedClusterUpgradeProfileData : 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 . - /// The list of available upgrade versions for the control plane. - /// The list of available upgrade versions for agent pools. - /// or is null. - internal ManagedClusterUpgradeProfileData(ManagedClusterPoolUpgradeProfile controlPlaneProfile, IEnumerable agentPoolProfiles) - { - Argument.AssertNotNull(controlPlaneProfile, nameof(controlPlaneProfile)); - Argument.AssertNotNull(agentPoolProfiles, nameof(agentPoolProfiles)); - - ControlPlaneProfile = controlPlaneProfile; - AgentPoolProfiles = agentPoolProfiles.ToList(); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The list of available upgrade versions for the control plane. - /// The list of available upgrade versions for agent pools. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterUpgradeProfileData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ManagedClusterPoolUpgradeProfile controlPlaneProfile, IReadOnlyList agentPoolProfiles, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) - { - ControlPlaneProfile = controlPlaneProfile; - AgentPoolProfiles = agentPoolProfiles; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ManagedClusterUpgradeProfileData() - { - } - - /// The list of available upgrade versions for the control plane. - public ManagedClusterPoolUpgradeProfile ControlPlaneProfile { get; } - /// The list of available upgrade versions for agent pools. - public IReadOnlyList AgentPoolProfiles { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ManagedClusterUpgradeProfileResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ManagedClusterUpgradeProfileResource.cs deleted file mode 100644 index fb631cd6798b3..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ManagedClusterUpgradeProfileResource.cs +++ /dev/null @@ -1,172 +0,0 @@ -// 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; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// A Class representing a ManagedClusterUpgradeProfile 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 GetManagedClusterUpgradeProfileResource method. - /// Otherwise you can get one from its parent resource using the GetManagedClusterUpgradeProfile method. - /// - public partial class ManagedClusterUpgradeProfileResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The resourceName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string resourceName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _managedClusterUpgradeProfileManagedClustersClientDiagnostics; - private readonly ManagedClustersRestOperations _managedClusterUpgradeProfileManagedClustersRestClient; - private readonly ManagedClusterUpgradeProfileData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.ContainerService/managedClusters/upgradeProfiles"; - - /// Initializes a new instance of the class for mocking. - protected ManagedClusterUpgradeProfileResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal ManagedClusterUpgradeProfileResource(ArmClient client, ManagedClusterUpgradeProfileData 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 ManagedClusterUpgradeProfileResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _managedClusterUpgradeProfileManagedClustersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string managedClusterUpgradeProfileManagedClustersApiVersion); - _managedClusterUpgradeProfileManagedClustersRestClient = new ManagedClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, managedClusterUpgradeProfileManagedClustersApiVersion); -#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 ManagedClusterUpgradeProfileData 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 the upgrade profile of a managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default - /// - /// - /// Operation Id - /// ManagedClusters_GetUpgradeProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _managedClusterUpgradeProfileManagedClustersClientDiagnostics.CreateScope("ManagedClusterUpgradeProfileResource.Get"); - scope.Start(); - try - { - var response = await _managedClusterUpgradeProfileManagedClustersRestClient.GetUpgradeProfileAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ManagedClusterUpgradeProfileResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the upgrade profile of a managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default - /// - /// - /// Operation Id - /// ManagedClusters_GetUpgradeProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _managedClusterUpgradeProfileManagedClustersClientDiagnostics.CreateScope("ManagedClusterUpgradeProfileResource.Get"); - scope.Start(); - try - { - var response = _managedClusterUpgradeProfileManagedClustersRestClient.GetUpgradeProfile(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ManagedClusterUpgradeProfileResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshRevisionProfileCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshRevisionProfileCollection.cs deleted file mode 100644 index d98ca7a5d714e..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshRevisionProfileCollection.cs +++ /dev/null @@ -1,401 +0,0 @@ -// 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; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// 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 GetMeshRevisionProfiles method from an instance of . - /// - public partial class MeshRevisionProfileCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _meshRevisionProfileManagedClustersClientDiagnostics; - private readonly ManagedClustersRestOperations _meshRevisionProfileManagedClustersRestClient; - private readonly AzureLocation _location; - - /// Initializes a new instance of the class for mocking. - protected MeshRevisionProfileCollection() - { - } - - /// 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. - /// The name of the Azure region. - internal MeshRevisionProfileCollection(ArmClient client, ResourceIdentifier id, AzureLocation location) : base(client, id) - { - _location = location; - _meshRevisionProfileManagedClustersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", MeshRevisionProfileResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(MeshRevisionProfileResource.ResourceType, out string meshRevisionProfileManagedClustersApiVersion); - _meshRevisionProfileManagedClustersRestClient = new ManagedClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, meshRevisionProfileManagedClustersApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != SubscriptionResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SubscriptionResource.ResourceType), nameof(id)); - } - - /// - /// Contains extra metadata on the revision, including supported revisions, cluster compatibility and available upgrades - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles/{mode} - /// - /// - /// Operation Id - /// ManagedClusters_GetMeshRevisionProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The mode of the mesh. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string mode, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(mode, nameof(mode)); - - using var scope = _meshRevisionProfileManagedClustersClientDiagnostics.CreateScope("MeshRevisionProfileCollection.Get"); - scope.Start(); - try - { - var response = await _meshRevisionProfileManagedClustersRestClient.GetMeshRevisionProfileAsync(Id.SubscriptionId, new AzureLocation(_location), mode, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new MeshRevisionProfileResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Contains extra metadata on the revision, including supported revisions, cluster compatibility and available upgrades - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles/{mode} - /// - /// - /// Operation Id - /// ManagedClusters_GetMeshRevisionProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The mode of the mesh. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string mode, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(mode, nameof(mode)); - - using var scope = _meshRevisionProfileManagedClustersClientDiagnostics.CreateScope("MeshRevisionProfileCollection.Get"); - scope.Start(); - try - { - var response = _meshRevisionProfileManagedClustersRestClient.GetMeshRevisionProfile(Id.SubscriptionId, new AzureLocation(_location), mode, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new MeshRevisionProfileResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Contains extra metadata on each revision, including supported revisions, cluster compatibility and available upgrades - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles - /// - /// - /// Operation Id - /// ManagedClusters_ListMeshRevisionProfiles - /// - /// - /// Default Api Version - /// 2023-10-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) => _meshRevisionProfileManagedClustersRestClient.CreateListMeshRevisionProfilesRequest(Id.SubscriptionId, new AzureLocation(_location)); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _meshRevisionProfileManagedClustersRestClient.CreateListMeshRevisionProfilesNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(_location)); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MeshRevisionProfileResource(Client, MeshRevisionProfileData.DeserializeMeshRevisionProfileData(e)), _meshRevisionProfileManagedClustersClientDiagnostics, Pipeline, "MeshRevisionProfileCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Contains extra metadata on each revision, including supported revisions, cluster compatibility and available upgrades - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles - /// - /// - /// Operation Id - /// ManagedClusters_ListMeshRevisionProfiles - /// - /// - /// Default Api Version - /// 2023-10-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) => _meshRevisionProfileManagedClustersRestClient.CreateListMeshRevisionProfilesRequest(Id.SubscriptionId, new AzureLocation(_location)); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _meshRevisionProfileManagedClustersRestClient.CreateListMeshRevisionProfilesNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(_location)); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MeshRevisionProfileResource(Client, MeshRevisionProfileData.DeserializeMeshRevisionProfileData(e)), _meshRevisionProfileManagedClustersClientDiagnostics, Pipeline, "MeshRevisionProfileCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles/{mode} - /// - /// - /// Operation Id - /// ManagedClusters_GetMeshRevisionProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The mode of the mesh. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string mode, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(mode, nameof(mode)); - - using var scope = _meshRevisionProfileManagedClustersClientDiagnostics.CreateScope("MeshRevisionProfileCollection.Exists"); - scope.Start(); - try - { - var response = await _meshRevisionProfileManagedClustersRestClient.GetMeshRevisionProfileAsync(Id.SubscriptionId, new AzureLocation(_location), mode, 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}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles/{mode} - /// - /// - /// Operation Id - /// ManagedClusters_GetMeshRevisionProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The mode of the mesh. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string mode, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(mode, nameof(mode)); - - using var scope = _meshRevisionProfileManagedClustersClientDiagnostics.CreateScope("MeshRevisionProfileCollection.Exists"); - scope.Start(); - try - { - var response = _meshRevisionProfileManagedClustersRestClient.GetMeshRevisionProfile(Id.SubscriptionId, new AzureLocation(_location), mode, 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}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles/{mode} - /// - /// - /// Operation Id - /// ManagedClusters_GetMeshRevisionProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The mode of the mesh. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetIfExistsAsync(string mode, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(mode, nameof(mode)); - - using var scope = _meshRevisionProfileManagedClustersClientDiagnostics.CreateScope("MeshRevisionProfileCollection.GetIfExists"); - scope.Start(); - try - { - var response = await _meshRevisionProfileManagedClustersRestClient.GetMeshRevisionProfileAsync(Id.SubscriptionId, new AzureLocation(_location), mode, cancellationToken: cancellationToken).ConfigureAwait(false); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new MeshRevisionProfileResource(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}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles/{mode} - /// - /// - /// Operation Id - /// ManagedClusters_GetMeshRevisionProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The mode of the mesh. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual NullableResponse GetIfExists(string mode, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(mode, nameof(mode)); - - using var scope = _meshRevisionProfileManagedClustersClientDiagnostics.CreateScope("MeshRevisionProfileCollection.GetIfExists"); - scope.Start(); - try - { - var response = _meshRevisionProfileManagedClustersRestClient.GetMeshRevisionProfile(Id.SubscriptionId, new AzureLocation(_location), mode, cancellationToken: cancellationToken); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new MeshRevisionProfileResource(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/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshRevisionProfileData.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshRevisionProfileData.cs deleted file mode 100644 index 5463b2507edda..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshRevisionProfileData.cs +++ /dev/null @@ -1,85 +0,0 @@ -// 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.ContainerService.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// A class representing the MeshRevisionProfile data model. - /// Mesh revision profile for a mesh. - /// - public partial class MeshRevisionProfileData : 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 MeshRevisionProfileData() - { - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Mesh revision profile properties for a mesh. - /// Keeps track of any properties unknown to the library. - internal MeshRevisionProfileData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, MeshRevisionProfileProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) - { - Properties = properties; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Mesh revision profile properties for a mesh. - internal MeshRevisionProfileProperties Properties { get; set; } - /// Gets the mesh revisions. - public IList MeshRevisions - { - get - { - if (Properties is null) - Properties = new MeshRevisionProfileProperties(); - return Properties.MeshRevisions; - } - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshRevisionProfileResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshRevisionProfileResource.cs deleted file mode 100644 index e9f18a5bfbf50..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshRevisionProfileResource.cs +++ /dev/null @@ -1,173 +0,0 @@ -// 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; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// A Class representing a MeshRevisionProfile 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 GetMeshRevisionProfileResource method. - /// Otherwise you can get one from its parent resource using the GetMeshRevisionProfile method. - /// - public partial class MeshRevisionProfileResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The location. - /// The mode. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, AzureLocation location, string mode) - { - var resourceId = $"/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles/{mode}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _meshRevisionProfileManagedClustersClientDiagnostics; - private readonly ManagedClustersRestOperations _meshRevisionProfileManagedClustersRestClient; - private readonly MeshRevisionProfileData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.ContainerService/locations/meshRevisionProfiles"; - - /// Initializes a new instance of the class for mocking. - protected MeshRevisionProfileResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal MeshRevisionProfileResource(ArmClient client, MeshRevisionProfileData 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 MeshRevisionProfileResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _meshRevisionProfileManagedClustersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string meshRevisionProfileManagedClustersApiVersion); - _meshRevisionProfileManagedClustersRestClient = new ManagedClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, meshRevisionProfileManagedClustersApiVersion); -#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 MeshRevisionProfileData 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)); - } - - /// - /// Contains extra metadata on the revision, including supported revisions, cluster compatibility and available upgrades - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles/{mode} - /// - /// - /// Operation Id - /// ManagedClusters_GetMeshRevisionProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _meshRevisionProfileManagedClustersClientDiagnostics.CreateScope("MeshRevisionProfileResource.Get"); - scope.Start(); - try - { - var response = await _meshRevisionProfileManagedClustersRestClient.GetMeshRevisionProfileAsync(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new MeshRevisionProfileResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Contains extra metadata on the revision, including supported revisions, cluster compatibility and available upgrades - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles/{mode} - /// - /// - /// Operation Id - /// ManagedClusters_GetMeshRevisionProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _meshRevisionProfileManagedClustersClientDiagnostics.CreateScope("MeshRevisionProfileResource.Get"); - scope.Start(); - try - { - var response = _meshRevisionProfileManagedClustersRestClient.GetMeshRevisionProfile(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new MeshRevisionProfileResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshUpgradeProfileCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshUpgradeProfileCollection.cs deleted file mode 100644 index 99d394ec07ead..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshUpgradeProfileCollection.cs +++ /dev/null @@ -1,397 +0,0 @@ -// 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; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// 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 GetMeshUpgradeProfiles method from an instance of . - /// - public partial class MeshUpgradeProfileCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _meshUpgradeProfileManagedClustersClientDiagnostics; - private readonly ManagedClustersRestOperations _meshUpgradeProfileManagedClustersRestClient; - - /// Initializes a new instance of the class for mocking. - protected MeshUpgradeProfileCollection() - { - } - - /// 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 MeshUpgradeProfileCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _meshUpgradeProfileManagedClustersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", MeshUpgradeProfileResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(MeshUpgradeProfileResource.ResourceType, out string meshUpgradeProfileManagedClustersApiVersion); - _meshUpgradeProfileManagedClustersRestClient = new ManagedClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, meshUpgradeProfileManagedClustersApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ContainerServiceManagedClusterResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ContainerServiceManagedClusterResource.ResourceType), nameof(id)); - } - - /// - /// Gets available upgrades for a service mesh in a cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshUpgradeProfiles/{mode} - /// - /// - /// Operation Id - /// ManagedClusters_GetMeshUpgradeProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The mode of the mesh. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string mode, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(mode, nameof(mode)); - - using var scope = _meshUpgradeProfileManagedClustersClientDiagnostics.CreateScope("MeshUpgradeProfileCollection.Get"); - scope.Start(); - try - { - var response = await _meshUpgradeProfileManagedClustersRestClient.GetMeshUpgradeProfileAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, mode, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new MeshUpgradeProfileResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets available upgrades for a service mesh in a cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshUpgradeProfiles/{mode} - /// - /// - /// Operation Id - /// ManagedClusters_GetMeshUpgradeProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The mode of the mesh. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string mode, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(mode, nameof(mode)); - - using var scope = _meshUpgradeProfileManagedClustersClientDiagnostics.CreateScope("MeshUpgradeProfileCollection.Get"); - scope.Start(); - try - { - var response = _meshUpgradeProfileManagedClustersRestClient.GetMeshUpgradeProfile(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, mode, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new MeshUpgradeProfileResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Lists available upgrades for all service meshes in a specific cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshUpgradeProfiles - /// - /// - /// Operation Id - /// ManagedClusters_ListMeshUpgradeProfiles - /// - /// - /// Default Api Version - /// 2023-10-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) => _meshUpgradeProfileManagedClustersRestClient.CreateListMeshUpgradeProfilesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _meshUpgradeProfileManagedClustersRestClient.CreateListMeshUpgradeProfilesNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MeshUpgradeProfileResource(Client, MeshUpgradeProfileData.DeserializeMeshUpgradeProfileData(e)), _meshUpgradeProfileManagedClustersClientDiagnostics, Pipeline, "MeshUpgradeProfileCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Lists available upgrades for all service meshes in a specific cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshUpgradeProfiles - /// - /// - /// Operation Id - /// ManagedClusters_ListMeshUpgradeProfiles - /// - /// - /// Default Api Version - /// 2023-10-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) => _meshUpgradeProfileManagedClustersRestClient.CreateListMeshUpgradeProfilesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _meshUpgradeProfileManagedClustersRestClient.CreateListMeshUpgradeProfilesNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MeshUpgradeProfileResource(Client, MeshUpgradeProfileData.DeserializeMeshUpgradeProfileData(e)), _meshUpgradeProfileManagedClustersClientDiagnostics, Pipeline, "MeshUpgradeProfileCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshUpgradeProfiles/{mode} - /// - /// - /// Operation Id - /// ManagedClusters_GetMeshUpgradeProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The mode of the mesh. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string mode, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(mode, nameof(mode)); - - using var scope = _meshUpgradeProfileManagedClustersClientDiagnostics.CreateScope("MeshUpgradeProfileCollection.Exists"); - scope.Start(); - try - { - var response = await _meshUpgradeProfileManagedClustersRestClient.GetMeshUpgradeProfileAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, mode, 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/managedClusters/{resourceName}/meshUpgradeProfiles/{mode} - /// - /// - /// Operation Id - /// ManagedClusters_GetMeshUpgradeProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The mode of the mesh. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string mode, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(mode, nameof(mode)); - - using var scope = _meshUpgradeProfileManagedClustersClientDiagnostics.CreateScope("MeshUpgradeProfileCollection.Exists"); - scope.Start(); - try - { - var response = _meshUpgradeProfileManagedClustersRestClient.GetMeshUpgradeProfile(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, mode, 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/managedClusters/{resourceName}/meshUpgradeProfiles/{mode} - /// - /// - /// Operation Id - /// ManagedClusters_GetMeshUpgradeProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The mode of the mesh. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetIfExistsAsync(string mode, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(mode, nameof(mode)); - - using var scope = _meshUpgradeProfileManagedClustersClientDiagnostics.CreateScope("MeshUpgradeProfileCollection.GetIfExists"); - scope.Start(); - try - { - var response = await _meshUpgradeProfileManagedClustersRestClient.GetMeshUpgradeProfileAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, mode, cancellationToken: cancellationToken).ConfigureAwait(false); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new MeshUpgradeProfileResource(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/managedClusters/{resourceName}/meshUpgradeProfiles/{mode} - /// - /// - /// Operation Id - /// ManagedClusters_GetMeshUpgradeProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The mode of the mesh. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual NullableResponse GetIfExists(string mode, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(mode, nameof(mode)); - - using var scope = _meshUpgradeProfileManagedClustersClientDiagnostics.CreateScope("MeshUpgradeProfileCollection.GetIfExists"); - scope.Start(); - try - { - var response = _meshUpgradeProfileManagedClustersRestClient.GetMeshUpgradeProfile(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, mode, cancellationToken: cancellationToken); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new MeshUpgradeProfileResource(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/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshUpgradeProfileData.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshUpgradeProfileData.cs deleted file mode 100644 index be5fd3ed55d88..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshUpgradeProfileData.cs +++ /dev/null @@ -1,75 +0,0 @@ -// 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.ContainerService.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// A class representing the MeshUpgradeProfile data model. - /// Upgrade profile for given mesh. - /// - public partial class MeshUpgradeProfileData : 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 MeshUpgradeProfileData() - { - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Mesh upgrade profile properties for a major.minor release. - /// Keeps track of any properties unknown to the library. - internal MeshUpgradeProfileData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, MeshUpgradeProfileProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) - { - Properties = properties; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Mesh upgrade profile properties for a major.minor release. - public MeshUpgradeProfileProperties Properties { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshUpgradeProfileResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshUpgradeProfileResource.cs deleted file mode 100644 index afd9f1dee0d48..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshUpgradeProfileResource.cs +++ /dev/null @@ -1,173 +0,0 @@ -// 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; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// A Class representing a MeshUpgradeProfile 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 GetMeshUpgradeProfileResource method. - /// Otherwise you can get one from its parent resource using the GetMeshUpgradeProfile method. - /// - public partial class MeshUpgradeProfileResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The resourceName. - /// The mode. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string resourceName, string mode) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshUpgradeProfiles/{mode}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _meshUpgradeProfileManagedClustersClientDiagnostics; - private readonly ManagedClustersRestOperations _meshUpgradeProfileManagedClustersRestClient; - private readonly MeshUpgradeProfileData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.ContainerService/managedClusters/meshUpgradeProfiles"; - - /// Initializes a new instance of the class for mocking. - protected MeshUpgradeProfileResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal MeshUpgradeProfileResource(ArmClient client, MeshUpgradeProfileData 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 MeshUpgradeProfileResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _meshUpgradeProfileManagedClustersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string meshUpgradeProfileManagedClustersApiVersion); - _meshUpgradeProfileManagedClustersRestClient = new ManagedClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, meshUpgradeProfileManagedClustersApiVersion); -#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 MeshUpgradeProfileData 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 available upgrades for a service mesh in a cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshUpgradeProfiles/{mode} - /// - /// - /// Operation Id - /// ManagedClusters_GetMeshUpgradeProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _meshUpgradeProfileManagedClustersClientDiagnostics.CreateScope("MeshUpgradeProfileResource.Get"); - scope.Start(); - try - { - var response = await _meshUpgradeProfileManagedClustersRestClient.GetMeshUpgradeProfileAsync(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 MeshUpgradeProfileResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets available upgrades for a service mesh in a cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshUpgradeProfiles/{mode} - /// - /// - /// Operation Id - /// ManagedClusters_GetMeshUpgradeProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _meshUpgradeProfileManagedClustersClientDiagnostics.CreateScope("MeshUpgradeProfileResource.Get"); - scope.Start(); - try - { - var response = _meshUpgradeProfileManagedClustersRestClient.GetMeshUpgradeProfile(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new MeshUpgradeProfileResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolAvailableVersion.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolAvailableVersion.Serialization.cs deleted file mode 100644 index d609913aa92df..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolAvailableVersion.Serialization.cs +++ /dev/null @@ -1,152 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class AgentPoolAvailableVersion : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AgentPoolAvailableVersion)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(IsDefault)) - { - writer.WritePropertyName("default"u8); - writer.WriteBooleanValue(IsDefault.Value); - } - if (Optional.IsDefined(KubernetesVersion)) - { - writer.WritePropertyName("kubernetesVersion"u8); - writer.WriteStringValue(KubernetesVersion); - } - if (Optional.IsDefined(IsPreview)) - { - writer.WritePropertyName("isPreview"u8); - writer.WriteBooleanValue(IsPreview.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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - AgentPoolAvailableVersion 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(AgentPoolAvailableVersion)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAgentPoolAvailableVersion(document.RootElement, options); - } - - internal static AgentPoolAvailableVersion DeserializeAgentPoolAvailableVersion(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional @default = default; - Optional kubernetesVersion = default; - Optional isPreview = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("default"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - @default = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("kubernetesVersion"u8)) - { - kubernetesVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("isPreview"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - isPreview = property.Value.GetBoolean(); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new AgentPoolAvailableVersion(Optional.ToNullable(@default), kubernetesVersion.Value, Optional.ToNullable(isPreview), 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(AgentPoolAvailableVersion)} does not support '{options.Format}' format."); - } - } - - AgentPoolAvailableVersion 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); - return DeserializeAgentPoolAvailableVersion(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(AgentPoolAvailableVersion)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolAvailableVersion.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolAvailableVersion.cs deleted file mode 100644 index bfcbf53108207..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolAvailableVersion.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The AgentPoolAvailableVersion. - public partial class AgentPoolAvailableVersion - { - /// - /// 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 AgentPoolAvailableVersion() - { - } - - /// Initializes a new instance of . - /// Whether this version is the default agent pool version. - /// The Kubernetes version (major.minor.patch). - /// Whether Kubernetes version is currently in preview. - /// Keeps track of any properties unknown to the library. - internal AgentPoolAvailableVersion(bool? isDefault, string kubernetesVersion, bool? isPreview, IDictionary serializedAdditionalRawData) - { - IsDefault = isDefault; - KubernetesVersion = kubernetesVersion; - IsPreview = isPreview; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Whether this version is the default agent pool version. - public bool? IsDefault { get; } - /// The Kubernetes version (major.minor.patch). - public string KubernetesVersion { get; } - /// Whether Kubernetes version is currently in preview. - public bool? IsPreview { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolAvailableVersions.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolAvailableVersions.Serialization.cs deleted file mode 100644 index 4b25e4bf32eec..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolAvailableVersions.Serialization.cs +++ /dev/null @@ -1,200 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class AgentPoolAvailableVersions : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AgentPoolAvailableVersions)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(AgentPoolVersions)) - { - writer.WritePropertyName("agentPoolVersions"u8); - writer.WriteStartArray(); - foreach (var item in AgentPoolVersions) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - AgentPoolAvailableVersions 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(AgentPoolAvailableVersions)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAgentPoolAvailableVersions(document.RootElement, options); - } - - internal static AgentPoolAvailableVersions DeserializeAgentPoolAvailableVersions(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional> agentPoolVersions = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - 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("agentPoolVersions"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(AgentPoolAvailableVersion.DeserializeAgentPoolAvailableVersion(item)); - } - agentPoolVersions = array; - continue; - } - } - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new AgentPoolAvailableVersions(id, name, type, systemData.Value, Optional.ToList(agentPoolVersions), 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(AgentPoolAvailableVersions)} does not support '{options.Format}' format."); - } - } - - AgentPoolAvailableVersions 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); - return DeserializeAgentPoolAvailableVersions(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(AgentPoolAvailableVersions)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolMode.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolMode.cs deleted file mode 100644 index f9590d3e7aaf4..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolMode.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools. - public readonly partial struct AgentPoolMode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public AgentPoolMode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string SystemValue = "System"; - private const string UserValue = "User"; - - /// System agent pools are primarily for hosting critical system pods such as CoreDNS and metrics-server. System agent pools osType must be Linux. System agent pools VM SKU must have at least 2vCPUs and 4GB of memory. - public static AgentPoolMode System { get; } = new AgentPoolMode(SystemValue); - /// User agent pools are primarily for hosting your application pods. - public static AgentPoolMode User { get; } = new AgentPoolMode(UserValue); - /// Determines if two values are the same. - public static bool operator ==(AgentPoolMode left, AgentPoolMode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(AgentPoolMode left, AgentPoolMode right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator AgentPoolMode(string value) => new AgentPoolMode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is AgentPoolMode other && Equals(other); - /// - public bool Equals(AgentPoolMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolNetworkPortProtocol.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolNetworkPortProtocol.cs deleted file mode 100644 index d6f12bdb71484..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolNetworkPortProtocol.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The network protocol of the port. - public readonly partial struct AgentPoolNetworkPortProtocol : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public AgentPoolNetworkPortProtocol(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string TcpValue = "TCP"; - private const string UdpValue = "UDP"; - - /// TCP protocol. - public static AgentPoolNetworkPortProtocol Tcp { get; } = new AgentPoolNetworkPortProtocol(TcpValue); - /// UDP protocol. - public static AgentPoolNetworkPortProtocol Udp { get; } = new AgentPoolNetworkPortProtocol(UdpValue); - /// Determines if two values are the same. - public static bool operator ==(AgentPoolNetworkPortProtocol left, AgentPoolNetworkPortProtocol right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(AgentPoolNetworkPortProtocol left, AgentPoolNetworkPortProtocol right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator AgentPoolNetworkPortProtocol(string value) => new AgentPoolNetworkPortProtocol(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is AgentPoolNetworkPortProtocol other && Equals(other); - /// - public bool Equals(AgentPoolNetworkPortProtocol other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolNetworkPortRange.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolNetworkPortRange.cs deleted file mode 100644 index cf9faacf1bc1d..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolNetworkPortRange.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The port range. - public partial class AgentPoolNetworkPortRange - { - /// - /// 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 AgentPoolNetworkPortRange() - { - } - - /// Initializes a new instance of . - /// The minimum port that is included in the range. It should be ranged from 1 to 65535, and be less than or equal to portEnd. - /// The maximum port that is included in the range. It should be ranged from 1 to 65535, and be greater than or equal to portStart. - /// The network protocol of the port. - /// Keeps track of any properties unknown to the library. - internal AgentPoolNetworkPortRange(int? portStart, int? portEnd, AgentPoolNetworkPortProtocol? protocol, IDictionary serializedAdditionalRawData) - { - PortStart = portStart; - PortEnd = portEnd; - Protocol = protocol; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The minimum port that is included in the range. It should be ranged from 1 to 65535, and be less than or equal to portEnd. - public int? PortStart { get; set; } - /// The maximum port that is included in the range. It should be ranged from 1 to 65535, and be greater than or equal to portStart. - public int? PortEnd { get; set; } - /// The network protocol of the port. - public AgentPoolNetworkPortProtocol? Protocol { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolNetworkProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolNetworkProfile.Serialization.cs deleted file mode 100644 index 24c958b7bb0f9..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolNetworkProfile.Serialization.cs +++ /dev/null @@ -1,198 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class AgentPoolNetworkProfile : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AgentPoolNetworkProfile)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(NodePublicIPTags)) - { - writer.WritePropertyName("nodePublicIPTags"u8); - writer.WriteStartArray(); - foreach (var item in NodePublicIPTags) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(AllowedHostPorts)) - { - writer.WritePropertyName("allowedHostPorts"u8); - writer.WriteStartArray(); - foreach (var item in AllowedHostPorts) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(ApplicationSecurityGroups)) - { - writer.WritePropertyName("applicationSecurityGroups"u8); - writer.WriteStartArray(); - foreach (var item in ApplicationSecurityGroups) - { - if (item == null) - { - writer.WriteNullValue(); - continue; - } - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - AgentPoolNetworkProfile 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(AgentPoolNetworkProfile)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAgentPoolNetworkProfile(document.RootElement, options); - } - - internal static AgentPoolNetworkProfile DeserializeAgentPoolNetworkProfile(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> nodePublicIPTags = default; - Optional> allowedHostPorts = default; - Optional> applicationSecurityGroups = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("nodePublicIPTags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ContainerServiceIPTag.DeserializeContainerServiceIPTag(item)); - } - nodePublicIPTags = array; - continue; - } - if (property.NameEquals("allowedHostPorts"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(AgentPoolNetworkPortRange.DeserializeAgentPoolNetworkPortRange(item)); - } - allowedHostPorts = array; - continue; - } - if (property.NameEquals("applicationSecurityGroups"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - if (item.ValueKind == JsonValueKind.Null) - { - array.Add(null); - } - else - { - array.Add(new ResourceIdentifier(item.GetString())); - } - } - applicationSecurityGroups = array; - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new AgentPoolNetworkProfile(Optional.ToList(nodePublicIPTags), Optional.ToList(allowedHostPorts), Optional.ToList(applicationSecurityGroups), 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(AgentPoolNetworkProfile)} does not support '{options.Format}' format."); - } - } - - AgentPoolNetworkProfile 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); - return DeserializeAgentPoolNetworkProfile(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(AgentPoolNetworkProfile)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolNetworkProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolNetworkProfile.cs deleted file mode 100644 index 245e6defc854a..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolNetworkProfile.cs +++ /dev/null @@ -1,77 +0,0 @@ -// 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.ContainerService.Models -{ - /// Network settings of an agent pool. - public partial class AgentPoolNetworkProfile - { - /// - /// 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 AgentPoolNetworkProfile() - { - NodePublicIPTags = new ChangeTrackingList(); - AllowedHostPorts = new ChangeTrackingList(); - ApplicationSecurityGroups = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// IPTags of instance-level public IPs. - /// The port ranges that are allowed to access. The specified ranges are allowed to overlap. - /// The IDs of the application security groups which agent pool will associate when created. - /// Keeps track of any properties unknown to the library. - internal AgentPoolNetworkProfile(IList nodePublicIPTags, IList allowedHostPorts, IList applicationSecurityGroups, IDictionary serializedAdditionalRawData) - { - NodePublicIPTags = nodePublicIPTags; - AllowedHostPorts = allowedHostPorts; - ApplicationSecurityGroups = applicationSecurityGroups; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// IPTags of instance-level public IPs. - public IList NodePublicIPTags { get; } - /// The port ranges that are allowed to access. The specified ranges are allowed to overlap. - public IList AllowedHostPorts { get; } - /// The IDs of the application security groups which agent pool will associate when created. - public IList ApplicationSecurityGroups { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolSnapshotData.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolSnapshotData.Serialization.cs deleted file mode 100644 index ae0f112a8400b..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolSnapshotData.Serialization.cs +++ /dev/null @@ -1,318 +0,0 @@ -// 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.ContainerService.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.ContainerService -{ - public partial class AgentPoolSnapshotData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AgentPoolSnapshotData)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - 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(); - } - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(CreationData)) - { - writer.WritePropertyName("creationData"u8); - writer.WriteObjectValue(CreationData); - } - if (Optional.IsDefined(SnapshotType)) - { - writer.WritePropertyName("snapshotType"u8); - writer.WriteStringValue(SnapshotType.Value.ToString()); - } - if (options.Format != "W" && Optional.IsDefined(KubernetesVersion)) - { - writer.WritePropertyName("kubernetesVersion"u8); - writer.WriteStringValue(KubernetesVersion); - } - if (options.Format != "W" && Optional.IsDefined(NodeImageVersion)) - { - writer.WritePropertyName("nodeImageVersion"u8); - writer.WriteStringValue(NodeImageVersion); - } - if (options.Format != "W" && Optional.IsDefined(OSType)) - { - writer.WritePropertyName("osType"u8); - writer.WriteStringValue(OSType.Value.ToString()); - } - if (options.Format != "W" && Optional.IsDefined(OSSku)) - { - writer.WritePropertyName("osSku"u8); - writer.WriteStringValue(OSSku.Value.ToString()); - } - if (options.Format != "W" && Optional.IsDefined(VmSize)) - { - writer.WritePropertyName("vmSize"u8); - writer.WriteStringValue(VmSize); - } - if (options.Format != "W" && Optional.IsDefined(EnableFips)) - { - writer.WritePropertyName("enableFIPS"u8); - writer.WriteBooleanValue(EnableFips.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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - AgentPoolSnapshotData 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(AgentPoolSnapshotData)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAgentPoolSnapshotData(document.RootElement, options); - } - - internal static AgentPoolSnapshotData DeserializeAgentPoolSnapshotData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> tags = default; - AzureLocation location = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional creationData = default; - Optional snapshotType = default; - Optional kubernetesVersion = default; - Optional nodeImageVersion = default; - Optional osType = default; - Optional osSku = default; - Optional vmSize = default; - Optional enableFIPS = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = 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("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("creationData"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - creationData = ContainerServiceCreationData.DeserializeContainerServiceCreationData(property0.Value); - continue; - } - if (property0.NameEquals("snapshotType"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - snapshotType = new SnapshotType(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("kubernetesVersion"u8)) - { - kubernetesVersion = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("nodeImageVersion"u8)) - { - nodeImageVersion = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("osType"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - osType = new ContainerServiceOSType(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("osSku"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - osSku = new ContainerServiceOSSku(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("vmSize"u8)) - { - vmSize = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("enableFIPS"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableFIPS = property0.Value.GetBoolean(); - continue; - } - } - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new AgentPoolSnapshotData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, creationData.Value, Optional.ToNullable(snapshotType), kubernetesVersion.Value, nodeImageVersion.Value, Optional.ToNullable(osType), Optional.ToNullable(osSku), vmSize.Value, Optional.ToNullable(enableFIPS), 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(AgentPoolSnapshotData)} does not support '{options.Format}' format."); - } - } - - AgentPoolSnapshotData 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); - return DeserializeAgentPoolSnapshotData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(AgentPoolSnapshotData)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolSnapshotListResult.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolSnapshotListResult.Serialization.cs deleted file mode 100644 index 97987dfb5e1bd..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolSnapshotListResult.Serialization.cs +++ /dev/null @@ -1,148 +0,0 @@ -// 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.ContainerService; - -namespace Azure.ResourceManager.ContainerService.Models -{ - internal partial class AgentPoolSnapshotListResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AgentPoolSnapshotListResult)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); - } - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - AgentPoolSnapshotListResult 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(AgentPoolSnapshotListResult)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAgentPoolSnapshotListResult(document.RootElement, options); - } - - internal static AgentPoolSnapshotListResult DeserializeAgentPoolSnapshotListResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - Optional nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(AgentPoolSnapshotData.DeserializeAgentPoolSnapshotData(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new AgentPoolSnapshotListResult(Optional.ToList(value), nextLink.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(AgentPoolSnapshotListResult)} does not support '{options.Format}' format."); - } - } - - AgentPoolSnapshotListResult 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); - return DeserializeAgentPoolSnapshotListResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(AgentPoolSnapshotListResult)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolType.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolType.cs deleted file mode 100644 index 422c03e7e5f1a..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolType.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The type of Agent Pool. - public readonly partial struct AgentPoolType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public AgentPoolType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string VirtualMachineScaleSetsValue = "VirtualMachineScaleSets"; - private const string AvailabilitySetValue = "AvailabilitySet"; - - /// Create an Agent Pool backed by a Virtual Machine Scale Set. - public static AgentPoolType VirtualMachineScaleSets { get; } = new AgentPoolType(VirtualMachineScaleSetsValue); - /// Use of this is strongly discouraged. - public static AgentPoolType AvailabilitySet { get; } = new AgentPoolType(AvailabilitySetValue); - /// Determines if two values are the same. - public static bool operator ==(AgentPoolType left, AgentPoolType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(AgentPoolType left, AgentPoolType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator AgentPoolType(string value) => new AgentPoolType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is AgentPoolType other && Equals(other); - /// - public bool Equals(AgentPoolType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeProfileData.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeProfileData.Serialization.cs deleted file mode 100644 index fd6a782a33a86..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeProfileData.Serialization.cs +++ /dev/null @@ -1,228 +0,0 @@ -// 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.ContainerService.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.ContainerService -{ - public partial class AgentPoolUpgradeProfileData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AgentPoolUpgradeProfileData)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - writer.WritePropertyName("kubernetesVersion"u8); - writer.WriteStringValue(KubernetesVersion); - writer.WritePropertyName("osType"u8); - writer.WriteStringValue(OSType.ToString()); - if (Optional.IsCollectionDefined(Upgrades)) - { - writer.WritePropertyName("upgrades"u8); - writer.WriteStartArray(); - foreach (var item in Upgrades) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(LatestNodeImageVersion)) - { - writer.WritePropertyName("latestNodeImageVersion"u8); - writer.WriteStringValue(LatestNodeImageVersion); - } - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - AgentPoolUpgradeProfileData 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(AgentPoolUpgradeProfileData)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAgentPoolUpgradeProfileData(document.RootElement, options); - } - - internal static AgentPoolUpgradeProfileData DeserializeAgentPoolUpgradeProfileData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - string kubernetesVersion = default; - ContainerServiceOSType osType = default; - Optional> upgrades = default; - Optional latestNodeImageVersion = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - 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("kubernetesVersion"u8)) - { - kubernetesVersion = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("osType"u8)) - { - osType = new ContainerServiceOSType(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("upgrades"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(AgentPoolUpgradeProfilePropertiesUpgradesItem.DeserializeAgentPoolUpgradeProfilePropertiesUpgradesItem(item)); - } - upgrades = array; - continue; - } - if (property0.NameEquals("latestNodeImageVersion"u8)) - { - latestNodeImageVersion = property0.Value.GetString(); - continue; - } - } - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new AgentPoolUpgradeProfileData(id, name, type, systemData.Value, kubernetesVersion, osType, Optional.ToList(upgrades), latestNodeImageVersion.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(AgentPoolUpgradeProfileData)} does not support '{options.Format}' format."); - } - } - - AgentPoolUpgradeProfileData 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); - return DeserializeAgentPoolUpgradeProfileData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(AgentPoolUpgradeProfileData)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeProfilePropertiesUpgradesItem.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeProfilePropertiesUpgradesItem.Serialization.cs deleted file mode 100644 index 073c264f35e3e..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeProfilePropertiesUpgradesItem.Serialization.cs +++ /dev/null @@ -1,137 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class AgentPoolUpgradeProfilePropertiesUpgradesItem : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AgentPoolUpgradeProfilePropertiesUpgradesItem)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(KubernetesVersion)) - { - writer.WritePropertyName("kubernetesVersion"u8); - writer.WriteStringValue(KubernetesVersion); - } - if (Optional.IsDefined(IsPreview)) - { - writer.WritePropertyName("isPreview"u8); - writer.WriteBooleanValue(IsPreview.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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - AgentPoolUpgradeProfilePropertiesUpgradesItem 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(AgentPoolUpgradeProfilePropertiesUpgradesItem)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAgentPoolUpgradeProfilePropertiesUpgradesItem(document.RootElement, options); - } - - internal static AgentPoolUpgradeProfilePropertiesUpgradesItem DeserializeAgentPoolUpgradeProfilePropertiesUpgradesItem(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional kubernetesVersion = default; - Optional isPreview = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("kubernetesVersion"u8)) - { - kubernetesVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("isPreview"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - isPreview = property.Value.GetBoolean(); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new AgentPoolUpgradeProfilePropertiesUpgradesItem(kubernetesVersion.Value, Optional.ToNullable(isPreview), 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(AgentPoolUpgradeProfilePropertiesUpgradesItem)} does not support '{options.Format}' format."); - } - } - - AgentPoolUpgradeProfilePropertiesUpgradesItem 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); - return DeserializeAgentPoolUpgradeProfilePropertiesUpgradesItem(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(AgentPoolUpgradeProfilePropertiesUpgradesItem)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeSettings.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeSettings.cs deleted file mode 100644 index ca7703529aaad..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeSettings.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Settings for upgrading an agentpool. - public partial class AgentPoolUpgradeSettings - { - /// - /// 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 AgentPoolUpgradeSettings() - { - } - - /// Initializes a new instance of . - /// This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified, the default is 1. For more information, including best practices, see: https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade. - /// The amount of time (in minutes) to wait on eviction of pods and graceful termination per node. This eviction wait time honors waiting on pod disruption budgets. If this time is exceeded, the upgrade fails. If not specified, the default is 30 minutes. - /// Keeps track of any properties unknown to the library. - internal AgentPoolUpgradeSettings(string maxSurge, int? drainTimeoutInMinutes, IDictionary serializedAdditionalRawData) - { - MaxSurge = maxSurge; - DrainTimeoutInMinutes = drainTimeoutInMinutes; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified, the default is 1. For more information, including best practices, see: https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade. - public string MaxSurge { get; set; } - /// The amount of time (in minutes) to wait on eviction of pods and graceful termination per node. This eviction wait time honors waiting on pod disruption budgets. If this time is exceeded, the upgrade fails. If not specified, the default is 30 minutes. - public int? DrainTimeoutInMinutes { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeSettings.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentProfile.Serialization.cs similarity index 56% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeSettings.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentProfile.Serialization.cs index 41905be58e6c6..a2db7479ca1a8 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeSettings.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentProfile.Serialization.cs @@ -13,28 +13,28 @@ namespace Azure.ResourceManager.ContainerService.Models { - public partial class AgentPoolUpgradeSettings : IUtf8JsonSerializable, IJsonModel + public partial class AgentProfile : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AgentPoolUpgradeSettings)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(AgentProfile)} does not support '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(MaxSurge)) + if (Optional.IsDefined(SubnetId)) { - writer.WritePropertyName("maxSurge"u8); - writer.WriteStringValue(MaxSurge); + writer.WritePropertyName("subnetId"u8); + writer.WriteStringValue(SubnetId); } - if (Optional.IsDefined(DrainTimeoutInMinutes)) + if (Optional.IsDefined(VmSize)) { - writer.WritePropertyName("drainTimeoutInMinutes"u8); - writer.WriteNumberValue(DrainTimeoutInMinutes.Value); + writer.WritePropertyName("vmSize"u8); + writer.WriteStringValue(VmSize); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -54,19 +54,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead writer.WriteEndObject(); } - AgentPoolUpgradeSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + AgentProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AgentPoolUpgradeSettings)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(AgentProfile)} does not support '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAgentPoolUpgradeSettings(document.RootElement, options); + return DeserializeAgentProfile(document.RootElement, options); } - internal static AgentPoolUpgradeSettings DeserializeAgentPoolUpgradeSettings(JsonElement element, ModelReaderWriterOptions options = null) + internal static AgentProfile DeserializeAgentProfile(JsonElement element, ModelReaderWriterOptions options = null) { options ??= new ModelReaderWriterOptions("W"); @@ -74,24 +74,24 @@ internal static AgentPoolUpgradeSettings DeserializeAgentPoolUpgradeSettings(Jso { return null; } - Optional maxSurge = default; - Optional drainTimeoutInMinutes = default; + Optional subnetId = default; + Optional vmSize = default; IDictionary serializedAdditionalRawData = default; Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("maxSurge"u8)) - { - maxSurge = property.Value.GetString(); - continue; - } - if (property.NameEquals("drainTimeoutInMinutes"u8)) + if (property.NameEquals("subnetId"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - drainTimeoutInMinutes = property.Value.GetInt32(); + subnetId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("vmSize"u8)) + { + vmSize = property.Value.GetString(); continue; } if (options.Format != "W") @@ -100,38 +100,38 @@ internal static AgentPoolUpgradeSettings DeserializeAgentPoolUpgradeSettings(Jso } } serializedAdditionalRawData = additionalPropertiesDictionary; - return new AgentPoolUpgradeSettings(maxSurge.Value, Optional.ToNullable(drainTimeoutInMinutes), serializedAdditionalRawData); + return new AgentProfile(subnetId.Value, vmSize.Value, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + 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(AgentPoolUpgradeSettings)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(AgentProfile)} does not support '{options.Format}' format."); } } - AgentPoolUpgradeSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + AgentProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAgentPoolUpgradeSettings(document.RootElement, options); + return DeserializeAgentProfile(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(AgentPoolUpgradeSettings)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(AgentProfile)} does not support '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolSnapshotListResult.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentProfile.cs similarity index 66% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolSnapshotListResult.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentProfile.cs index acb35e05b6f92..30aaa0f63738c 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolSnapshotListResult.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentProfile.cs @@ -8,12 +8,11 @@ using System; using System.Collections.Generic; using Azure.Core; -using Azure.ResourceManager.ContainerService; namespace Azure.ResourceManager.ContainerService.Models { - /// The response from the List Snapshots operation. - internal partial class AgentPoolSnapshotListResult + /// Agent profile for the Fleet hub. + public partial class AgentProfile { /// /// Keeps track of any properties unknown to the library. @@ -47,26 +46,25 @@ internal partial class AgentPoolSnapshotListResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal AgentPoolSnapshotListResult() + /// Initializes a new instance of . + public AgentProfile() { - Value = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// The list of snapshots. - /// The URL to get the next set of snapshot results. + /// 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 AgentPoolSnapshotListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal AgentProfile(ResourceIdentifier subnetId, string vmSize, IDictionary serializedAdditionalRawData) { - Value = value; - NextLink = nextLink; + SubnetId = subnetId; + VmSize = vmSize; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The list of snapshots. - public IReadOnlyList Value { get; } - /// The URL to get the next set of snapshot results. - public string NextLink { get; } + /// 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/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolNetworkPortRange.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ApiServerAccessProfile.Serialization.cs similarity index 53% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolNetworkPortRange.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ApiServerAccessProfile.Serialization.cs index 312759ff47a90..c7d1d1e7b70ae 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolNetworkPortRange.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ApiServerAccessProfile.Serialization.cs @@ -13,33 +13,33 @@ namespace Azure.ResourceManager.ContainerService.Models { - public partial class AgentPoolNetworkPortRange : IUtf8JsonSerializable, IJsonModel + public partial class ApiServerAccessProfile : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AgentPoolNetworkPortRange)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(ApiServerAccessProfile)} does not support '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(PortStart)) + if (Optional.IsDefined(EnablePrivateCluster)) { - writer.WritePropertyName("portStart"u8); - writer.WriteNumberValue(PortStart.Value); + writer.WritePropertyName("enablePrivateCluster"u8); + writer.WriteBooleanValue(EnablePrivateCluster.Value); } - if (Optional.IsDefined(PortEnd)) + if (Optional.IsDefined(EnableVnetIntegration)) { - writer.WritePropertyName("portEnd"u8); - writer.WriteNumberValue(PortEnd.Value); + writer.WritePropertyName("enableVnetIntegration"u8); + writer.WriteBooleanValue(EnableVnetIntegration.Value); } - if (Optional.IsDefined(Protocol)) + if (Optional.IsDefined(SubnetId)) { - writer.WritePropertyName("protocol"u8); - writer.WriteStringValue(Protocol.Value.ToString()); + writer.WritePropertyName("subnetId"u8); + writer.WriteStringValue(SubnetId); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -59,19 +59,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea writer.WriteEndObject(); } - AgentPoolNetworkPortRange IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ApiServerAccessProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AgentPoolNetworkPortRange)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(ApiServerAccessProfile)} does not support '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAgentPoolNetworkPortRange(document.RootElement, options); + return DeserializeApiServerAccessProfile(document.RootElement, options); } - internal static AgentPoolNetworkPortRange DeserializeAgentPoolNetworkPortRange(JsonElement element, ModelReaderWriterOptions options = null) + internal static ApiServerAccessProfile DeserializeApiServerAccessProfile(JsonElement element, ModelReaderWriterOptions options = null) { options ??= new ModelReaderWriterOptions("W"); @@ -79,38 +79,38 @@ internal static AgentPoolNetworkPortRange DeserializeAgentPoolNetworkPortRange(J { return null; } - Optional portStart = default; - Optional portEnd = default; - Optional protocol = default; + Optional enablePrivateCluster = default; + Optional enableVnetIntegration = default; + Optional subnetId = default; IDictionary serializedAdditionalRawData = default; Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("portStart"u8)) + if (property.NameEquals("enablePrivateCluster"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - portStart = property.Value.GetInt32(); + enablePrivateCluster = property.Value.GetBoolean(); continue; } - if (property.NameEquals("portEnd"u8)) + if (property.NameEquals("enableVnetIntegration"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - portEnd = property.Value.GetInt32(); + enableVnetIntegration = property.Value.GetBoolean(); continue; } - if (property.NameEquals("protocol"u8)) + if (property.NameEquals("subnetId"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - protocol = new AgentPoolNetworkPortProtocol(property.Value.GetString()); + subnetId = new ResourceIdentifier(property.Value.GetString()); continue; } if (options.Format != "W") @@ -119,38 +119,38 @@ internal static AgentPoolNetworkPortRange DeserializeAgentPoolNetworkPortRange(J } } serializedAdditionalRawData = additionalPropertiesDictionary; - return new AgentPoolNetworkPortRange(Optional.ToNullable(portStart), Optional.ToNullable(portEnd), Optional.ToNullable(protocol), serializedAdditionalRawData); + return new ApiServerAccessProfile(Optional.ToNullable(enablePrivateCluster), Optional.ToNullable(enableVnetIntegration), subnetId.Value, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + 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(AgentPoolNetworkPortRange)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(ApiServerAccessProfile)} does not support '{options.Format}' format."); } } - AgentPoolNetworkPortRange IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ApiServerAccessProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAgentPoolNetworkPortRange(document.RootElement, options); + return DeserializeApiServerAccessProfile(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(AgentPoolNetworkPortRange)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(ApiServerAccessProfile)} does not support '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolAvailableVersions.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ApiServerAccessProfile.cs similarity index 57% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolAvailableVersions.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ApiServerAccessProfile.cs index 70fc820184794..2bd32a2823d36 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolAvailableVersions.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ApiServerAccessProfile.cs @@ -8,12 +8,11 @@ using System; using System.Collections.Generic; using Azure.Core; -using Azure.ResourceManager.Models; namespace Azure.ResourceManager.ContainerService.Models { - /// The list of available versions for an agent pool. - public partial class AgentPoolAvailableVersions : ResourceData + /// Access profile for the Fleet hub API server. + public partial class ApiServerAccessProfile { /// /// Keeps track of any properties unknown to the library. @@ -47,26 +46,29 @@ public partial class AgentPoolAvailableVersions : ResourceData /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal AgentPoolAvailableVersions() + /// Initializes a new instance of . + public ApiServerAccessProfile() { - AgentPoolVersions = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// List of versions available for agent pool. + /// 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 AgentPoolAvailableVersions(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IReadOnlyList agentPoolVersions, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal ApiServerAccessProfile(bool? enablePrivateCluster, bool? enableVnetIntegration, ResourceIdentifier subnetId, IDictionary serializedAdditionalRawData) { - AgentPoolVersions = agentPoolVersions; + EnablePrivateCluster = enablePrivateCluster; + EnableVnetIntegration = enableVnetIntegration; + SubnetId = subnetId; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// List of versions available for agent pool. - public IReadOnlyList AgentPoolVersions { get; } + /// 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/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AutoScaleExpander.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AutoScaleExpander.cs deleted file mode 100644 index dddf7164d8a09..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AutoScaleExpander.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// If not specified, the default is 'random'. See [expanders](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-are-expanders) for more information. - public readonly partial struct AutoScaleExpander : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public AutoScaleExpander(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string LeastWasteValue = "least-waste"; - private const string MostPodsValue = "most-pods"; - private const string PriorityValue = "priority"; - private const string RandomValue = "random"; - - /// Selects the node group that will have the least idle CPU (if tied, unused memory) after scale-up. This is useful when you have different classes of nodes, for example, high CPU or high memory nodes, and only want to expand those when there are pending pods that need a lot of those resources. - public static AutoScaleExpander LeastWaste { get; } = new AutoScaleExpander(LeastWasteValue); - /// Selects the node group that would be able to schedule the most pods when scaling up. This is useful when you are using nodeSelector to make sure certain pods land on certain nodes. Note that this won't cause the autoscaler to select bigger nodes vs. smaller, as it can add multiple smaller nodes at once. - public static AutoScaleExpander MostPods { get; } = new AutoScaleExpander(MostPodsValue); - /// Selects the node group that has the highest priority assigned by the user. It's configuration is described in more details [here](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/expander/priority/readme.md). - public static AutoScaleExpander Priority { get; } = new AutoScaleExpander(PriorityValue); - /// Used when you don't have a particular need for the node groups to scale differently. - public static AutoScaleExpander Random { get; } = new AutoScaleExpander(RandomValue); - /// Determines if two values are the same. - public static bool operator ==(AutoScaleExpander left, AutoScaleExpander right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(AutoScaleExpander left, AutoScaleExpander right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator AutoScaleExpander(string value) => new AutoScaleExpander(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is AutoScaleExpander other && Equals(other); - /// - public bool Equals(AutoScaleExpander other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ClusterUpgradeSettings.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ClusterUpgradeSettings.Serialization.cs deleted file mode 100644 index e468f0555094d..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ClusterUpgradeSettings.Serialization.cs +++ /dev/null @@ -1,126 +0,0 @@ -// 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.ContainerService.Models -{ - internal partial class ClusterUpgradeSettings : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ClusterUpgradeSettings)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(OverrideSettings)) - { - writer.WritePropertyName("overrideSettings"u8); - writer.WriteObjectValue(OverrideSettings); - } - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ClusterUpgradeSettings 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(ClusterUpgradeSettings)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeClusterUpgradeSettings(document.RootElement, options); - } - - internal static ClusterUpgradeSettings DeserializeClusterUpgradeSettings(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional overrideSettings = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("overrideSettings"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - overrideSettings = UpgradeOverrideSettings.DeserializeUpgradeOverrideSettings(property.Value); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ClusterUpgradeSettings(overrideSettings.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(ClusterUpgradeSettings)} does not support '{options.Format}' format."); - } - } - - ClusterUpgradeSettings 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); - return DeserializeClusterUpgradeSettings(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ClusterUpgradeSettings)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceAgentPoolData.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceAgentPoolData.Serialization.cs deleted file mode 100644 index 579c342119478..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceAgentPoolData.Serialization.cs +++ /dev/null @@ -1,843 +0,0 @@ -// 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.ContainerService.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.ContainerService -{ - public partial class ContainerServiceAgentPoolData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceAgentPoolData)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(Count)) - { - writer.WritePropertyName("count"u8); - writer.WriteNumberValue(Count.Value); - } - if (Optional.IsDefined(VmSize)) - { - writer.WritePropertyName("vmSize"u8); - writer.WriteStringValue(VmSize); - } - if (Optional.IsDefined(OSDiskSizeInGB)) - { - writer.WritePropertyName("osDiskSizeGB"u8); - writer.WriteNumberValue(OSDiskSizeInGB.Value); - } - if (Optional.IsDefined(OSDiskType)) - { - writer.WritePropertyName("osDiskType"u8); - writer.WriteStringValue(OSDiskType.Value.ToString()); - } - if (Optional.IsDefined(KubeletDiskType)) - { - writer.WritePropertyName("kubeletDiskType"u8); - writer.WriteStringValue(KubeletDiskType.Value.ToString()); - } - if (Optional.IsDefined(WorkloadRuntime)) - { - writer.WritePropertyName("workloadRuntime"u8); - writer.WriteStringValue(WorkloadRuntime.Value.ToString()); - } - if (Optional.IsDefined(VnetSubnetId)) - { - writer.WritePropertyName("vnetSubnetID"u8); - writer.WriteStringValue(VnetSubnetId); - } - if (Optional.IsDefined(PodSubnetId)) - { - writer.WritePropertyName("podSubnetID"u8); - writer.WriteStringValue(PodSubnetId); - } - if (Optional.IsDefined(MaxPods)) - { - writer.WritePropertyName("maxPods"u8); - writer.WriteNumberValue(MaxPods.Value); - } - if (Optional.IsDefined(OSType)) - { - writer.WritePropertyName("osType"u8); - writer.WriteStringValue(OSType.Value.ToString()); - } - if (Optional.IsDefined(OSSku)) - { - writer.WritePropertyName("osSKU"u8); - writer.WriteStringValue(OSSku.Value.ToString()); - } - if (Optional.IsDefined(MaxCount)) - { - writer.WritePropertyName("maxCount"u8); - writer.WriteNumberValue(MaxCount.Value); - } - if (Optional.IsDefined(MinCount)) - { - writer.WritePropertyName("minCount"u8); - writer.WriteNumberValue(MinCount.Value); - } - if (Optional.IsDefined(EnableAutoScaling)) - { - writer.WritePropertyName("enableAutoScaling"u8); - writer.WriteBooleanValue(EnableAutoScaling.Value); - } - if (Optional.IsDefined(ScaleDownMode)) - { - writer.WritePropertyName("scaleDownMode"u8); - writer.WriteStringValue(ScaleDownMode.Value.ToString()); - } - if (Optional.IsDefined(TypePropertiesType)) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(TypePropertiesType.Value.ToString()); - } - if (Optional.IsDefined(Mode)) - { - writer.WritePropertyName("mode"u8); - writer.WriteStringValue(Mode.Value.ToString()); - } - if (Optional.IsDefined(OrchestratorVersion)) - { - writer.WritePropertyName("orchestratorVersion"u8); - writer.WriteStringValue(OrchestratorVersion); - } - if (options.Format != "W" && Optional.IsDefined(CurrentOrchestratorVersion)) - { - writer.WritePropertyName("currentOrchestratorVersion"u8); - writer.WriteStringValue(CurrentOrchestratorVersion); - } - if (options.Format != "W" && Optional.IsDefined(NodeImageVersion)) - { - writer.WritePropertyName("nodeImageVersion"u8); - writer.WriteStringValue(NodeImageVersion); - } - if (Optional.IsDefined(UpgradeSettings)) - { - writer.WritePropertyName("upgradeSettings"u8); - writer.WriteObjectValue(UpgradeSettings); - } - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState); - } - if (Optional.IsDefined(PowerState)) - { - writer.WritePropertyName("powerState"u8); - writer.WriteObjectValue(PowerState); - } - if (Optional.IsCollectionDefined(AvailabilityZones)) - { - writer.WritePropertyName("availabilityZones"u8); - writer.WriteStartArray(); - foreach (var item in AvailabilityZones) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(EnableNodePublicIP)) - { - writer.WritePropertyName("enableNodePublicIP"u8); - writer.WriteBooleanValue(EnableNodePublicIP.Value); - } - if (Optional.IsDefined(NodePublicIPPrefixId)) - { - writer.WritePropertyName("nodePublicIPPrefixID"u8); - writer.WriteStringValue(NodePublicIPPrefixId); - } - if (Optional.IsDefined(ScaleSetPriority)) - { - writer.WritePropertyName("scaleSetPriority"u8); - writer.WriteStringValue(ScaleSetPriority.Value.ToString()); - } - if (Optional.IsDefined(ScaleSetEvictionPolicy)) - { - writer.WritePropertyName("scaleSetEvictionPolicy"u8); - writer.WriteStringValue(ScaleSetEvictionPolicy.Value.ToString()); - } - if (Optional.IsDefined(SpotMaxPrice)) - { - writer.WritePropertyName("spotMaxPrice"u8); - writer.WriteNumberValue(SpotMaxPrice.Value); - } - 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.IsCollectionDefined(NodeLabels)) - { - writer.WritePropertyName("nodeLabels"u8); - writer.WriteStartObject(); - foreach (var item in NodeLabels) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - if (Optional.IsCollectionDefined(NodeTaints)) - { - writer.WritePropertyName("nodeTaints"u8); - writer.WriteStartArray(); - foreach (var item in NodeTaints) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(ProximityPlacementGroupId)) - { - writer.WritePropertyName("proximityPlacementGroupID"u8); - writer.WriteStringValue(ProximityPlacementGroupId); - } - if (Optional.IsDefined(KubeletConfig)) - { - writer.WritePropertyName("kubeletConfig"u8); - writer.WriteObjectValue(KubeletConfig); - } - if (Optional.IsDefined(LinuxOSConfig)) - { - writer.WritePropertyName("linuxOSConfig"u8); - writer.WriteObjectValue(LinuxOSConfig); - } - if (Optional.IsDefined(EnableEncryptionAtHost)) - { - writer.WritePropertyName("enableEncryptionAtHost"u8); - writer.WriteBooleanValue(EnableEncryptionAtHost.Value); - } - if (Optional.IsDefined(EnableUltraSsd)) - { - writer.WritePropertyName("enableUltraSSD"u8); - writer.WriteBooleanValue(EnableUltraSsd.Value); - } - if (Optional.IsDefined(EnableFips)) - { - writer.WritePropertyName("enableFIPS"u8); - writer.WriteBooleanValue(EnableFips.Value); - } - if (Optional.IsDefined(GpuInstanceProfile)) - { - writer.WritePropertyName("gpuInstanceProfile"u8); - writer.WriteStringValue(GpuInstanceProfile.Value.ToString()); - } - if (Optional.IsDefined(CreationData)) - { - writer.WritePropertyName("creationData"u8); - writer.WriteObjectValue(CreationData); - } - if (Optional.IsDefined(CapacityReservationGroupId)) - { - writer.WritePropertyName("capacityReservationGroupID"u8); - writer.WriteStringValue(CapacityReservationGroupId); - } - if (Optional.IsDefined(HostGroupId)) - { - writer.WritePropertyName("hostGroupID"u8); - writer.WriteStringValue(HostGroupId); - } - if (Optional.IsDefined(NetworkProfile)) - { - writer.WritePropertyName("networkProfile"u8); - writer.WriteObjectValue(NetworkProfile); - } - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContainerServiceAgentPoolData 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(ContainerServiceAgentPoolData)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceAgentPoolData(document.RootElement, options); - } - - internal static ContainerServiceAgentPoolData DeserializeContainerServiceAgentPoolData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional count = default; - Optional vmSize = default; - Optional osDiskSizeGB = default; - Optional osDiskType = default; - Optional kubeletDiskType = default; - Optional workloadRuntime = default; - Optional vnetSubnetId = default; - Optional podSubnetId = default; - Optional maxPods = default; - Optional osType = default; - Optional osSku = default; - Optional maxCount = default; - Optional minCount = default; - Optional enableAutoScaling = default; - Optional scaleDownMode = default; - Optional type0 = default; - Optional mode = default; - Optional orchestratorVersion = default; - Optional currentOrchestratorVersion = default; - Optional nodeImageVersion = default; - Optional upgradeSettings = default; - Optional provisioningState = default; - Optional powerState = default; - Optional> availabilityZones = default; - Optional enableNodePublicIP = default; - Optional nodePublicIPPrefixId = default; - Optional scaleSetPriority = default; - Optional scaleSetEvictionPolicy = default; - Optional spotMaxPrice = default; - Optional> tags = default; - Optional> nodeLabels = default; - Optional> nodeTaints = default; - Optional proximityPlacementGroupId = default; - Optional kubeletConfig = default; - Optional linuxOSConfig = default; - Optional enableEncryptionAtHost = default; - Optional enableUltraSsd = default; - Optional enableFIPS = default; - Optional gpuInstanceProfile = default; - Optional creationData = default; - Optional capacityReservationGroupId = default; - Optional hostGroupId = default; - Optional networkProfile = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - 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("count"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - count = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("vmSize"u8)) - { - vmSize = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("osDiskSizeGB"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - osDiskSizeGB = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("osDiskType"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - osDiskType = new ContainerServiceOSDiskType(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("kubeletDiskType"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - kubeletDiskType = new KubeletDiskType(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("workloadRuntime"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - workloadRuntime = new WorkloadRuntime(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("vnetSubnetID"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - vnetSubnetId = new ResourceIdentifier(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("podSubnetID"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - podSubnetId = new ResourceIdentifier(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("maxPods"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - maxPods = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("osType"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - osType = new ContainerServiceOSType(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("osSKU"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - osSku = new ContainerServiceOSSku(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("maxCount"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - maxCount = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("minCount"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - minCount = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("enableAutoScaling"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableAutoScaling = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("scaleDownMode"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - scaleDownMode = new ScaleDownMode(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("type"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - type0 = new AgentPoolType(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("mode"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - mode = new AgentPoolMode(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("orchestratorVersion"u8)) - { - orchestratorVersion = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("currentOrchestratorVersion"u8)) - { - currentOrchestratorVersion = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("nodeImageVersion"u8)) - { - nodeImageVersion = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("upgradeSettings"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - upgradeSettings = AgentPoolUpgradeSettings.DeserializeAgentPoolUpgradeSettings(property0.Value); - continue; - } - if (property0.NameEquals("provisioningState"u8)) - { - provisioningState = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("powerState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - powerState = ContainerServicePowerState.DeserializeContainerServicePowerState(property0.Value); - continue; - } - if (property0.NameEquals("availabilityZones"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - availabilityZones = array; - continue; - } - if (property0.NameEquals("enableNodePublicIP"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableNodePublicIP = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("nodePublicIPPrefixID"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - nodePublicIPPrefixId = new ResourceIdentifier(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("scaleSetPriority"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - scaleSetPriority = new ScaleSetPriority(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("scaleSetEvictionPolicy"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - scaleSetEvictionPolicy = new ScaleSetEvictionPolicy(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("spotMaxPrice"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - spotMaxPrice = property0.Value.GetSingle(); - continue; - } - if (property0.NameEquals("tags"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property1 in property0.Value.EnumerateObject()) - { - dictionary.Add(property1.Name, property1.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property0.NameEquals("nodeLabels"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property1 in property0.Value.EnumerateObject()) - { - dictionary.Add(property1.Name, property1.Value.GetString()); - } - nodeLabels = dictionary; - continue; - } - if (property0.NameEquals("nodeTaints"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - nodeTaints = array; - continue; - } - if (property0.NameEquals("proximityPlacementGroupID"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - proximityPlacementGroupId = new ResourceIdentifier(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("kubeletConfig"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - kubeletConfig = KubeletConfig.DeserializeKubeletConfig(property0.Value); - continue; - } - if (property0.NameEquals("linuxOSConfig"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - linuxOSConfig = LinuxOSConfig.DeserializeLinuxOSConfig(property0.Value); - continue; - } - if (property0.NameEquals("enableEncryptionAtHost"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableEncryptionAtHost = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("enableUltraSSD"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableUltraSsd = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("enableFIPS"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableFIPS = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("gpuInstanceProfile"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - gpuInstanceProfile = new GpuInstanceProfile(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("creationData"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - creationData = ContainerServiceCreationData.DeserializeContainerServiceCreationData(property0.Value); - continue; - } - if (property0.NameEquals("capacityReservationGroupID"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - capacityReservationGroupId = new ResourceIdentifier(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("hostGroupID"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - hostGroupId = new ResourceIdentifier(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("networkProfile"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - networkProfile = AgentPoolNetworkProfile.DeserializeAgentPoolNetworkProfile(property0.Value); - continue; - } - } - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ContainerServiceAgentPoolData(id, name, type, systemData.Value, Optional.ToNullable(count), vmSize.Value, Optional.ToNullable(osDiskSizeGB), Optional.ToNullable(osDiskType), Optional.ToNullable(kubeletDiskType), Optional.ToNullable(workloadRuntime), vnetSubnetId.Value, podSubnetId.Value, Optional.ToNullable(maxPods), Optional.ToNullable(osType), Optional.ToNullable(osSku), Optional.ToNullable(maxCount), Optional.ToNullable(minCount), Optional.ToNullable(enableAutoScaling), Optional.ToNullable(scaleDownMode), Optional.ToNullable(type0), Optional.ToNullable(mode), orchestratorVersion.Value, currentOrchestratorVersion.Value, nodeImageVersion.Value, upgradeSettings.Value, provisioningState.Value, powerState.Value, Optional.ToList(availabilityZones), Optional.ToNullable(enableNodePublicIP), nodePublicIPPrefixId.Value, Optional.ToNullable(scaleSetPriority), Optional.ToNullable(scaleSetEvictionPolicy), Optional.ToNullable(spotMaxPrice), Optional.ToDictionary(tags), Optional.ToDictionary(nodeLabels), Optional.ToList(nodeTaints), proximityPlacementGroupId.Value, kubeletConfig.Value, linuxOSConfig.Value, Optional.ToNullable(enableEncryptionAtHost), Optional.ToNullable(enableUltraSsd), Optional.ToNullable(enableFIPS), Optional.ToNullable(gpuInstanceProfile), creationData.Value, capacityReservationGroupId.Value, hostGroupId.Value, networkProfile.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(ContainerServiceAgentPoolData)} does not support '{options.Format}' format."); - } - } - - ContainerServiceAgentPoolData 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); - return DeserializeContainerServiceAgentPoolData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContainerServiceAgentPoolData)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceAgentPoolListResult.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceAgentPoolListResult.Serialization.cs deleted file mode 100644 index ec46d1c8119d4..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceAgentPoolListResult.Serialization.cs +++ /dev/null @@ -1,148 +0,0 @@ -// 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.ContainerService; - -namespace Azure.ResourceManager.ContainerService.Models -{ - internal partial class ContainerServiceAgentPoolListResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceAgentPoolListResult)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); - } - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContainerServiceAgentPoolListResult 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(ContainerServiceAgentPoolListResult)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceAgentPoolListResult(document.RootElement, options); - } - - internal static ContainerServiceAgentPoolListResult DeserializeContainerServiceAgentPoolListResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - Optional nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ContainerServiceAgentPoolData.DeserializeContainerServiceAgentPoolData(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ContainerServiceAgentPoolListResult(Optional.ToList(value), nextLink.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(ContainerServiceAgentPoolListResult)} does not support '{options.Format}' format."); - } - } - - ContainerServiceAgentPoolListResult 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); - return DeserializeContainerServiceAgentPoolListResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContainerServiceAgentPoolListResult)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceAgentPoolListResult.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceAgentPoolListResult.cs deleted file mode 100644 index f6268e7710c75..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceAgentPoolListResult.cs +++ /dev/null @@ -1,72 +0,0 @@ -// 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.ContainerService; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The response from the List Agent Pools operation. - internal partial class ContainerServiceAgentPoolListResult - { - /// - /// 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 ContainerServiceAgentPoolListResult() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// The list of agent pools. - /// The URL to get the next set of agent pool results. - /// Keeps track of any properties unknown to the library. - internal ContainerServiceAgentPoolListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) - { - Value = value; - NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The list of agent pools. - public IReadOnlyList Value { get; } - /// The URL to get the next set of agent pool results. - public string NextLink { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceCreationData.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceCreationData.cs deleted file mode 100644 index 283d813a1a879..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceCreationData.cs +++ /dev/null @@ -1,66 +0,0 @@ -// 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.ContainerService.Models -{ - /// Data used when creating a target resource from a source resource. - internal partial class ContainerServiceCreationData - { - /// - /// 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 ContainerServiceCreationData() - { - } - - /// Initializes a new instance of . - /// This is the ARM ID of the source object to be used to create the target object. - /// Keeps track of any properties unknown to the library. - internal ContainerServiceCreationData(ResourceIdentifier sourceResourceId, IDictionary serializedAdditionalRawData) - { - SourceResourceId = sourceResourceId; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// This is the ARM ID of the source object to be used to create the target object. - public ResourceIdentifier SourceResourceId { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceDateSpan.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceDateSpan.Serialization.cs deleted file mode 100644 index ea4c8b0c3f7d6..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceDateSpan.Serialization.cs +++ /dev/null @@ -1,127 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class ContainerServiceDateSpan : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceDateSpan)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("start"u8); - writer.WriteStringValue(Start, "D"); - writer.WritePropertyName("end"u8); - writer.WriteStringValue(End, "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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContainerServiceDateSpan 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(ContainerServiceDateSpan)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceDateSpan(document.RootElement, options); - } - - internal static ContainerServiceDateSpan DeserializeContainerServiceDateSpan(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - DateTimeOffset start = default; - DateTimeOffset end = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("start"u8)) - { - start = property.Value.GetDateTimeOffset("D"); - continue; - } - if (property.NameEquals("end"u8)) - { - end = property.Value.GetDateTimeOffset("D"); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ContainerServiceDateSpan(start, end, 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(ContainerServiceDateSpan)} does not support '{options.Format}' format."); - } - } - - ContainerServiceDateSpan 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); - return DeserializeContainerServiceDateSpan(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContainerServiceDateSpan)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceDateSpan.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceDateSpan.cs deleted file mode 100644 index bb3e389db4eab..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceDateSpan.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// For example, between '2022-12-23' and '2023-01-05'. - public partial class ContainerServiceDateSpan - { - /// - /// 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 start date of the date span. - /// The end date of the date span. - public ContainerServiceDateSpan(DateTimeOffset start, DateTimeOffset end) - { - Start = start; - End = end; - } - - /// Initializes a new instance of . - /// The start date of the date span. - /// The end date of the date span. - /// Keeps track of any properties unknown to the library. - internal ContainerServiceDateSpan(DateTimeOffset start, DateTimeOffset end, IDictionary serializedAdditionalRawData) - { - Start = start; - End = end; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ContainerServiceDateSpan() - { - } - - /// The start date of the date span. - public DateTimeOffset Start { get; set; } - /// The end date of the date span. - public DateTimeOffset End { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceEndpointDependency.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceEndpointDependency.Serialization.cs deleted file mode 100644 index 555275959ccec..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceEndpointDependency.Serialization.cs +++ /dev/null @@ -1,147 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class ContainerServiceEndpointDependency : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceEndpointDependency)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(DomainName)) - { - writer.WritePropertyName("domainName"u8); - writer.WriteStringValue(DomainName); - } - if (Optional.IsCollectionDefined(EndpointDetails)) - { - writer.WritePropertyName("endpointDetails"u8); - writer.WriteStartArray(); - foreach (var item in EndpointDetails) - { - writer.WriteObjectValue(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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContainerServiceEndpointDependency 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(ContainerServiceEndpointDependency)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceEndpointDependency(document.RootElement, options); - } - - internal static ContainerServiceEndpointDependency DeserializeContainerServiceEndpointDependency(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional domainName = default; - Optional> endpointDetails = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("domainName"u8)) - { - domainName = property.Value.GetString(); - continue; - } - if (property.NameEquals("endpointDetails"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ContainerServiceEndpointDetail.DeserializeContainerServiceEndpointDetail(item)); - } - endpointDetails = array; - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ContainerServiceEndpointDependency(domainName.Value, Optional.ToList(endpointDetails), 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(ContainerServiceEndpointDependency)} does not support '{options.Format}' format."); - } - } - - ContainerServiceEndpointDependency 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); - return DeserializeContainerServiceEndpointDependency(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContainerServiceEndpointDependency)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceEndpointDependency.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceEndpointDependency.cs deleted file mode 100644 index 73bae0831df5e..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceEndpointDependency.cs +++ /dev/null @@ -1,71 +0,0 @@ -// 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.ContainerService.Models -{ - /// A domain name that AKS agent nodes are reaching at. - public partial class ContainerServiceEndpointDependency - { - /// - /// 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 ContainerServiceEndpointDependency() - { - EndpointDetails = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// The domain name of the dependency. - /// The Ports and Protocols used when connecting to domainName. - /// Keeps track of any properties unknown to the library. - internal ContainerServiceEndpointDependency(string domainName, IReadOnlyList endpointDetails, IDictionary serializedAdditionalRawData) - { - DomainName = domainName; - EndpointDetails = endpointDetails; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The domain name of the dependency. - public string DomainName { get; } - /// The Ports and Protocols used when connecting to domainName. - public IReadOnlyList EndpointDetails { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceEndpointDetail.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceEndpointDetail.Serialization.cs deleted file mode 100644 index 0227a4faa96e9..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceEndpointDetail.Serialization.cs +++ /dev/null @@ -1,164 +0,0 @@ -// 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.Net; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ContainerServiceEndpointDetail : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceEndpointDetail)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(IPAddress)) - { - writer.WritePropertyName("ipAddress"u8); - writer.WriteStringValue(IPAddress.ToString()); - } - if (Optional.IsDefined(Port)) - { - writer.WritePropertyName("port"u8); - writer.WriteNumberValue(Port.Value); - } - if (Optional.IsDefined(Protocol)) - { - writer.WritePropertyName("protocol"u8); - writer.WriteStringValue(Protocol); - } - if (Optional.IsDefined(Description)) - { - writer.WritePropertyName("description"u8); - writer.WriteStringValue(Description); - } - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContainerServiceEndpointDetail 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(ContainerServiceEndpointDetail)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceEndpointDetail(document.RootElement, options); - } - - internal static ContainerServiceEndpointDetail DeserializeContainerServiceEndpointDetail(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional ipAddress = default; - Optional port = default; - Optional protocol = default; - Optional description = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("ipAddress"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - ipAddress = IPAddress.Parse(property.Value.GetString()); - continue; - } - if (property.NameEquals("port"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - port = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("protocol"u8)) - { - protocol = property.Value.GetString(); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ContainerServiceEndpointDetail(ipAddress.Value, Optional.ToNullable(port), protocol.Value, description.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(ContainerServiceEndpointDetail)} does not support '{options.Format}' format."); - } - } - - ContainerServiceEndpointDetail 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); - return DeserializeContainerServiceEndpointDetail(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContainerServiceEndpointDetail)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceEndpointDetail.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceEndpointDetail.cs deleted file mode 100644 index a495c312f0cc5..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceEndpointDetail.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Net; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// connect information from the AKS agent nodes to a single endpoint. - public partial class ContainerServiceEndpointDetail - { - /// - /// 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 ContainerServiceEndpointDetail() - { - } - - /// Initializes a new instance of . - /// An IP Address that Domain Name currently resolves to. - /// The port an endpoint is connected to. - /// The protocol used for connection. - /// Description of the detail. - /// Keeps track of any properties unknown to the library. - internal ContainerServiceEndpointDetail(IPAddress ipAddress, int? port, string protocol, string description, IDictionary serializedAdditionalRawData) - { - IPAddress = ipAddress; - Port = port; - Protocol = protocol; - Description = description; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// An IP Address that Domain Name currently resolves to. - public IPAddress IPAddress { get; } - /// The port an endpoint is connected to. - public int? Port { get; } - /// The protocol used for connection. - public string Protocol { get; } - /// Description of the detail. - public string Description { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceIPTag.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceIPTag.cs deleted file mode 100644 index fb5f84dec443c..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceIPTag.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Contains the IPTag associated with the object. - public partial class ContainerServiceIPTag - { - /// - /// 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 ContainerServiceIPTag() - { - } - - /// Initializes a new instance of . - /// The IP tag type. Example: RoutingPreference. - /// The value of the IP tag associated with the public IP. Example: Internet. - /// Keeps track of any properties unknown to the library. - internal ContainerServiceIPTag(string ipTagType, string tag, IDictionary serializedAdditionalRawData) - { - IPTagType = ipTagType; - Tag = tag; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The IP tag type. Example: RoutingPreference. - public string IPTagType { get; set; } - /// The value of the IP tag associated with the public IP. Example: Internet. - public string Tag { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceLinuxProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceLinuxProfile.Serialization.cs deleted file mode 100644 index 5466b6fefb38e..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceLinuxProfile.Serialization.cs +++ /dev/null @@ -1,127 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class ContainerServiceLinuxProfile : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceLinuxProfile)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("adminUsername"u8); - writer.WriteStringValue(AdminUsername); - writer.WritePropertyName("ssh"u8); - writer.WriteObjectValue(Ssh); - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContainerServiceLinuxProfile 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(ContainerServiceLinuxProfile)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceLinuxProfile(document.RootElement, options); - } - - internal static ContainerServiceLinuxProfile DeserializeContainerServiceLinuxProfile(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string adminUsername = default; - ContainerServiceSshConfiguration ssh = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("adminUsername"u8)) - { - adminUsername = property.Value.GetString(); - continue; - } - if (property.NameEquals("ssh"u8)) - { - ssh = ContainerServiceSshConfiguration.DeserializeContainerServiceSshConfiguration(property.Value); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ContainerServiceLinuxProfile(adminUsername, ssh, 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(ContainerServiceLinuxProfile)} does not support '{options.Format}' format."); - } - } - - ContainerServiceLinuxProfile 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); - return DeserializeContainerServiceLinuxProfile(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContainerServiceLinuxProfile)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceLinuxProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceLinuxProfile.cs deleted file mode 100644 index 36d7abbdbf76e..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceLinuxProfile.cs +++ /dev/null @@ -1,89 +0,0 @@ -// 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.ContainerService.Models -{ - /// Profile for Linux VMs in the container service cluster. - public partial class ContainerServiceLinuxProfile - { - /// - /// 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 administrator username to use for Linux VMs. - /// The SSH configuration for Linux-based VMs running on Azure. - /// or is null. - public ContainerServiceLinuxProfile(string adminUsername, ContainerServiceSshConfiguration ssh) - { - Argument.AssertNotNull(adminUsername, nameof(adminUsername)); - Argument.AssertNotNull(ssh, nameof(ssh)); - - AdminUsername = adminUsername; - Ssh = ssh; - } - - /// Initializes a new instance of . - /// The administrator username to use for Linux VMs. - /// The SSH configuration for Linux-based VMs running on Azure. - /// Keeps track of any properties unknown to the library. - internal ContainerServiceLinuxProfile(string adminUsername, ContainerServiceSshConfiguration ssh, IDictionary serializedAdditionalRawData) - { - AdminUsername = adminUsername; - Ssh = ssh; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ContainerServiceLinuxProfile() - { - } - - /// The administrator username to use for Linux VMs. - public string AdminUsername { get; set; } - /// The SSH configuration for Linux-based VMs running on Azure. - internal ContainerServiceSshConfiguration Ssh { get; set; } - /// The list of SSH public keys used to authenticate with Linux-based VMs. A maximum of 1 key may be specified. - public IList SshPublicKeys - { - get => Ssh is null ? default : Ssh.PublicKeys; - set => Ssh = new ContainerServiceSshConfiguration(value); - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceLoadBalancerSku.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceLoadBalancerSku.cs deleted file mode 100644 index c2cc159349613..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceLoadBalancerSku.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The default is 'standard'. See [Azure Load Balancer SKUs](https://docs.microsoft.com/azure/load-balancer/skus) for more information about the differences between load balancer SKUs. - public readonly partial struct ContainerServiceLoadBalancerSku : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ContainerServiceLoadBalancerSku(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string StandardValue = "standard"; - private const string BasicValue = "basic"; - - /// Use a a standard Load Balancer. This is the recommended Load Balancer SKU. For more information about on working with the load balancer in the managed cluster, see the [standard Load Balancer](https://docs.microsoft.com/azure/aks/load-balancer-standard) article. - public static ContainerServiceLoadBalancerSku Standard { get; } = new ContainerServiceLoadBalancerSku(StandardValue); - /// Use a basic Load Balancer with limited functionality. - public static ContainerServiceLoadBalancerSku Basic { get; } = new ContainerServiceLoadBalancerSku(BasicValue); - /// Determines if two values are the same. - public static bool operator ==(ContainerServiceLoadBalancerSku left, ContainerServiceLoadBalancerSku right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ContainerServiceLoadBalancerSku left, ContainerServiceLoadBalancerSku right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ContainerServiceLoadBalancerSku(string value) => new ContainerServiceLoadBalancerSku(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ContainerServiceLoadBalancerSku other && Equals(other); - /// - public bool Equals(ContainerServiceLoadBalancerSku other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceAbsoluteMonthlySchedule.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceAbsoluteMonthlySchedule.Serialization.cs deleted file mode 100644 index 51466c66bc682..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceAbsoluteMonthlySchedule.Serialization.cs +++ /dev/null @@ -1,127 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class ContainerServiceMaintenanceAbsoluteMonthlySchedule : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceMaintenanceAbsoluteMonthlySchedule)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("intervalMonths"u8); - writer.WriteNumberValue(IntervalMonths); - writer.WritePropertyName("dayOfMonth"u8); - writer.WriteNumberValue(DayOfMonth); - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContainerServiceMaintenanceAbsoluteMonthlySchedule 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(ContainerServiceMaintenanceAbsoluteMonthlySchedule)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceMaintenanceAbsoluteMonthlySchedule(document.RootElement, options); - } - - internal static ContainerServiceMaintenanceAbsoluteMonthlySchedule DeserializeContainerServiceMaintenanceAbsoluteMonthlySchedule(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - int intervalMonths = default; - int dayOfMonth = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("intervalMonths"u8)) - { - intervalMonths = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("dayOfMonth"u8)) - { - dayOfMonth = property.Value.GetInt32(); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ContainerServiceMaintenanceAbsoluteMonthlySchedule(intervalMonths, dayOfMonth, 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(ContainerServiceMaintenanceAbsoluteMonthlySchedule)} does not support '{options.Format}' format."); - } - } - - ContainerServiceMaintenanceAbsoluteMonthlySchedule 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); - return DeserializeContainerServiceMaintenanceAbsoluteMonthlySchedule(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContainerServiceMaintenanceAbsoluteMonthlySchedule)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceAbsoluteMonthlySchedule.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceAbsoluteMonthlySchedule.cs deleted file mode 100644 index 72c24687c3ee3..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceAbsoluteMonthlySchedule.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// For schedules like: 'recur every month on the 15th' or 'recur every 3 months on the 20th'. - public partial class ContainerServiceMaintenanceAbsoluteMonthlySchedule - { - /// - /// 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 . - /// Specifies the number of months between each set of occurrences. - /// The date of the month. - public ContainerServiceMaintenanceAbsoluteMonthlySchedule(int intervalMonths, int dayOfMonth) - { - IntervalMonths = intervalMonths; - DayOfMonth = dayOfMonth; - } - - /// Initializes a new instance of . - /// Specifies the number of months between each set of occurrences. - /// The date of the month. - /// Keeps track of any properties unknown to the library. - internal ContainerServiceMaintenanceAbsoluteMonthlySchedule(int intervalMonths, int dayOfMonth, IDictionary serializedAdditionalRawData) - { - IntervalMonths = intervalMonths; - DayOfMonth = dayOfMonth; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ContainerServiceMaintenanceAbsoluteMonthlySchedule() - { - } - - /// Specifies the number of months between each set of occurrences. - public int IntervalMonths { get; set; } - /// The date of the month. - public int DayOfMonth { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceConfigurationListResult.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceConfigurationListResult.Serialization.cs deleted file mode 100644 index b6ccf41fc08c2..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceConfigurationListResult.Serialization.cs +++ /dev/null @@ -1,148 +0,0 @@ -// 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.ContainerService; - -namespace Azure.ResourceManager.ContainerService.Models -{ - internal partial class ContainerServiceMaintenanceConfigurationListResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceMaintenanceConfigurationListResult)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); - } - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContainerServiceMaintenanceConfigurationListResult 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(ContainerServiceMaintenanceConfigurationListResult)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceMaintenanceConfigurationListResult(document.RootElement, options); - } - - internal static ContainerServiceMaintenanceConfigurationListResult DeserializeContainerServiceMaintenanceConfigurationListResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - Optional nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ContainerServiceMaintenanceConfigurationData.DeserializeContainerServiceMaintenanceConfigurationData(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ContainerServiceMaintenanceConfigurationListResult(Optional.ToList(value), nextLink.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(ContainerServiceMaintenanceConfigurationListResult)} does not support '{options.Format}' format."); - } - } - - ContainerServiceMaintenanceConfigurationListResult 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); - return DeserializeContainerServiceMaintenanceConfigurationListResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContainerServiceMaintenanceConfigurationListResult)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceRelativeMonthlySchedule.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceRelativeMonthlySchedule.Serialization.cs deleted file mode 100644 index e058ed9b13547..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceRelativeMonthlySchedule.Serialization.cs +++ /dev/null @@ -1,135 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class ContainerServiceMaintenanceRelativeMonthlySchedule : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceMaintenanceRelativeMonthlySchedule)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("intervalMonths"u8); - writer.WriteNumberValue(IntervalMonths); - writer.WritePropertyName("weekIndex"u8); - writer.WriteStringValue(WeekIndex.ToString()); - writer.WritePropertyName("dayOfWeek"u8); - writer.WriteStringValue(DayOfWeek.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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContainerServiceMaintenanceRelativeMonthlySchedule 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(ContainerServiceMaintenanceRelativeMonthlySchedule)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceMaintenanceRelativeMonthlySchedule(document.RootElement, options); - } - - internal static ContainerServiceMaintenanceRelativeMonthlySchedule DeserializeContainerServiceMaintenanceRelativeMonthlySchedule(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - int intervalMonths = default; - ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex weekIndex = default; - ContainerServiceWeekDay dayOfWeek = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("intervalMonths"u8)) - { - intervalMonths = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("weekIndex"u8)) - { - weekIndex = new ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex(property.Value.GetString()); - continue; - } - if (property.NameEquals("dayOfWeek"u8)) - { - dayOfWeek = new ContainerServiceWeekDay(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ContainerServiceMaintenanceRelativeMonthlySchedule(intervalMonths, weekIndex, dayOfWeek, 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(ContainerServiceMaintenanceRelativeMonthlySchedule)} does not support '{options.Format}' format."); - } - } - - ContainerServiceMaintenanceRelativeMonthlySchedule 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); - return DeserializeContainerServiceMaintenanceRelativeMonthlySchedule(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContainerServiceMaintenanceRelativeMonthlySchedule)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceRelativeMonthlySchedule.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceRelativeMonthlySchedule.cs deleted file mode 100644 index 1fc98121a4a24..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceRelativeMonthlySchedule.cs +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// For schedules like: 'recur every month on the first Monday' or 'recur every 3 months on last Friday'. - public partial class ContainerServiceMaintenanceRelativeMonthlySchedule - { - /// - /// 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 . - /// Specifies the number of months between each set of occurrences. - /// Specifies on which week of the month the dayOfWeek applies. - /// Specifies on which day of the week the maintenance occurs. - public ContainerServiceMaintenanceRelativeMonthlySchedule(int intervalMonths, ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex weekIndex, ContainerServiceWeekDay dayOfWeek) - { - IntervalMonths = intervalMonths; - WeekIndex = weekIndex; - DayOfWeek = dayOfWeek; - } - - /// Initializes a new instance of . - /// Specifies the number of months between each set of occurrences. - /// Specifies on which week of the month the dayOfWeek applies. - /// Specifies on which day of the week the maintenance occurs. - /// Keeps track of any properties unknown to the library. - internal ContainerServiceMaintenanceRelativeMonthlySchedule(int intervalMonths, ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex weekIndex, ContainerServiceWeekDay dayOfWeek, IDictionary serializedAdditionalRawData) - { - IntervalMonths = intervalMonths; - WeekIndex = weekIndex; - DayOfWeek = dayOfWeek; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ContainerServiceMaintenanceRelativeMonthlySchedule() - { - } - - /// Specifies the number of months between each set of occurrences. - public int IntervalMonths { get; set; } - /// Specifies on which week of the month the dayOfWeek applies. - public ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex WeekIndex { get; set; } - /// Specifies on which day of the week the maintenance occurs. - public ContainerServiceWeekDay DayOfWeek { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex.cs deleted file mode 100644 index 65370444c5ef8..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Specifies on which week of the month the dayOfWeek applies. - public readonly partial struct ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string FirstValue = "First"; - private const string SecondValue = "Second"; - private const string ThirdValue = "Third"; - private const string FourthValue = "Fourth"; - private const string LastValue = "Last"; - - /// First week of the month. - public static ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex First { get; } = new ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex(FirstValue); - /// Second week of the month. - public static ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex Second { get; } = new ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex(SecondValue); - /// Third week of the month. - public static ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex Third { get; } = new ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex(ThirdValue); - /// Fourth week of the month. - public static ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex Fourth { get; } = new ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex(FourthValue); - /// Last week of the month. - public static ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex Last { get; } = new ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex(LastValue); - /// Determines if two values are the same. - public static bool operator ==(ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex left, ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex left, ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex(string value) => new ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex other && Equals(other); - /// - public bool Equals(ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceSchedule.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceSchedule.Serialization.cs deleted file mode 100644 index 9f4b33dd66a61..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceSchedule.Serialization.cs +++ /dev/null @@ -1,171 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class ContainerServiceMaintenanceSchedule : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceMaintenanceSchedule)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Daily)) - { - writer.WritePropertyName("daily"u8); - writer.WriteObjectValue(Daily); - } - if (Optional.IsDefined(Weekly)) - { - writer.WritePropertyName("weekly"u8); - writer.WriteObjectValue(Weekly); - } - if (Optional.IsDefined(AbsoluteMonthly)) - { - writer.WritePropertyName("absoluteMonthly"u8); - writer.WriteObjectValue(AbsoluteMonthly); - } - if (Optional.IsDefined(RelativeMonthly)) - { - writer.WritePropertyName("relativeMonthly"u8); - writer.WriteObjectValue(RelativeMonthly); - } - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContainerServiceMaintenanceSchedule 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(ContainerServiceMaintenanceSchedule)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceMaintenanceSchedule(document.RootElement, options); - } - - internal static ContainerServiceMaintenanceSchedule DeserializeContainerServiceMaintenanceSchedule(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional daily = default; - Optional weekly = default; - Optional absoluteMonthly = default; - Optional relativeMonthly = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("daily"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - daily = DailySchedule.DeserializeDailySchedule(property.Value); - continue; - } - if (property.NameEquals("weekly"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - weekly = ContainerServiceMaintenanceWeeklySchedule.DeserializeContainerServiceMaintenanceWeeklySchedule(property.Value); - continue; - } - if (property.NameEquals("absoluteMonthly"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - absoluteMonthly = ContainerServiceMaintenanceAbsoluteMonthlySchedule.DeserializeContainerServiceMaintenanceAbsoluteMonthlySchedule(property.Value); - continue; - } - if (property.NameEquals("relativeMonthly"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - relativeMonthly = ContainerServiceMaintenanceRelativeMonthlySchedule.DeserializeContainerServiceMaintenanceRelativeMonthlySchedule(property.Value); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ContainerServiceMaintenanceSchedule(daily.Value, weekly.Value, absoluteMonthly.Value, relativeMonthly.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(ContainerServiceMaintenanceSchedule)} does not support '{options.Format}' format."); - } - } - - ContainerServiceMaintenanceSchedule 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); - return DeserializeContainerServiceMaintenanceSchedule(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContainerServiceMaintenanceSchedule)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceSchedule.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceSchedule.cs deleted file mode 100644 index 059c591464bd7..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceSchedule.cs +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// One and only one of the schedule types should be specified. Choose either 'daily', 'weekly', 'absoluteMonthly' or 'relativeMonthly' for your maintenance schedule. - public partial class ContainerServiceMaintenanceSchedule - { - /// - /// 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 ContainerServiceMaintenanceSchedule() - { - } - - /// Initializes a new instance of . - /// For schedules like: 'recur every day' or 'recur every 3 days'. - /// For schedules like: 'recur every Monday' or 'recur every 3 weeks on Wednesday'. - /// For schedules like: 'recur every month on the 15th' or 'recur every 3 months on the 20th'. - /// For schedules like: 'recur every month on the first Monday' or 'recur every 3 months on last Friday'. - /// Keeps track of any properties unknown to the library. - internal ContainerServiceMaintenanceSchedule(DailySchedule daily, ContainerServiceMaintenanceWeeklySchedule weekly, ContainerServiceMaintenanceAbsoluteMonthlySchedule absoluteMonthly, ContainerServiceMaintenanceRelativeMonthlySchedule relativeMonthly, IDictionary serializedAdditionalRawData) - { - Daily = daily; - Weekly = weekly; - AbsoluteMonthly = absoluteMonthly; - RelativeMonthly = relativeMonthly; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// For schedules like: 'recur every day' or 'recur every 3 days'. - internal DailySchedule Daily { get; set; } - /// Specifies the number of days between each set of occurrences. - public int? DailyIntervalDays - { - get => Daily is null ? default(int?) : Daily.IntervalDays; - set - { - Daily = value.HasValue ? new DailySchedule(value.Value) : null; - } - } - - /// For schedules like: 'recur every Monday' or 'recur every 3 weeks on Wednesday'. - public ContainerServiceMaintenanceWeeklySchedule Weekly { get; set; } - /// For schedules like: 'recur every month on the 15th' or 'recur every 3 months on the 20th'. - public ContainerServiceMaintenanceAbsoluteMonthlySchedule AbsoluteMonthly { get; set; } - /// For schedules like: 'recur every month on the first Monday' or 'recur every 3 months on last Friday'. - public ContainerServiceMaintenanceRelativeMonthlySchedule RelativeMonthly { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceWeeklySchedule.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceWeeklySchedule.Serialization.cs deleted file mode 100644 index 9db630344a932..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceWeeklySchedule.Serialization.cs +++ /dev/null @@ -1,127 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class ContainerServiceMaintenanceWeeklySchedule : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceMaintenanceWeeklySchedule)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("intervalWeeks"u8); - writer.WriteNumberValue(IntervalWeeks); - writer.WritePropertyName("dayOfWeek"u8); - writer.WriteStringValue(DayOfWeek.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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContainerServiceMaintenanceWeeklySchedule 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(ContainerServiceMaintenanceWeeklySchedule)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceMaintenanceWeeklySchedule(document.RootElement, options); - } - - internal static ContainerServiceMaintenanceWeeklySchedule DeserializeContainerServiceMaintenanceWeeklySchedule(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - int intervalWeeks = default; - ContainerServiceWeekDay dayOfWeek = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("intervalWeeks"u8)) - { - intervalWeeks = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("dayOfWeek"u8)) - { - dayOfWeek = new ContainerServiceWeekDay(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ContainerServiceMaintenanceWeeklySchedule(intervalWeeks, dayOfWeek, 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(ContainerServiceMaintenanceWeeklySchedule)} does not support '{options.Format}' format."); - } - } - - ContainerServiceMaintenanceWeeklySchedule 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); - return DeserializeContainerServiceMaintenanceWeeklySchedule(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContainerServiceMaintenanceWeeklySchedule)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceWeeklySchedule.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceWeeklySchedule.cs deleted file mode 100644 index 734353fd463fe..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceWeeklySchedule.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// For schedules like: 'recur every Monday' or 'recur every 3 weeks on Wednesday'. - public partial class ContainerServiceMaintenanceWeeklySchedule - { - /// - /// 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 . - /// Specifies the number of weeks between each set of occurrences. - /// Specifies on which day of the week the maintenance occurs. - public ContainerServiceMaintenanceWeeklySchedule(int intervalWeeks, ContainerServiceWeekDay dayOfWeek) - { - IntervalWeeks = intervalWeeks; - DayOfWeek = dayOfWeek; - } - - /// Initializes a new instance of . - /// Specifies the number of weeks between each set of occurrences. - /// Specifies on which day of the week the maintenance occurs. - /// Keeps track of any properties unknown to the library. - internal ContainerServiceMaintenanceWeeklySchedule(int intervalWeeks, ContainerServiceWeekDay dayOfWeek, IDictionary serializedAdditionalRawData) - { - IntervalWeeks = intervalWeeks; - DayOfWeek = dayOfWeek; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ContainerServiceMaintenanceWeeklySchedule() - { - } - - /// Specifies the number of weeks between each set of occurrences. - public int IntervalWeeks { get; set; } - /// Specifies on which day of the week the maintenance occurs. - public ContainerServiceWeekDay DayOfWeek { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceWindow.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceWindow.Serialization.cs deleted file mode 100644 index 4e534f807e894..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceWindow.Serialization.cs +++ /dev/null @@ -1,182 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class ContainerServiceMaintenanceWindow : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceMaintenanceWindow)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("schedule"u8); - writer.WriteObjectValue(Schedule); - writer.WritePropertyName("durationHours"u8); - writer.WriteNumberValue(DurationHours); - if (Optional.IsDefined(UtcOffset)) - { - writer.WritePropertyName("utcOffset"u8); - writer.WriteStringValue(UtcOffset); - } - if (Optional.IsDefined(StartDate)) - { - writer.WritePropertyName("startDate"u8); - writer.WriteStringValue(StartDate); - } - writer.WritePropertyName("startTime"u8); - writer.WriteStringValue(StartTime); - if (Optional.IsCollectionDefined(NotAllowedDates)) - { - writer.WritePropertyName("notAllowedDates"u8); - writer.WriteStartArray(); - foreach (var item in NotAllowedDates) - { - writer.WriteObjectValue(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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContainerServiceMaintenanceWindow 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(ContainerServiceMaintenanceWindow)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceMaintenanceWindow(document.RootElement, options); - } - - internal static ContainerServiceMaintenanceWindow DeserializeContainerServiceMaintenanceWindow(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ContainerServiceMaintenanceSchedule schedule = default; - int durationHours = default; - Optional utcOffset = default; - Optional startDate = default; - string startTime = default; - Optional> notAllowedDates = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("schedule"u8)) - { - schedule = ContainerServiceMaintenanceSchedule.DeserializeContainerServiceMaintenanceSchedule(property.Value); - continue; - } - if (property.NameEquals("durationHours"u8)) - { - durationHours = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("utcOffset"u8)) - { - utcOffset = property.Value.GetString(); - continue; - } - if (property.NameEquals("startDate"u8)) - { - startDate = property.Value.GetString(); - continue; - } - if (property.NameEquals("startTime"u8)) - { - startTime = property.Value.GetString(); - continue; - } - if (property.NameEquals("notAllowedDates"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ContainerServiceDateSpan.DeserializeContainerServiceDateSpan(item)); - } - notAllowedDates = array; - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ContainerServiceMaintenanceWindow(schedule, durationHours, utcOffset.Value, startDate.Value, startTime, Optional.ToList(notAllowedDates), 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(ContainerServiceMaintenanceWindow)} does not support '{options.Format}' format."); - } - } - - ContainerServiceMaintenanceWindow 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); - return DeserializeContainerServiceMaintenanceWindow(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContainerServiceMaintenanceWindow)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceWindow.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceWindow.cs deleted file mode 100644 index a18126411112d..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceWindow.cs +++ /dev/null @@ -1,102 +0,0 @@ -// 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.ContainerService.Models -{ - /// Maintenance window used to configure scheduled auto-upgrade for a Managed Cluster. - public partial class ContainerServiceMaintenanceWindow - { - /// - /// 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 . - /// Recurrence schedule for the maintenance window. - /// Length of maintenance window range from 4 to 24 hours. - /// The start time of the maintenance window. Accepted values are from '00:00' to '23:59'. 'utcOffset' applies to this field. For example: '02:00' with 'utcOffset: +02:00' means UTC time '00:00'. - /// or is null. - public ContainerServiceMaintenanceWindow(ContainerServiceMaintenanceSchedule schedule, int durationHours, string startTime) - { - Argument.AssertNotNull(schedule, nameof(schedule)); - Argument.AssertNotNull(startTime, nameof(startTime)); - - Schedule = schedule; - DurationHours = durationHours; - StartTime = startTime; - NotAllowedDates = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Recurrence schedule for the maintenance window. - /// Length of maintenance window range from 4 to 24 hours. - /// The UTC offset in format +/-HH:mm. For example, '+05:30' for IST and '-07:00' for PST. If not specified, the default is '+00:00'. - /// The date the maintenance window activates. If the current date is before this date, the maintenance window is inactive and will not be used for upgrades. If not specified, the maintenance window will be active right away. - /// The start time of the maintenance window. Accepted values are from '00:00' to '23:59'. 'utcOffset' applies to this field. For example: '02:00' with 'utcOffset: +02:00' means UTC time '00:00'. - /// Date ranges on which upgrade is not allowed. 'utcOffset' applies to this field. For example, with 'utcOffset: +02:00' and 'dateSpan' being '2022-12-23' to '2023-01-03', maintenance will be blocked from '2022-12-22 22:00' to '2023-01-03 22:00' in UTC time. - /// Keeps track of any properties unknown to the library. - internal ContainerServiceMaintenanceWindow(ContainerServiceMaintenanceSchedule schedule, int durationHours, string utcOffset, string startDate, string startTime, IList notAllowedDates, IDictionary serializedAdditionalRawData) - { - Schedule = schedule; - DurationHours = durationHours; - UtcOffset = utcOffset; - StartDate = startDate; - StartTime = startTime; - NotAllowedDates = notAllowedDates; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ContainerServiceMaintenanceWindow() - { - } - - /// Recurrence schedule for the maintenance window. - public ContainerServiceMaintenanceSchedule Schedule { get; set; } - /// Length of maintenance window range from 4 to 24 hours. - public int DurationHours { get; set; } - /// The UTC offset in format +/-HH:mm. For example, '+05:30' for IST and '-07:00' for PST. If not specified, the default is '+00:00'. - public string UtcOffset { get; set; } - /// The date the maintenance window activates. If the current date is before this date, the maintenance window is inactive and will not be used for upgrades. If not specified, the maintenance window will be active right away. - public string StartDate { get; set; } - /// The start time of the maintenance window. Accepted values are from '00:00' to '23:59'. 'utcOffset' applies to this field. For example: '02:00' with 'utcOffset: +02:00' means UTC time '00:00'. - public string StartTime { get; set; } - /// Date ranges on which upgrade is not allowed. 'utcOffset' applies to this field. For example, with 'utcOffset: +02:00' and 'dateSpan' being '2022-12-23' to '2023-01-03', maintenance will be blocked from '2022-12-22 22:00' to '2023-01-03 22:00' in UTC time. - public IList NotAllowedDates { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceManagedClusterData.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceManagedClusterData.Serialization.cs deleted file mode 100644 index c267300928f8c..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceManagedClusterData.Serialization.cs +++ /dev/null @@ -1,847 +0,0 @@ -// 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.ContainerService.Models; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.ContainerService -{ - public partial class ContainerServiceManagedClusterData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceManagedClusterData)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Sku)) - { - writer.WritePropertyName("sku"u8); - writer.WriteObjectValue(Sku); - } - if (Optional.IsDefined(ExtendedLocation)) - { - writer.WritePropertyName("extendedLocation"u8); - JsonSerializer.Serialize(writer, ExtendedLocation); - } - if (Optional.IsDefined(ClusterIdentity)) - { - writer.WritePropertyName("identity"u8); - writer.WriteObjectValue(ClusterIdentity); - } - 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(); - } - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState); - } - if (options.Format != "W" && Optional.IsDefined(PowerState)) - { - writer.WritePropertyName("powerState"u8); - writer.WriteObjectValue(PowerState); - } - if (options.Format != "W" && Optional.IsDefined(MaxAgentPools)) - { - writer.WritePropertyName("maxAgentPools"u8); - writer.WriteNumberValue(MaxAgentPools.Value); - } - if (Optional.IsDefined(KubernetesVersion)) - { - writer.WritePropertyName("kubernetesVersion"u8); - writer.WriteStringValue(KubernetesVersion); - } - if (options.Format != "W" && Optional.IsDefined(CurrentKubernetesVersion)) - { - writer.WritePropertyName("currentKubernetesVersion"u8); - writer.WriteStringValue(CurrentKubernetesVersion); - } - if (Optional.IsDefined(DnsPrefix)) - { - writer.WritePropertyName("dnsPrefix"u8); - writer.WriteStringValue(DnsPrefix); - } - if (Optional.IsDefined(FqdnSubdomain)) - { - writer.WritePropertyName("fqdnSubdomain"u8); - writer.WriteStringValue(FqdnSubdomain); - } - if (options.Format != "W" && Optional.IsDefined(Fqdn)) - { - writer.WritePropertyName("fqdn"u8); - writer.WriteStringValue(Fqdn); - } - if (options.Format != "W" && Optional.IsDefined(PrivateFqdn)) - { - writer.WritePropertyName("privateFQDN"u8); - writer.WriteStringValue(PrivateFqdn); - } - if (options.Format != "W" && Optional.IsDefined(AzurePortalFqdn)) - { - writer.WritePropertyName("azurePortalFQDN"u8); - writer.WriteStringValue(AzurePortalFqdn); - } - if (Optional.IsCollectionDefined(AgentPoolProfiles)) - { - writer.WritePropertyName("agentPoolProfiles"u8); - writer.WriteStartArray(); - foreach (var item in AgentPoolProfiles) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(LinuxProfile)) - { - writer.WritePropertyName("linuxProfile"u8); - writer.WriteObjectValue(LinuxProfile); - } - if (Optional.IsDefined(WindowsProfile)) - { - writer.WritePropertyName("windowsProfile"u8); - writer.WriteObjectValue(WindowsProfile); - } - if (Optional.IsDefined(ServicePrincipalProfile)) - { - writer.WritePropertyName("servicePrincipalProfile"u8); - writer.WriteObjectValue(ServicePrincipalProfile); - } - if (Optional.IsCollectionDefined(AddonProfiles)) - { - writer.WritePropertyName("addonProfiles"u8); - writer.WriteStartObject(); - foreach (var item in AddonProfiles) - { - writer.WritePropertyName(item.Key); - writer.WriteObjectValue(item.Value); - } - writer.WriteEndObject(); - } - if (Optional.IsDefined(PodIdentityProfile)) - { - writer.WritePropertyName("podIdentityProfile"u8); - writer.WriteObjectValue(PodIdentityProfile); - } - if (Optional.IsDefined(OidcIssuerProfile)) - { - writer.WritePropertyName("oidcIssuerProfile"u8); - writer.WriteObjectValue(OidcIssuerProfile); - } - if (Optional.IsDefined(NodeResourceGroup)) - { - writer.WritePropertyName("nodeResourceGroup"u8); - writer.WriteStringValue(NodeResourceGroup); - } - if (Optional.IsDefined(EnableRbac)) - { - writer.WritePropertyName("enableRBAC"u8); - writer.WriteBooleanValue(EnableRbac.Value); - } - if (Optional.IsDefined(SupportPlan)) - { - writer.WritePropertyName("supportPlan"u8); - writer.WriteStringValue(SupportPlan.Value.ToString()); - } - if (Optional.IsDefined(EnablePodSecurityPolicy)) - { - writer.WritePropertyName("enablePodSecurityPolicy"u8); - writer.WriteBooleanValue(EnablePodSecurityPolicy.Value); - } - if (Optional.IsDefined(NetworkProfile)) - { - writer.WritePropertyName("networkProfile"u8); - writer.WriteObjectValue(NetworkProfile); - } - if (Optional.IsDefined(AadProfile)) - { - writer.WritePropertyName("aadProfile"u8); - writer.WriteObjectValue(AadProfile); - } - if (Optional.IsDefined(AutoUpgradeProfile)) - { - writer.WritePropertyName("autoUpgradeProfile"u8); - writer.WriteObjectValue(AutoUpgradeProfile); - } - if (Optional.IsDefined(UpgradeSettings)) - { - writer.WritePropertyName("upgradeSettings"u8); - writer.WriteObjectValue(UpgradeSettings); - } - if (Optional.IsDefined(AutoScalerProfile)) - { - writer.WritePropertyName("autoScalerProfile"u8); - writer.WriteObjectValue(AutoScalerProfile); - } - if (Optional.IsDefined(ApiServerAccessProfile)) - { - writer.WritePropertyName("apiServerAccessProfile"u8); - writer.WriteObjectValue(ApiServerAccessProfile); - } - if (Optional.IsDefined(DiskEncryptionSetId)) - { - writer.WritePropertyName("diskEncryptionSetID"u8); - writer.WriteStringValue(DiskEncryptionSetId); - } - if (Optional.IsCollectionDefined(IdentityProfile)) - { - writer.WritePropertyName("identityProfile"u8); - writer.WriteStartObject(); - foreach (var item in IdentityProfile) - { - writer.WritePropertyName(item.Key); - writer.WriteObjectValue(item.Value); - } - writer.WriteEndObject(); - } - if (Optional.IsCollectionDefined(PrivateLinkResources)) - { - writer.WritePropertyName("privateLinkResources"u8); - writer.WriteStartArray(); - foreach (var item in PrivateLinkResources) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(DisableLocalAccounts)) - { - writer.WritePropertyName("disableLocalAccounts"u8); - writer.WriteBooleanValue(DisableLocalAccounts.Value); - } - if (Optional.IsDefined(HttpProxyConfig)) - { - writer.WritePropertyName("httpProxyConfig"u8); - writer.WriteObjectValue(HttpProxyConfig); - } - if (Optional.IsDefined(SecurityProfile)) - { - writer.WritePropertyName("securityProfile"u8); - writer.WriteObjectValue(SecurityProfile); - } - if (Optional.IsDefined(StorageProfile)) - { - writer.WritePropertyName("storageProfile"u8); - writer.WriteObjectValue(StorageProfile); - } - if (Optional.IsDefined(PublicNetworkAccess)) - { - writer.WritePropertyName("publicNetworkAccess"u8); - writer.WriteStringValue(PublicNetworkAccess.Value.ToString()); - } - if (Optional.IsDefined(WorkloadAutoScalerProfile)) - { - writer.WritePropertyName("workloadAutoScalerProfile"u8); - writer.WriteObjectValue(WorkloadAutoScalerProfile); - } - if (Optional.IsDefined(AzureMonitorProfile)) - { - writer.WritePropertyName("azureMonitorProfile"u8); - writer.WriteObjectValue(AzureMonitorProfile); - } - if (Optional.IsDefined(ServiceMeshProfile)) - { - writer.WritePropertyName("serviceMeshProfile"u8); - writer.WriteObjectValue(ServiceMeshProfile); - } - if (options.Format != "W" && Optional.IsDefined(ResourceId)) - { - writer.WritePropertyName("resourceUID"u8); - writer.WriteStringValue(ResourceId); - } - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContainerServiceManagedClusterData 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(ContainerServiceManagedClusterData)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceManagedClusterData(document.RootElement, options); - } - - internal static ContainerServiceManagedClusterData DeserializeContainerServiceManagedClusterData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional sku = default; - Optional extendedLocation = default; - Optional identity = default; - Optional> tags = default; - AzureLocation location = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional provisioningState = default; - Optional powerState = default; - Optional maxAgentPools = default; - Optional kubernetesVersion = default; - Optional currentKubernetesVersion = default; - Optional dnsPrefix = default; - Optional fqdnSubdomain = default; - Optional fqdn = default; - Optional privateFQDN = default; - Optional azurePortalFQDN = default; - Optional> agentPoolProfiles = default; - Optional linuxProfile = default; - Optional windowsProfile = default; - Optional servicePrincipalProfile = default; - Optional> addonProfiles = default; - Optional podIdentityProfile = default; - Optional oidcIssuerProfile = default; - Optional nodeResourceGroup = default; - Optional enableRBAC = default; - Optional supportPlan = default; - Optional enablePodSecurityPolicy = default; - Optional networkProfile = default; - Optional aadProfile = default; - Optional autoUpgradeProfile = default; - Optional upgradeSettings = default; - Optional autoScalerProfile = default; - Optional apiServerAccessProfile = default; - Optional diskEncryptionSetId = default; - Optional> identityProfile = default; - Optional> privateLinkResources = default; - Optional disableLocalAccounts = default; - Optional httpProxyConfig = default; - Optional securityProfile = default; - Optional storageProfile = default; - Optional publicNetworkAccess = default; - Optional workloadAutoScalerProfile = default; - Optional azureMonitorProfile = default; - Optional serviceMeshProfile = default; - Optional resourceUID = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("sku"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - sku = ManagedClusterSku.DeserializeManagedClusterSku(property.Value); - continue; - } - if (property.NameEquals("extendedLocation"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - extendedLocation = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - identity = ManagedClusterIdentity.DeserializeManagedClusterIdentity(property.Value); - 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)) - { - provisioningState = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("powerState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - powerState = ContainerServicePowerState.DeserializeContainerServicePowerState(property0.Value); - continue; - } - if (property0.NameEquals("maxAgentPools"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - maxAgentPools = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("kubernetesVersion"u8)) - { - kubernetesVersion = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("currentKubernetesVersion"u8)) - { - currentKubernetesVersion = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("dnsPrefix"u8)) - { - dnsPrefix = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("fqdnSubdomain"u8)) - { - fqdnSubdomain = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("fqdn"u8)) - { - fqdn = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("privateFQDN"u8)) - { - privateFQDN = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("azurePortalFQDN"u8)) - { - azurePortalFQDN = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("agentPoolProfiles"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(ManagedClusterAgentPoolProfile.DeserializeManagedClusterAgentPoolProfile(item)); - } - agentPoolProfiles = array; - continue; - } - if (property0.NameEquals("linuxProfile"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - linuxProfile = ContainerServiceLinuxProfile.DeserializeContainerServiceLinuxProfile(property0.Value); - continue; - } - if (property0.NameEquals("windowsProfile"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - windowsProfile = ManagedClusterWindowsProfile.DeserializeManagedClusterWindowsProfile(property0.Value); - continue; - } - if (property0.NameEquals("servicePrincipalProfile"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - servicePrincipalProfile = ManagedClusterServicePrincipalProfile.DeserializeManagedClusterServicePrincipalProfile(property0.Value); - continue; - } - if (property0.NameEquals("addonProfiles"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property1 in property0.Value.EnumerateObject()) - { - dictionary.Add(property1.Name, ManagedClusterAddonProfile.DeserializeManagedClusterAddonProfile(property1.Value)); - } - addonProfiles = dictionary; - continue; - } - if (property0.NameEquals("podIdentityProfile"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - podIdentityProfile = ManagedClusterPodIdentityProfile.DeserializeManagedClusterPodIdentityProfile(property0.Value); - continue; - } - if (property0.NameEquals("oidcIssuerProfile"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - oidcIssuerProfile = ManagedClusterOidcIssuerProfile.DeserializeManagedClusterOidcIssuerProfile(property0.Value); - continue; - } - if (property0.NameEquals("nodeResourceGroup"u8)) - { - nodeResourceGroup = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("enableRBAC"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableRBAC = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("supportPlan"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - supportPlan = new KubernetesSupportPlan(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("enablePodSecurityPolicy"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enablePodSecurityPolicy = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("networkProfile"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - networkProfile = ContainerServiceNetworkProfile.DeserializeContainerServiceNetworkProfile(property0.Value); - continue; - } - if (property0.NameEquals("aadProfile"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - aadProfile = ManagedClusterAadProfile.DeserializeManagedClusterAadProfile(property0.Value); - continue; - } - if (property0.NameEquals("autoUpgradeProfile"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - autoUpgradeProfile = ManagedClusterAutoUpgradeProfile.DeserializeManagedClusterAutoUpgradeProfile(property0.Value); - continue; - } - if (property0.NameEquals("upgradeSettings"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - upgradeSettings = ClusterUpgradeSettings.DeserializeClusterUpgradeSettings(property0.Value); - continue; - } - if (property0.NameEquals("autoScalerProfile"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - autoScalerProfile = ManagedClusterAutoScalerProfile.DeserializeManagedClusterAutoScalerProfile(property0.Value); - continue; - } - if (property0.NameEquals("apiServerAccessProfile"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - apiServerAccessProfile = ManagedClusterApiServerAccessProfile.DeserializeManagedClusterApiServerAccessProfile(property0.Value); - continue; - } - if (property0.NameEquals("diskEncryptionSetID"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - diskEncryptionSetId = new ResourceIdentifier(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("identityProfile"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property1 in property0.Value.EnumerateObject()) - { - dictionary.Add(property1.Name, ContainerServiceUserAssignedIdentity.DeserializeContainerServiceUserAssignedIdentity(property1.Value)); - } - identityProfile = dictionary; - continue; - } - if (property0.NameEquals("privateLinkResources"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(ContainerServicePrivateLinkResourceData.DeserializeContainerServicePrivateLinkResourceData(item)); - } - privateLinkResources = array; - continue; - } - if (property0.NameEquals("disableLocalAccounts"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - disableLocalAccounts = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("httpProxyConfig"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - httpProxyConfig = ManagedClusterHttpProxyConfig.DeserializeManagedClusterHttpProxyConfig(property0.Value); - continue; - } - if (property0.NameEquals("securityProfile"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - securityProfile = ManagedClusterSecurityProfile.DeserializeManagedClusterSecurityProfile(property0.Value); - continue; - } - if (property0.NameEquals("storageProfile"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - storageProfile = ManagedClusterStorageProfile.DeserializeManagedClusterStorageProfile(property0.Value); - continue; - } - if (property0.NameEquals("publicNetworkAccess"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - publicNetworkAccess = new ContainerServicePublicNetworkAccess(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("workloadAutoScalerProfile"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - workloadAutoScalerProfile = ManagedClusterWorkloadAutoScalerProfile.DeserializeManagedClusterWorkloadAutoScalerProfile(property0.Value); - continue; - } - if (property0.NameEquals("azureMonitorProfile"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - azureMonitorProfile = ManagedClusterAzureMonitorProfile.DeserializeManagedClusterAzureMonitorProfile(property0.Value); - continue; - } - if (property0.NameEquals("serviceMeshProfile"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - serviceMeshProfile = ServiceMeshProfile.DeserializeServiceMeshProfile(property0.Value); - continue; - } - if (property0.NameEquals("resourceUID"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - resourceUID = new ResourceIdentifier(property0.Value.GetString()); - continue; - } - } - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ContainerServiceManagedClusterData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, sku.Value, extendedLocation, identity.Value, provisioningState.Value, powerState.Value, Optional.ToNullable(maxAgentPools), kubernetesVersion.Value, currentKubernetesVersion.Value, dnsPrefix.Value, fqdnSubdomain.Value, fqdn.Value, privateFQDN.Value, azurePortalFQDN.Value, Optional.ToList(agentPoolProfiles), linuxProfile.Value, windowsProfile.Value, servicePrincipalProfile.Value, Optional.ToDictionary(addonProfiles), podIdentityProfile.Value, oidcIssuerProfile.Value, nodeResourceGroup.Value, Optional.ToNullable(enableRBAC), Optional.ToNullable(supportPlan), Optional.ToNullable(enablePodSecurityPolicy), networkProfile.Value, aadProfile.Value, autoUpgradeProfile.Value, upgradeSettings.Value, autoScalerProfile.Value, apiServerAccessProfile.Value, diskEncryptionSetId.Value, Optional.ToDictionary(identityProfile), Optional.ToList(privateLinkResources), Optional.ToNullable(disableLocalAccounts), httpProxyConfig.Value, securityProfile.Value, storageProfile.Value, Optional.ToNullable(publicNetworkAccess), workloadAutoScalerProfile.Value, azureMonitorProfile.Value, serviceMeshProfile.Value, resourceUID.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(ContainerServiceManagedClusterData)} does not support '{options.Format}' format."); - } - } - - ContainerServiceManagedClusterData 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); - return DeserializeContainerServiceManagedClusterData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContainerServiceManagedClusterData)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkMode.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkMode.cs deleted file mode 100644 index 9ead61a9c3d8e..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkMode.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// This cannot be specified if networkPlugin is anything other than 'azure'. - public readonly partial struct ContainerServiceNetworkMode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ContainerServiceNetworkMode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string TransparentValue = "transparent"; - private const string BridgeValue = "bridge"; - - /// No bridge is created. Intra-VM Pod to Pod communication is through IP routes created by Azure CNI. See [Transparent Mode](https://docs.microsoft.com/azure/aks/faq#transparent-mode) for more information. - public static ContainerServiceNetworkMode Transparent { get; } = new ContainerServiceNetworkMode(TransparentValue); - /// This is no longer supported. - public static ContainerServiceNetworkMode Bridge { get; } = new ContainerServiceNetworkMode(BridgeValue); - /// Determines if two values are the same. - public static bool operator ==(ContainerServiceNetworkMode left, ContainerServiceNetworkMode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ContainerServiceNetworkMode left, ContainerServiceNetworkMode right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ContainerServiceNetworkMode(string value) => new ContainerServiceNetworkMode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ContainerServiceNetworkMode other && Equals(other); - /// - public bool Equals(ContainerServiceNetworkMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkPlugin.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkPlugin.cs deleted file mode 100644 index 6b445ef23e02d..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkPlugin.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Network plugin used for building the Kubernetes network. - public readonly partial struct ContainerServiceNetworkPlugin : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ContainerServiceNetworkPlugin(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AzureValue = "azure"; - private const string KubenetValue = "kubenet"; - private const string NoneValue = "none"; - - /// Use the Azure CNI network plugin. See [Azure CNI (advanced) networking](https://docs.microsoft.com/azure/aks/concepts-network#azure-cni-advanced-networking) for more information. - public static ContainerServiceNetworkPlugin Azure { get; } = new ContainerServiceNetworkPlugin(AzureValue); - /// Use the Kubenet network plugin. See [Kubenet (basic) networking](https://docs.microsoft.com/azure/aks/concepts-network#kubenet-basic-networking) for more information. - public static ContainerServiceNetworkPlugin Kubenet { get; } = new ContainerServiceNetworkPlugin(KubenetValue); - /// No CNI plugin is pre-installed. See [BYO CNI](https://docs.microsoft.com/en-us/azure/aks/use-byo-cni) for more information. - public static ContainerServiceNetworkPlugin None { get; } = new ContainerServiceNetworkPlugin(NoneValue); - /// Determines if two values are the same. - public static bool operator ==(ContainerServiceNetworkPlugin left, ContainerServiceNetworkPlugin right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ContainerServiceNetworkPlugin left, ContainerServiceNetworkPlugin right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ContainerServiceNetworkPlugin(string value) => new ContainerServiceNetworkPlugin(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ContainerServiceNetworkPlugin other && Equals(other); - /// - public bool Equals(ContainerServiceNetworkPlugin other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkPluginMode.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkPluginMode.cs deleted file mode 100644 index 0a640988ae1a4..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkPluginMode.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The mode the network plugin should use. - public readonly partial struct ContainerServiceNetworkPluginMode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ContainerServiceNetworkPluginMode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string OverlayValue = "overlay"; - - /// Used with networkPlugin=azure, pods are given IPs from the PodCIDR address space but use Azure Routing Domains rather than Kubenet's method of route tables. For more information visit https://aka.ms/aks/azure-cni-overlay. - public static ContainerServiceNetworkPluginMode Overlay { get; } = new ContainerServiceNetworkPluginMode(OverlayValue); - /// Determines if two values are the same. - public static bool operator ==(ContainerServiceNetworkPluginMode left, ContainerServiceNetworkPluginMode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ContainerServiceNetworkPluginMode left, ContainerServiceNetworkPluginMode right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ContainerServiceNetworkPluginMode(string value) => new ContainerServiceNetworkPluginMode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ContainerServiceNetworkPluginMode other && Equals(other); - /// - public bool Equals(ContainerServiceNetworkPluginMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkPolicy.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkPolicy.cs deleted file mode 100644 index 9e495d0248937..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkPolicy.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Network policy used for building the Kubernetes network. - public readonly partial struct ContainerServiceNetworkPolicy : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ContainerServiceNetworkPolicy(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string CalicoValue = "calico"; - private const string AzureValue = "azure"; - private const string CiliumValue = "cilium"; - - /// Use Calico network policies. See [differences between Azure and Calico policies](https://docs.microsoft.com/azure/aks/use-network-policies#differences-between-azure-and-calico-policies-and-their-capabilities) for more information. - public static ContainerServiceNetworkPolicy Calico { get; } = new ContainerServiceNetworkPolicy(CalicoValue); - /// Use Azure network policies. See [differences between Azure and Calico policies](https://docs.microsoft.com/azure/aks/use-network-policies#differences-between-azure-and-calico-policies-and-their-capabilities) for more information. - public static ContainerServiceNetworkPolicy Azure { get; } = new ContainerServiceNetworkPolicy(AzureValue); - /// Use Cilium to enforce network policies. This requires networkDataplane to be 'cilium'. - public static ContainerServiceNetworkPolicy Cilium { get; } = new ContainerServiceNetworkPolicy(CiliumValue); - /// Determines if two values are the same. - public static bool operator ==(ContainerServiceNetworkPolicy left, ContainerServiceNetworkPolicy right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ContainerServiceNetworkPolicy left, ContainerServiceNetworkPolicy right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ContainerServiceNetworkPolicy(string value) => new ContainerServiceNetworkPolicy(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ContainerServiceNetworkPolicy other && Equals(other); - /// - public bool Equals(ContainerServiceNetworkPolicy other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkProfile.Serialization.cs deleted file mode 100644 index 60c2e81d1306a..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkProfile.Serialization.cs +++ /dev/null @@ -1,354 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class ContainerServiceNetworkProfile : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceNetworkProfile)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(NetworkPlugin)) - { - writer.WritePropertyName("networkPlugin"u8); - writer.WriteStringValue(NetworkPlugin.Value.ToString()); - } - if (Optional.IsDefined(NetworkPluginMode)) - { - writer.WritePropertyName("networkPluginMode"u8); - writer.WriteStringValue(NetworkPluginMode.Value.ToString()); - } - if (Optional.IsDefined(NetworkPolicy)) - { - writer.WritePropertyName("networkPolicy"u8); - writer.WriteStringValue(NetworkPolicy.Value.ToString()); - } - if (Optional.IsDefined(NetworkMode)) - { - writer.WritePropertyName("networkMode"u8); - writer.WriteStringValue(NetworkMode.Value.ToString()); - } - if (Optional.IsDefined(NetworkDataplane)) - { - writer.WritePropertyName("networkDataplane"u8); - writer.WriteStringValue(NetworkDataplane.Value.ToString()); - } - if (Optional.IsDefined(PodCidr)) - { - writer.WritePropertyName("podCidr"u8); - writer.WriteStringValue(PodCidr); - } - if (Optional.IsDefined(ServiceCidr)) - { - writer.WritePropertyName("serviceCidr"u8); - writer.WriteStringValue(ServiceCidr); - } - if (Optional.IsDefined(DnsServiceIP)) - { - writer.WritePropertyName("dnsServiceIP"u8); - writer.WriteStringValue(DnsServiceIP); - } - if (Optional.IsDefined(OutboundType)) - { - writer.WritePropertyName("outboundType"u8); - writer.WriteStringValue(OutboundType.Value.ToString()); - } - if (Optional.IsDefined(LoadBalancerSku)) - { - writer.WritePropertyName("loadBalancerSku"u8); - writer.WriteStringValue(LoadBalancerSku.Value.ToString()); - } - if (Optional.IsDefined(LoadBalancerProfile)) - { - writer.WritePropertyName("loadBalancerProfile"u8); - writer.WriteObjectValue(LoadBalancerProfile); - } - if (Optional.IsDefined(NatGatewayProfile)) - { - writer.WritePropertyName("natGatewayProfile"u8); - writer.WriteObjectValue(NatGatewayProfile); - } - if (Optional.IsCollectionDefined(PodCidrs)) - { - writer.WritePropertyName("podCidrs"u8); - writer.WriteStartArray(); - foreach (var item in PodCidrs) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(ServiceCidrs)) - { - writer.WritePropertyName("serviceCidrs"u8); - writer.WriteStartArray(); - foreach (var item in ServiceCidrs) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(IPFamilies)) - { - writer.WritePropertyName("ipFamilies"u8); - writer.WriteStartArray(); - foreach (var item in IPFamilies) - { - writer.WriteStringValue(item.ToString()); - } - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContainerServiceNetworkProfile 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(ContainerServiceNetworkProfile)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceNetworkProfile(document.RootElement, options); - } - - internal static ContainerServiceNetworkProfile DeserializeContainerServiceNetworkProfile(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional networkPlugin = default; - Optional networkPluginMode = default; - Optional networkPolicy = default; - Optional networkMode = default; - Optional networkDataplane = default; - Optional podCidr = default; - Optional serviceCidr = default; - Optional dnsServiceIP = default; - Optional outboundType = default; - Optional loadBalancerSku = default; - Optional loadBalancerProfile = default; - Optional natGatewayProfile = default; - Optional> podCidrs = default; - Optional> serviceCidrs = default; - Optional> ipFamilies = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("networkPlugin"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - networkPlugin = new ContainerServiceNetworkPlugin(property.Value.GetString()); - continue; - } - if (property.NameEquals("networkPluginMode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - networkPluginMode = new ContainerServiceNetworkPluginMode(property.Value.GetString()); - continue; - } - if (property.NameEquals("networkPolicy"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - networkPolicy = new ContainerServiceNetworkPolicy(property.Value.GetString()); - continue; - } - if (property.NameEquals("networkMode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - networkMode = new ContainerServiceNetworkMode(property.Value.GetString()); - continue; - } - if (property.NameEquals("networkDataplane"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - networkDataplane = new NetworkDataplane(property.Value.GetString()); - continue; - } - if (property.NameEquals("podCidr"u8)) - { - podCidr = property.Value.GetString(); - continue; - } - if (property.NameEquals("serviceCidr"u8)) - { - serviceCidr = property.Value.GetString(); - continue; - } - if (property.NameEquals("dnsServiceIP"u8)) - { - dnsServiceIP = property.Value.GetString(); - continue; - } - if (property.NameEquals("outboundType"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - outboundType = new ContainerServiceOutboundType(property.Value.GetString()); - continue; - } - if (property.NameEquals("loadBalancerSku"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - loadBalancerSku = new ContainerServiceLoadBalancerSku(property.Value.GetString()); - continue; - } - if (property.NameEquals("loadBalancerProfile"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - loadBalancerProfile = ManagedClusterLoadBalancerProfile.DeserializeManagedClusterLoadBalancerProfile(property.Value); - continue; - } - if (property.NameEquals("natGatewayProfile"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - natGatewayProfile = ManagedClusterNatGatewayProfile.DeserializeManagedClusterNatGatewayProfile(property.Value); - continue; - } - if (property.NameEquals("podCidrs"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - podCidrs = array; - continue; - } - if (property.NameEquals("serviceCidrs"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - serviceCidrs = array; - continue; - } - if (property.NameEquals("ipFamilies"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(new IPFamily(item.GetString())); - } - ipFamilies = array; - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ContainerServiceNetworkProfile(Optional.ToNullable(networkPlugin), Optional.ToNullable(networkPluginMode), Optional.ToNullable(networkPolicy), Optional.ToNullable(networkMode), Optional.ToNullable(networkDataplane), podCidr.Value, serviceCidr.Value, dnsServiceIP.Value, Optional.ToNullable(outboundType), Optional.ToNullable(loadBalancerSku), loadBalancerProfile.Value, natGatewayProfile.Value, Optional.ToList(podCidrs), Optional.ToList(serviceCidrs), Optional.ToList(ipFamilies), 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(ContainerServiceNetworkProfile)} does not support '{options.Format}' format."); - } - } - - ContainerServiceNetworkProfile 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); - return DeserializeContainerServiceNetworkProfile(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContainerServiceNetworkProfile)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkProfile.cs deleted file mode 100644 index 1dbea759df9ac..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkProfile.cs +++ /dev/null @@ -1,125 +0,0 @@ -// 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.ContainerService.Models -{ - /// Profile of network configuration. - public partial class ContainerServiceNetworkProfile - { - /// - /// 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 ContainerServiceNetworkProfile() - { - PodCidrs = new ChangeTrackingList(); - ServiceCidrs = new ChangeTrackingList(); - IPFamilies = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Network plugin used for building the Kubernetes network. - /// The mode the network plugin should use. - /// Network policy used for building the Kubernetes network. - /// This cannot be specified if networkPlugin is anything other than 'azure'. - /// Network dataplane used in the Kubernetes cluster. - /// A CIDR notation IP range from which to assign pod IPs when kubenet is used. - /// A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. - /// An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr. - /// This can only be set at cluster creation time and cannot be changed later. For more information see [egress outbound type](https://docs.microsoft.com/azure/aks/egress-outboundtype). - /// The default is 'standard'. See [Azure Load Balancer SKUs](https://docs.microsoft.com/azure/load-balancer/skus) for more information about the differences between load balancer SKUs. - /// Profile of the cluster load balancer. - /// Profile of the cluster NAT gateway. - /// One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. - /// One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. They must not overlap with any Subnet IP ranges. - /// IP families are used to determine single-stack or dual-stack clusters. For single-stack, the expected value is IPv4. For dual-stack, the expected values are IPv4 and IPv6. - /// Keeps track of any properties unknown to the library. - internal ContainerServiceNetworkProfile(ContainerServiceNetworkPlugin? networkPlugin, ContainerServiceNetworkPluginMode? networkPluginMode, ContainerServiceNetworkPolicy? networkPolicy, ContainerServiceNetworkMode? networkMode, NetworkDataplane? networkDataplane, string podCidr, string serviceCidr, string dnsServiceIP, ContainerServiceOutboundType? outboundType, ContainerServiceLoadBalancerSku? loadBalancerSku, ManagedClusterLoadBalancerProfile loadBalancerProfile, ManagedClusterNatGatewayProfile natGatewayProfile, IList podCidrs, IList serviceCidrs, IList ipFamilies, IDictionary serializedAdditionalRawData) - { - NetworkPlugin = networkPlugin; - NetworkPluginMode = networkPluginMode; - NetworkPolicy = networkPolicy; - NetworkMode = networkMode; - NetworkDataplane = networkDataplane; - PodCidr = podCidr; - ServiceCidr = serviceCidr; - DnsServiceIP = dnsServiceIP; - OutboundType = outboundType; - LoadBalancerSku = loadBalancerSku; - LoadBalancerProfile = loadBalancerProfile; - NatGatewayProfile = natGatewayProfile; - PodCidrs = podCidrs; - ServiceCidrs = serviceCidrs; - IPFamilies = ipFamilies; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Network plugin used for building the Kubernetes network. - public ContainerServiceNetworkPlugin? NetworkPlugin { get; set; } - /// The mode the network plugin should use. - public ContainerServiceNetworkPluginMode? NetworkPluginMode { get; set; } - /// Network policy used for building the Kubernetes network. - public ContainerServiceNetworkPolicy? NetworkPolicy { get; set; } - /// This cannot be specified if networkPlugin is anything other than 'azure'. - public ContainerServiceNetworkMode? NetworkMode { get; set; } - /// Network dataplane used in the Kubernetes cluster. - public NetworkDataplane? NetworkDataplane { get; set; } - /// A CIDR notation IP range from which to assign pod IPs when kubenet is used. - public string PodCidr { get; set; } - /// A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. - public string ServiceCidr { get; set; } - /// An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr. - public string DnsServiceIP { get; set; } - /// This can only be set at cluster creation time and cannot be changed later. For more information see [egress outbound type](https://docs.microsoft.com/azure/aks/egress-outboundtype). - public ContainerServiceOutboundType? OutboundType { get; set; } - /// The default is 'standard'. See [Azure Load Balancer SKUs](https://docs.microsoft.com/azure/load-balancer/skus) for more information about the differences between load balancer SKUs. - public ContainerServiceLoadBalancerSku? LoadBalancerSku { get; set; } - /// Profile of the cluster load balancer. - public ManagedClusterLoadBalancerProfile LoadBalancerProfile { get; set; } - /// Profile of the cluster NAT gateway. - public ManagedClusterNatGatewayProfile NatGatewayProfile { get; set; } - /// One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. - public IList PodCidrs { get; } - /// One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. They must not overlap with any Subnet IP ranges. - public IList ServiceCidrs { get; } - /// IP families are used to determine single-stack or dual-stack clusters. For single-stack, the expected value is IPv4. For dual-stack, the expected values are IPv4 and IPv6. - public IList IPFamilies { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSDiskType.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSDiskType.cs deleted file mode 100644 index 40add4a71ff82..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSDiskType.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). - public readonly partial struct ContainerServiceOSDiskType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ContainerServiceOSDiskType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ManagedValue = "Managed"; - private const string EphemeralValue = "Ephemeral"; - - /// Azure replicates the operating system disk for a virtual machine to Azure storage to avoid data loss should the VM need to be relocated to another host. Since containers aren't designed to have local state persisted, this behavior offers limited value while providing some drawbacks, including slower node provisioning and higher read/write latency. - public static ContainerServiceOSDiskType Managed { get; } = new ContainerServiceOSDiskType(ManagedValue); - /// Ephemeral OS disks are stored only on the host machine, just like a temporary disk. This provides lower read/write latency, along with faster node scaling and cluster upgrades. - public static ContainerServiceOSDiskType Ephemeral { get; } = new ContainerServiceOSDiskType(EphemeralValue); - /// Determines if two values are the same. - public static bool operator ==(ContainerServiceOSDiskType left, ContainerServiceOSDiskType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ContainerServiceOSDiskType left, ContainerServiceOSDiskType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ContainerServiceOSDiskType(string value) => new ContainerServiceOSDiskType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ContainerServiceOSDiskType other && Equals(other); - /// - public bool Equals(ContainerServiceOSDiskType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSOptionProperty.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSOptionProperty.Serialization.cs deleted file mode 100644 index 1d5536157b7ff..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSOptionProperty.Serialization.cs +++ /dev/null @@ -1,127 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class ContainerServiceOSOptionProperty : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceOSOptionProperty)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("os-type"u8); - writer.WriteStringValue(OSType); - writer.WritePropertyName("enable-fips-image"u8); - writer.WriteBooleanValue(EnableFipsImage); - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContainerServiceOSOptionProperty 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(ContainerServiceOSOptionProperty)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceOSOptionProperty(document.RootElement, options); - } - - internal static ContainerServiceOSOptionProperty DeserializeContainerServiceOSOptionProperty(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string osType = default; - bool enableFipsImage = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("os-type"u8)) - { - osType = property.Value.GetString(); - continue; - } - if (property.NameEquals("enable-fips-image"u8)) - { - enableFipsImage = property.Value.GetBoolean(); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ContainerServiceOSOptionProperty(osType, enableFipsImage, 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(ContainerServiceOSOptionProperty)} does not support '{options.Format}' format."); - } - } - - ContainerServiceOSOptionProperty 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); - return DeserializeContainerServiceOSOptionProperty(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContainerServiceOSOptionProperty)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSOptionProperty.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSOptionProperty.cs deleted file mode 100644 index e7e495c1932a0..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSOptionProperty.cs +++ /dev/null @@ -1,82 +0,0 @@ -// 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.ContainerService.Models -{ - /// OS option property. - public partial class ContainerServiceOSOptionProperty - { - /// - /// 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 OS type. - /// Whether the image is FIPS-enabled. - /// is null. - internal ContainerServiceOSOptionProperty(string osType, bool enableFipsImage) - { - Argument.AssertNotNull(osType, nameof(osType)); - - OSType = osType; - EnableFipsImage = enableFipsImage; - } - - /// Initializes a new instance of . - /// The OS type. - /// Whether the image is FIPS-enabled. - /// Keeps track of any properties unknown to the library. - internal ContainerServiceOSOptionProperty(string osType, bool enableFipsImage, IDictionary serializedAdditionalRawData) - { - OSType = osType; - EnableFipsImage = enableFipsImage; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ContainerServiceOSOptionProperty() - { - } - - /// The OS type. - public string OSType { get; } - /// Whether the image is FIPS-enabled. - public bool EnableFipsImage { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSSku.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSSku.cs deleted file mode 100644 index 3a7ce4443e0c8..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSSku.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows. - public readonly partial struct ContainerServiceOSSku : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ContainerServiceOSSku(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string UbuntuValue = "Ubuntu"; - private const string AzureLinuxValue = "AzureLinux"; - private const string CblMarinerValue = "CBLMariner"; - private const string Windows2019Value = "Windows2019"; - private const string Windows2022Value = "Windows2022"; - - /// Use Ubuntu as the OS for node images. - public static ContainerServiceOSSku Ubuntu { get; } = new ContainerServiceOSSku(UbuntuValue); - /// Use AzureLinux as the OS for node images. Azure Linux is a container-optimized Linux distro built by Microsoft, visit https://aka.ms/azurelinux for more information. - public static ContainerServiceOSSku AzureLinux { get; } = new ContainerServiceOSSku(AzureLinuxValue); - /// Deprecated OSSKU. Microsoft recommends that new deployments choose 'AzureLinux' instead. - public static ContainerServiceOSSku CblMariner { get; } = new ContainerServiceOSSku(CblMarinerValue); - /// Use Windows2019 as the OS for node images. Unsupported for system node pools. Windows2019 only supports Windows2019 containers; it cannot run Windows2022 containers and vice versa. - public static ContainerServiceOSSku Windows2019 { get; } = new ContainerServiceOSSku(Windows2019Value); - /// Use Windows2022 as the OS for node images. Unsupported for system node pools. Windows2022 only supports Windows2022 containers; it cannot run Windows2019 containers and vice versa. - public static ContainerServiceOSSku Windows2022 { get; } = new ContainerServiceOSSku(Windows2022Value); - /// Determines if two values are the same. - public static bool operator ==(ContainerServiceOSSku left, ContainerServiceOSSku right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ContainerServiceOSSku left, ContainerServiceOSSku right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ContainerServiceOSSku(string value) => new ContainerServiceOSSku(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ContainerServiceOSSku other && Equals(other); - /// - public bool Equals(ContainerServiceOSSku other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSType.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSType.cs deleted file mode 100644 index c0a7b0d1d1a1a..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSType.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The operating system type. The default is Linux. - public readonly partial struct ContainerServiceOSType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ContainerServiceOSType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string LinuxValue = "Linux"; - private const string WindowsValue = "Windows"; - - /// Use Linux. - public static ContainerServiceOSType Linux { get; } = new ContainerServiceOSType(LinuxValue); - /// Use Windows. - public static ContainerServiceOSType Windows { get; } = new ContainerServiceOSType(WindowsValue); - /// Determines if two values are the same. - public static bool operator ==(ContainerServiceOSType left, ContainerServiceOSType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ContainerServiceOSType left, ContainerServiceOSType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ContainerServiceOSType(string value) => new ContainerServiceOSType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ContainerServiceOSType other && Equals(other); - /// - public bool Equals(ContainerServiceOSType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOutboundEnvironmentEndpoint.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOutboundEnvironmentEndpoint.Serialization.cs deleted file mode 100644 index 3bf4cb8095563..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOutboundEnvironmentEndpoint.Serialization.cs +++ /dev/null @@ -1,147 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class ContainerServiceOutboundEnvironmentEndpoint : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceOutboundEnvironmentEndpoint)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Category)) - { - writer.WritePropertyName("category"u8); - writer.WriteStringValue(Category); - } - if (Optional.IsCollectionDefined(Endpoints)) - { - writer.WritePropertyName("endpoints"u8); - writer.WriteStartArray(); - foreach (var item in Endpoints) - { - writer.WriteObjectValue(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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContainerServiceOutboundEnvironmentEndpoint 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(ContainerServiceOutboundEnvironmentEndpoint)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceOutboundEnvironmentEndpoint(document.RootElement, options); - } - - internal static ContainerServiceOutboundEnvironmentEndpoint DeserializeContainerServiceOutboundEnvironmentEndpoint(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional category = default; - Optional> endpoints = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("category"u8)) - { - category = property.Value.GetString(); - continue; - } - if (property.NameEquals("endpoints"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ContainerServiceEndpointDependency.DeserializeContainerServiceEndpointDependency(item)); - } - endpoints = array; - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ContainerServiceOutboundEnvironmentEndpoint(category.Value, Optional.ToList(endpoints), 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(ContainerServiceOutboundEnvironmentEndpoint)} does not support '{options.Format}' format."); - } - } - - ContainerServiceOutboundEnvironmentEndpoint 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); - return DeserializeContainerServiceOutboundEnvironmentEndpoint(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContainerServiceOutboundEnvironmentEndpoint)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOutboundEnvironmentEndpoint.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOutboundEnvironmentEndpoint.cs deleted file mode 100644 index 8fc8b0ca631d2..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOutboundEnvironmentEndpoint.cs +++ /dev/null @@ -1,71 +0,0 @@ -// 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.ContainerService.Models -{ - /// Egress endpoints which AKS agent nodes connect to for common purpose. - public partial class ContainerServiceOutboundEnvironmentEndpoint - { - /// - /// 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 ContainerServiceOutboundEnvironmentEndpoint() - { - Endpoints = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// The category of endpoints accessed by the AKS agent node, e.g. azure-resource-management, apiserver, etc. - /// The endpoints that AKS agent nodes connect to. - /// Keeps track of any properties unknown to the library. - internal ContainerServiceOutboundEnvironmentEndpoint(string category, IReadOnlyList endpoints, IDictionary serializedAdditionalRawData) - { - Category = category; - Endpoints = endpoints; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The category of endpoints accessed by the AKS agent node, e.g. azure-resource-management, apiserver, etc. - public string Category { get; } - /// The endpoints that AKS agent nodes connect to. - public IReadOnlyList Endpoints { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOutboundType.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOutboundType.cs deleted file mode 100644 index 3f91556f11655..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOutboundType.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// This can only be set at cluster creation time and cannot be changed later. For more information see [egress outbound type](https://docs.microsoft.com/azure/aks/egress-outboundtype). - public readonly partial struct ContainerServiceOutboundType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ContainerServiceOutboundType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string LoadBalancerValue = "loadBalancer"; - private const string UserDefinedRoutingValue = "userDefinedRouting"; - private const string ManagedNatGatewayValue = "managedNATGateway"; - private const string UserAssignedNatGatewayValue = "userAssignedNATGateway"; - - /// The load balancer is used for egress through an AKS assigned public IP. This supports Kubernetes services of type 'loadBalancer'. For more information see [outbound type loadbalancer](https://docs.microsoft.com/azure/aks/egress-outboundtype#outbound-type-of-loadbalancer). - public static ContainerServiceOutboundType LoadBalancer { get; } = new ContainerServiceOutboundType(LoadBalancerValue); - /// Egress paths must be defined by the user. This is an advanced scenario and requires proper network configuration. For more information see [outbound type userDefinedRouting](https://docs.microsoft.com/azure/aks/egress-outboundtype#outbound-type-of-userdefinedrouting). - public static ContainerServiceOutboundType UserDefinedRouting { get; } = new ContainerServiceOutboundType(UserDefinedRoutingValue); - /// The AKS-managed NAT gateway is used for egress. - public static ContainerServiceOutboundType ManagedNatGateway { get; } = new ContainerServiceOutboundType(ManagedNatGatewayValue); - /// The user-assigned NAT gateway associated to the cluster subnet is used for egress. This is an advanced scenario and requires proper network configuration. - public static ContainerServiceOutboundType UserAssignedNatGateway { get; } = new ContainerServiceOutboundType(UserAssignedNatGatewayValue); - /// Determines if two values are the same. - public static bool operator ==(ContainerServiceOutboundType left, ContainerServiceOutboundType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ContainerServiceOutboundType left, ContainerServiceOutboundType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ContainerServiceOutboundType(string value) => new ContainerServiceOutboundType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ContainerServiceOutboundType other && Equals(other); - /// - public bool Equals(ContainerServiceOutboundType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateEndpointConnectionListResult.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateEndpointConnectionListResult.Serialization.cs deleted file mode 100644 index 4ab39929fd76a..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateEndpointConnectionListResult.Serialization.cs +++ /dev/null @@ -1,137 +0,0 @@ -// 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.ContainerService; - -namespace Azure.ResourceManager.ContainerService.Models -{ - internal partial class ContainerServicePrivateEndpointConnectionListResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServicePrivateEndpointConnectionListResult)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContainerServicePrivateEndpointConnectionListResult 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(ContainerServicePrivateEndpointConnectionListResult)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServicePrivateEndpointConnectionListResult(document.RootElement, options); - } - - internal static ContainerServicePrivateEndpointConnectionListResult DeserializeContainerServicePrivateEndpointConnectionListResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ContainerServicePrivateEndpointConnectionData.DeserializeContainerServicePrivateEndpointConnectionData(item)); - } - value = array; - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ContainerServicePrivateEndpointConnectionListResult(Optional.ToList(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(ContainerServicePrivateEndpointConnectionListResult)} does not support '{options.Format}' format."); - } - } - - ContainerServicePrivateEndpointConnectionListResult 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); - return DeserializeContainerServicePrivateEndpointConnectionListResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContainerServicePrivateEndpointConnectionListResult)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateEndpointConnectionListResult.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateEndpointConnectionListResult.cs deleted file mode 100644 index a1309f3dc500c..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateEndpointConnectionListResult.cs +++ /dev/null @@ -1,68 +0,0 @@ -// 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.ContainerService; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// A list of private endpoint connections. - internal partial class ContainerServicePrivateEndpointConnectionListResult - { - /// - /// 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 ContainerServicePrivateEndpointConnectionListResult() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// The collection value. - /// Keeps track of any properties unknown to the library. - internal ContainerServicePrivateEndpointConnectionListResult(IReadOnlyList value, IDictionary serializedAdditionalRawData) - { - Value = value; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The collection value. - public IReadOnlyList Value { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateEndpointConnectionProvisioningState.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateEndpointConnectionProvisioningState.cs deleted file mode 100644 index cfb906dbdb7ad..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateEndpointConnectionProvisioningState.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The current provisioning state. - public readonly partial struct ContainerServicePrivateEndpointConnectionProvisioningState : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ContainerServicePrivateEndpointConnectionProvisioningState(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string CanceledValue = "Canceled"; - private const string CreatingValue = "Creating"; - private const string DeletingValue = "Deleting"; - private const string FailedValue = "Failed"; - private const string SucceededValue = "Succeeded"; - - /// Canceled. - public static ContainerServicePrivateEndpointConnectionProvisioningState Canceled { get; } = new ContainerServicePrivateEndpointConnectionProvisioningState(CanceledValue); - /// Creating. - public static ContainerServicePrivateEndpointConnectionProvisioningState Creating { get; } = new ContainerServicePrivateEndpointConnectionProvisioningState(CreatingValue); - /// Deleting. - public static ContainerServicePrivateEndpointConnectionProvisioningState Deleting { get; } = new ContainerServicePrivateEndpointConnectionProvisioningState(DeletingValue); - /// Failed. - public static ContainerServicePrivateEndpointConnectionProvisioningState Failed { get; } = new ContainerServicePrivateEndpointConnectionProvisioningState(FailedValue); - /// Succeeded. - public static ContainerServicePrivateEndpointConnectionProvisioningState Succeeded { get; } = new ContainerServicePrivateEndpointConnectionProvisioningState(SucceededValue); - /// Determines if two values are the same. - public static bool operator ==(ContainerServicePrivateEndpointConnectionProvisioningState left, ContainerServicePrivateEndpointConnectionProvisioningState right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ContainerServicePrivateEndpointConnectionProvisioningState left, ContainerServicePrivateEndpointConnectionProvisioningState right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ContainerServicePrivateEndpointConnectionProvisioningState(string value) => new ContainerServicePrivateEndpointConnectionProvisioningState(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ContainerServicePrivateEndpointConnectionProvisioningState other && Equals(other); - /// - public bool Equals(ContainerServicePrivateEndpointConnectionProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkResourceData.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkResourceData.Serialization.cs deleted file mode 100644 index ffa35a118221a..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkResourceData.Serialization.cs +++ /dev/null @@ -1,203 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class ContainerServicePrivateLinkResourceData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServicePrivateLinkResourceData)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Id)) - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (Optional.IsDefined(ResourceType)) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType.Value); - } - if (Optional.IsDefined(GroupId)) - { - writer.WritePropertyName("groupId"u8); - writer.WriteStringValue(GroupId); - } - if (Optional.IsCollectionDefined(RequiredMembers)) - { - writer.WritePropertyName("requiredMembers"u8); - writer.WriteStartArray(); - foreach (var item in RequiredMembers) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsDefined(PrivateLinkServiceId)) - { - writer.WritePropertyName("privateLinkServiceID"u8); - writer.WriteStringValue(PrivateLinkServiceId); - } - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContainerServicePrivateLinkResourceData 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(ContainerServicePrivateLinkResourceData)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServicePrivateLinkResourceData(document.RootElement, options); - } - - internal static ContainerServicePrivateLinkResourceData DeserializeContainerServicePrivateLinkResourceData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional id = default; - Optional name = default; - Optional type = default; - Optional groupId = default; - Optional> requiredMembers = default; - Optional privateLinkServiceId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("groupId"u8)) - { - groupId = property.Value.GetString(); - continue; - } - if (property.NameEquals("requiredMembers"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - requiredMembers = array; - continue; - } - if (property.NameEquals("privateLinkServiceID"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - privateLinkServiceId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ContainerServicePrivateLinkResourceData(id.Value, name.Value, Optional.ToNullable(type), groupId.Value, Optional.ToList(requiredMembers), privateLinkServiceId.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(ContainerServicePrivateLinkResourceData)} does not support '{options.Format}' format."); - } - } - - ContainerServicePrivateLinkResourceData 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); - return DeserializeContainerServicePrivateLinkResourceData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContainerServicePrivateLinkResourceData)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkResourceData.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkResourceData.cs deleted file mode 100644 index 8793a4482917f..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkResourceData.cs +++ /dev/null @@ -1,87 +0,0 @@ -// 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.ContainerService.Models -{ - /// A private link resource. - public partial class ContainerServicePrivateLinkResourceData - { - /// - /// 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 ContainerServicePrivateLinkResourceData() - { - RequiredMembers = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// The ID of the private link resource. - /// The name of the private link resource. - /// The resource type. - /// The group ID of the resource. - /// The RequiredMembers of the resource. - /// The private link service ID of the resource, this field is exposed only to NRP internally. - /// Keeps track of any properties unknown to the library. - internal ContainerServicePrivateLinkResourceData(ResourceIdentifier id, string name, ResourceType? resourceType, string groupId, IList requiredMembers, ResourceIdentifier privateLinkServiceId, IDictionary serializedAdditionalRawData) - { - Id = id; - Name = name; - ResourceType = resourceType; - GroupId = groupId; - RequiredMembers = requiredMembers; - PrivateLinkServiceId = privateLinkServiceId; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The ID of the private link resource. - public ResourceIdentifier Id { get; set; } - /// The name of the private link resource. - public string Name { get; set; } - /// The resource type. - public ResourceType? ResourceType { get; set; } - /// The group ID of the resource. - public string GroupId { get; set; } - /// The RequiredMembers of the resource. - public IList RequiredMembers { get; } - /// The private link service ID of the resource, this field is exposed only to NRP internally. - public ResourceIdentifier PrivateLinkServiceId { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkResourcesListResult.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkResourcesListResult.Serialization.cs deleted file mode 100644 index fcb4f53a6fc8f..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkResourcesListResult.Serialization.cs +++ /dev/null @@ -1,136 +0,0 @@ -// 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.ContainerService.Models -{ - internal partial class ContainerServicePrivateLinkResourcesListResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServicePrivateLinkResourcesListResult)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContainerServicePrivateLinkResourcesListResult 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(ContainerServicePrivateLinkResourcesListResult)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServicePrivateLinkResourcesListResult(document.RootElement, options); - } - - internal static ContainerServicePrivateLinkResourcesListResult DeserializeContainerServicePrivateLinkResourcesListResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ContainerServicePrivateLinkResourceData.DeserializeContainerServicePrivateLinkResourceData(item)); - } - value = array; - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ContainerServicePrivateLinkResourcesListResult(Optional.ToList(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(ContainerServicePrivateLinkResourcesListResult)} does not support '{options.Format}' format."); - } - } - - ContainerServicePrivateLinkResourcesListResult 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); - return DeserializeContainerServicePrivateLinkResourcesListResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContainerServicePrivateLinkResourcesListResult)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkResourcesListResult.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkResourcesListResult.cs deleted file mode 100644 index 349cca4b64848..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkResourcesListResult.cs +++ /dev/null @@ -1,67 +0,0 @@ -// 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.ContainerService.Models -{ - /// A list of private link resources. - internal partial class ContainerServicePrivateLinkResourcesListResult - { - /// - /// 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 ContainerServicePrivateLinkResourcesListResult() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// The collection value. - /// Keeps track of any properties unknown to the library. - internal ContainerServicePrivateLinkResourcesListResult(IReadOnlyList value, IDictionary serializedAdditionalRawData) - { - Value = value; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The collection value. - public IReadOnlyList Value { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkServiceConnectionState.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkServiceConnectionState.Serialization.cs deleted file mode 100644 index d586ebceda44b..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkServiceConnectionState.Serialization.cs +++ /dev/null @@ -1,137 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class ContainerServicePrivateLinkServiceConnectionState : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServicePrivateLinkServiceConnectionState)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Status)) - { - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status.Value.ToString()); - } - if (Optional.IsDefined(Description)) - { - writer.WritePropertyName("description"u8); - writer.WriteStringValue(Description); - } - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContainerServicePrivateLinkServiceConnectionState 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(ContainerServicePrivateLinkServiceConnectionState)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServicePrivateLinkServiceConnectionState(document.RootElement, options); - } - - internal static ContainerServicePrivateLinkServiceConnectionState DeserializeContainerServicePrivateLinkServiceConnectionState(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional status = default; - Optional description = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("status"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - status = new ContainerServicePrivateLinkServiceConnectionStatus(property.Value.GetString()); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ContainerServicePrivateLinkServiceConnectionState(Optional.ToNullable(status), description.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(ContainerServicePrivateLinkServiceConnectionState)} does not support '{options.Format}' format."); - } - } - - ContainerServicePrivateLinkServiceConnectionState 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); - return DeserializeContainerServicePrivateLinkServiceConnectionState(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContainerServicePrivateLinkServiceConnectionState)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkServiceConnectionStatus.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkServiceConnectionStatus.cs deleted file mode 100644 index 12fcac73b7e6e..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkServiceConnectionStatus.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The private link service connection status. - public readonly partial struct ContainerServicePrivateLinkServiceConnectionStatus : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ContainerServicePrivateLinkServiceConnectionStatus(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string PendingValue = "Pending"; - private const string ApprovedValue = "Approved"; - private const string RejectedValue = "Rejected"; - private const string DisconnectedValue = "Disconnected"; - - /// Pending. - public static ContainerServicePrivateLinkServiceConnectionStatus Pending { get; } = new ContainerServicePrivateLinkServiceConnectionStatus(PendingValue); - /// Approved. - public static ContainerServicePrivateLinkServiceConnectionStatus Approved { get; } = new ContainerServicePrivateLinkServiceConnectionStatus(ApprovedValue); - /// Rejected. - public static ContainerServicePrivateLinkServiceConnectionStatus Rejected { get; } = new ContainerServicePrivateLinkServiceConnectionStatus(RejectedValue); - /// Disconnected. - public static ContainerServicePrivateLinkServiceConnectionStatus Disconnected { get; } = new ContainerServicePrivateLinkServiceConnectionStatus(DisconnectedValue); - /// Determines if two values are the same. - public static bool operator ==(ContainerServicePrivateLinkServiceConnectionStatus left, ContainerServicePrivateLinkServiceConnectionStatus right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ContainerServicePrivateLinkServiceConnectionStatus left, ContainerServicePrivateLinkServiceConnectionStatus right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ContainerServicePrivateLinkServiceConnectionStatus(string value) => new ContainerServicePrivateLinkServiceConnectionStatus(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ContainerServicePrivateLinkServiceConnectionStatus other && Equals(other); - /// - public bool Equals(ContainerServicePrivateLinkServiceConnectionStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePublicNetworkAccess.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePublicNetworkAccess.cs deleted file mode 100644 index 0c27b37d2911e..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePublicNetworkAccess.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Allow or deny public network access for AKS. - public readonly partial struct ContainerServicePublicNetworkAccess : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ContainerServicePublicNetworkAccess(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string EnabledValue = "Enabled"; - private const string DisabledValue = "Disabled"; - - /// Enabled. - public static ContainerServicePublicNetworkAccess Enabled { get; } = new ContainerServicePublicNetworkAccess(EnabledValue); - /// Disabled. - public static ContainerServicePublicNetworkAccess Disabled { get; } = new ContainerServicePublicNetworkAccess(DisabledValue); - /// Determines if two values are the same. - public static bool operator ==(ContainerServicePublicNetworkAccess left, ContainerServicePublicNetworkAccess right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ContainerServicePublicNetworkAccess left, ContainerServicePublicNetworkAccess right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ContainerServicePublicNetworkAccess(string value) => new ContainerServicePublicNetworkAccess(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ContainerServicePublicNetworkAccess other && Equals(other); - /// - public bool Equals(ContainerServicePublicNetworkAccess other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceSshConfiguration.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceSshConfiguration.Serialization.cs deleted file mode 100644 index 1cc121f86e78e..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceSshConfiguration.Serialization.cs +++ /dev/null @@ -1,129 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class ContainerServiceSshConfiguration : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceSshConfiguration)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("publicKeys"u8); - writer.WriteStartArray(); - foreach (var item in PublicKeys) - { - writer.WriteObjectValue(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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContainerServiceSshConfiguration 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(ContainerServiceSshConfiguration)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceSshConfiguration(document.RootElement, options); - } - - internal static ContainerServiceSshConfiguration DeserializeContainerServiceSshConfiguration(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IList publicKeys = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("publicKeys"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ContainerServiceSshPublicKey.DeserializeContainerServiceSshPublicKey(item)); - } - publicKeys = array; - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ContainerServiceSshConfiguration(publicKeys, 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(ContainerServiceSshConfiguration)} does not support '{options.Format}' format."); - } - } - - ContainerServiceSshConfiguration 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); - return DeserializeContainerServiceSshConfiguration(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContainerServiceSshConfiguration)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceStateCode.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceStateCode.cs deleted file mode 100644 index af6c4d9b608c6..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceStateCode.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Tells whether the cluster is Running or Stopped. - public readonly partial struct ContainerServiceStateCode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ContainerServiceStateCode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string RunningValue = "Running"; - private const string StoppedValue = "Stopped"; - - /// The cluster is running. - public static ContainerServiceStateCode Running { get; } = new ContainerServiceStateCode(RunningValue); - /// The cluster is stopped. - public static ContainerServiceStateCode Stopped { get; } = new ContainerServiceStateCode(StoppedValue); - /// Determines if two values are the same. - public static bool operator ==(ContainerServiceStateCode left, ContainerServiceStateCode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ContainerServiceStateCode left, ContainerServiceStateCode right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ContainerServiceStateCode(string value) => new ContainerServiceStateCode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ContainerServiceStateCode other && Equals(other); - /// - public bool Equals(ContainerServiceStateCode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTimeInWeek.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTimeInWeek.cs deleted file mode 100644 index 7c0c5b35e4207..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTimeInWeek.cs +++ /dev/null @@ -1,71 +0,0 @@ -// 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.ContainerService.Models -{ - /// Time in a week. - public partial class ContainerServiceTimeInWeek - { - /// - /// 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 ContainerServiceTimeInWeek() - { - HourSlots = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// The day of the week. - /// Each integer hour represents a time range beginning at 0m after the hour ending at the next hour (non-inclusive). 0 corresponds to 00:00 UTC, 23 corresponds to 23:00 UTC. Specifying [0, 1] means the 00:00 - 02:00 UTC time range. - /// Keeps track of any properties unknown to the library. - internal ContainerServiceTimeInWeek(ContainerServiceWeekDay? day, IList hourSlots, IDictionary serializedAdditionalRawData) - { - Day = day; - HourSlots = hourSlots; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The day of the week. - public ContainerServiceWeekDay? Day { get; set; } - /// Each integer hour represents a time range beginning at 0m after the hour ending at the next hour (non-inclusive). 0 corresponds to 00:00 UTC, 23 corresponds to 23:00 UTC. Specifying [0, 1] means the 00:00 - 02:00 UTC time range. - public IList HourSlots { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTimeSpan.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTimeSpan.cs deleted file mode 100644 index 0ac3eb2d86f27..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTimeSpan.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// For example, between 2021-05-25T13:00:00Z and 2021-05-25T14:00:00Z. - public partial class ContainerServiceTimeSpan - { - /// - /// 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 ContainerServiceTimeSpan() - { - } - - /// Initializes a new instance of . - /// The start of a time span. - /// The end of a time span. - /// Keeps track of any properties unknown to the library. - internal ContainerServiceTimeSpan(DateTimeOffset? startOn, DateTimeOffset? endOn, IDictionary serializedAdditionalRawData) - { - StartOn = startOn; - EndOn = endOn; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The start of a time span. - public DateTimeOffset? StartOn { get; set; } - /// The end of a time span. - public DateTimeOffset? EndOn { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTrustedAccessRole.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTrustedAccessRole.cs deleted file mode 100644 index fa7a703a1af90..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTrustedAccessRole.cs +++ /dev/null @@ -1,75 +0,0 @@ -// 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.ContainerService.Models -{ - /// Trusted access role definition. - public partial class ContainerServiceTrustedAccessRole - { - /// - /// 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 ContainerServiceTrustedAccessRole() - { - Rules = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Resource type of Azure resource. - /// Name of role, name is unique under a source resource type. - /// List of rules for the role. This maps to 'rules' property of [Kubernetes Cluster Role](https://kubernetes.io/docs/reference/kubernetes-api/authorization-resources/cluster-role-v1/#ClusterRole). - /// Keeps track of any properties unknown to the library. - internal ContainerServiceTrustedAccessRole(string sourceResourceType, string name, IReadOnlyList rules, IDictionary serializedAdditionalRawData) - { - SourceResourceType = sourceResourceType; - Name = name; - Rules = rules; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Resource type of Azure resource. - public string SourceResourceType { get; } - /// Name of role, name is unique under a source resource type. - public string Name { get; } - /// List of rules for the role. This maps to 'rules' property of [Kubernetes Cluster Role](https://kubernetes.io/docs/reference/kubernetes-api/authorization-resources/cluster-role-v1/#ClusterRole). - public IReadOnlyList Rules { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTrustedAccessRoleBindingProvisioningState.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTrustedAccessRoleBindingProvisioningState.cs deleted file mode 100644 index fb583bf9a1227..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTrustedAccessRoleBindingProvisioningState.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The current provisioning state of trusted access role binding. - public readonly partial struct ContainerServiceTrustedAccessRoleBindingProvisioningState : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ContainerServiceTrustedAccessRoleBindingProvisioningState(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string CanceledValue = "Canceled"; - private const string DeletingValue = "Deleting"; - private const string FailedValue = "Failed"; - private const string SucceededValue = "Succeeded"; - private const string UpdatingValue = "Updating"; - - /// Canceled. - public static ContainerServiceTrustedAccessRoleBindingProvisioningState Canceled { get; } = new ContainerServiceTrustedAccessRoleBindingProvisioningState(CanceledValue); - /// Deleting. - public static ContainerServiceTrustedAccessRoleBindingProvisioningState Deleting { get; } = new ContainerServiceTrustedAccessRoleBindingProvisioningState(DeletingValue); - /// Failed. - public static ContainerServiceTrustedAccessRoleBindingProvisioningState Failed { get; } = new ContainerServiceTrustedAccessRoleBindingProvisioningState(FailedValue); - /// Succeeded. - public static ContainerServiceTrustedAccessRoleBindingProvisioningState Succeeded { get; } = new ContainerServiceTrustedAccessRoleBindingProvisioningState(SucceededValue); - /// Updating. - public static ContainerServiceTrustedAccessRoleBindingProvisioningState Updating { get; } = new ContainerServiceTrustedAccessRoleBindingProvisioningState(UpdatingValue); - /// Determines if two values are the same. - public static bool operator ==(ContainerServiceTrustedAccessRoleBindingProvisioningState left, ContainerServiceTrustedAccessRoleBindingProvisioningState right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ContainerServiceTrustedAccessRoleBindingProvisioningState left, ContainerServiceTrustedAccessRoleBindingProvisioningState right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ContainerServiceTrustedAccessRoleBindingProvisioningState(string value) => new ContainerServiceTrustedAccessRoleBindingProvisioningState(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ContainerServiceTrustedAccessRoleBindingProvisioningState other && Equals(other); - /// - public bool Equals(ContainerServiceTrustedAccessRoleBindingProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTrustedAccessRoleRule.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTrustedAccessRoleRule.Serialization.cs deleted file mode 100644 index c43ec3c3dc603..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTrustedAccessRoleRule.Serialization.cs +++ /dev/null @@ -1,236 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class ContainerServiceTrustedAccessRoleRule : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceTrustedAccessRoleRule)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsCollectionDefined(Verbs)) - { - writer.WritePropertyName("verbs"u8); - writer.WriteStartArray(); - foreach (var item in Verbs) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsCollectionDefined(ApiGroups)) - { - writer.WritePropertyName("apiGroups"u8); - writer.WriteStartArray(); - foreach (var item in ApiGroups) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsCollectionDefined(Resources)) - { - writer.WritePropertyName("resources"u8); - writer.WriteStartArray(); - foreach (var item in Resources) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsCollectionDefined(ResourceNames)) - { - writer.WritePropertyName("resourceNames"u8); - writer.WriteStartArray(); - foreach (var item in ResourceNames) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsCollectionDefined(NonResourceUrls)) - { - writer.WritePropertyName("nonResourceURLs"u8); - writer.WriteStartArray(); - foreach (var item in NonResourceUrls) - { - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContainerServiceTrustedAccessRoleRule 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(ContainerServiceTrustedAccessRoleRule)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceTrustedAccessRoleRule(document.RootElement, options); - } - - internal static ContainerServiceTrustedAccessRoleRule DeserializeContainerServiceTrustedAccessRoleRule(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> verbs = default; - Optional> apiGroups = default; - Optional> resources = default; - Optional> resourceNames = default; - Optional> nonResourceUrls = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("verbs"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - verbs = array; - continue; - } - if (property.NameEquals("apiGroups"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - apiGroups = array; - continue; - } - if (property.NameEquals("resources"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - resources = array; - continue; - } - if (property.NameEquals("resourceNames"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - resourceNames = array; - continue; - } - if (property.NameEquals("nonResourceURLs"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - nonResourceUrls = array; - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ContainerServiceTrustedAccessRoleRule(Optional.ToList(verbs), Optional.ToList(apiGroups), Optional.ToList(resources), Optional.ToList(resourceNames), Optional.ToList(nonResourceUrls), 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(ContainerServiceTrustedAccessRoleRule)} does not support '{options.Format}' format."); - } - } - - ContainerServiceTrustedAccessRoleRule 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); - return DeserializeContainerServiceTrustedAccessRoleRule(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContainerServiceTrustedAccessRoleRule)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTrustedAccessRoleRule.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTrustedAccessRoleRule.cs deleted file mode 100644 index 565575e1c93c8..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTrustedAccessRoleRule.cs +++ /dev/null @@ -1,87 +0,0 @@ -// 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.ContainerService.Models -{ - /// Rule for trusted access role. - public partial class ContainerServiceTrustedAccessRoleRule - { - /// - /// 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 ContainerServiceTrustedAccessRoleRule() - { - Verbs = new ChangeTrackingList(); - ApiGroups = new ChangeTrackingList(); - Resources = new ChangeTrackingList(); - ResourceNames = new ChangeTrackingList(); - NonResourceUrls = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// List of allowed verbs. - /// List of allowed apiGroups. - /// List of allowed resources. - /// List of allowed names. - /// List of allowed nonResourceURLs. - /// Keeps track of any properties unknown to the library. - internal ContainerServiceTrustedAccessRoleRule(IReadOnlyList verbs, IReadOnlyList apiGroups, IReadOnlyList resources, IReadOnlyList resourceNames, IReadOnlyList nonResourceUrls, IDictionary serializedAdditionalRawData) - { - Verbs = verbs; - ApiGroups = apiGroups; - Resources = resources; - ResourceNames = resourceNames; - NonResourceUrls = nonResourceUrls; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// List of allowed verbs. - public IReadOnlyList Verbs { get; } - /// List of allowed apiGroups. - public IReadOnlyList ApiGroups { get; } - /// List of allowed resources. - public IReadOnlyList Resources { get; } - /// List of allowed names. - public IReadOnlyList ResourceNames { get; } - /// List of allowed nonResourceURLs. - public IReadOnlyList NonResourceUrls { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceUserAssignedIdentity.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceUserAssignedIdentity.Serialization.cs deleted file mode 100644 index 5a628fbba5347..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceUserAssignedIdentity.Serialization.cs +++ /dev/null @@ -1,156 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class ContainerServiceUserAssignedIdentity : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceUserAssignedIdentity)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(ResourceId)) - { - writer.WritePropertyName("resourceId"u8); - writer.WriteStringValue(ResourceId); - } - if (Optional.IsDefined(ClientId)) - { - writer.WritePropertyName("clientId"u8); - writer.WriteStringValue(ClientId.Value); - } - if (Optional.IsDefined(ObjectId)) - { - writer.WritePropertyName("objectId"u8); - writer.WriteStringValue(ObjectId.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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContainerServiceUserAssignedIdentity 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(ContainerServiceUserAssignedIdentity)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceUserAssignedIdentity(document.RootElement, options); - } - - internal static ContainerServiceUserAssignedIdentity DeserializeContainerServiceUserAssignedIdentity(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional resourceId = default; - Optional clientId = default; - Optional objectId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("resourceId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - resourceId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("clientId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - clientId = property.Value.GetGuid(); - continue; - } - if (property.NameEquals("objectId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - objectId = property.Value.GetGuid(); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ContainerServiceUserAssignedIdentity(resourceId.Value, Optional.ToNullable(clientId), Optional.ToNullable(objectId), 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(ContainerServiceUserAssignedIdentity)} does not support '{options.Format}' format."); - } - } - - ContainerServiceUserAssignedIdentity 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); - return DeserializeContainerServiceUserAssignedIdentity(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContainerServiceUserAssignedIdentity)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceUserAssignedIdentity.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceUserAssignedIdentity.cs deleted file mode 100644 index 3763163910e73..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceUserAssignedIdentity.cs +++ /dev/null @@ -1,74 +0,0 @@ -// 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.ContainerService.Models -{ - /// Details about a user assigned identity. - public partial class ContainerServiceUserAssignedIdentity - { - /// - /// 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 protected IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public ContainerServiceUserAssignedIdentity() - { - } - - /// Initializes a new instance of . - /// The resource ID of the user assigned identity. - /// The client ID of the user assigned identity. - /// The object ID of the user assigned identity. - /// Keeps track of any properties unknown to the library. - internal ContainerServiceUserAssignedIdentity(ResourceIdentifier resourceId, Guid? clientId, Guid? objectId, IDictionary serializedAdditionalRawData) - { - ResourceId = resourceId; - ClientId = clientId; - ObjectId = objectId; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The resource ID of the user assigned identity. - public ResourceIdentifier ResourceId { get; set; } - /// The client ID of the user assigned identity. - public Guid? ClientId { get; set; } - /// The object ID of the user assigned identity. - public Guid? ObjectId { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceWeekDay.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceWeekDay.cs deleted file mode 100644 index a5b035e312ee0..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceWeekDay.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The weekday enum. - public readonly partial struct ContainerServiceWeekDay : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ContainerServiceWeekDay(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string SundayValue = "Sunday"; - private const string MondayValue = "Monday"; - private const string TuesdayValue = "Tuesday"; - private const string WednesdayValue = "Wednesday"; - private const string ThursdayValue = "Thursday"; - private const string FridayValue = "Friday"; - private const string SaturdayValue = "Saturday"; - - /// Sunday. - public static ContainerServiceWeekDay Sunday { get; } = new ContainerServiceWeekDay(SundayValue); - /// Monday. - public static ContainerServiceWeekDay Monday { get; } = new ContainerServiceWeekDay(MondayValue); - /// Tuesday. - public static ContainerServiceWeekDay Tuesday { get; } = new ContainerServiceWeekDay(TuesdayValue); - /// Wednesday. - public static ContainerServiceWeekDay Wednesday { get; } = new ContainerServiceWeekDay(WednesdayValue); - /// Thursday. - public static ContainerServiceWeekDay Thursday { get; } = new ContainerServiceWeekDay(ThursdayValue); - /// Friday. - public static ContainerServiceWeekDay Friday { get; } = new ContainerServiceWeekDay(FridayValue); - /// Saturday. - public static ContainerServiceWeekDay Saturday { get; } = new ContainerServiceWeekDay(SaturdayValue); - /// Determines if two values are the same. - public static bool operator ==(ContainerServiceWeekDay left, ContainerServiceWeekDay right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ContainerServiceWeekDay left, ContainerServiceWeekDay right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ContainerServiceWeekDay(string value) => new ContainerServiceWeekDay(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ContainerServiceWeekDay other && Equals(other); - /// - public bool Equals(ContainerServiceWeekDay other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterCredential.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetCredentialResult.Serialization.cs similarity index 65% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterCredential.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetCredentialResult.Serialization.cs index 759e996335b9d..a729e8d085749 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterCredential.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetCredentialResult.Serialization.cs @@ -13,16 +13,16 @@ namespace Azure.ResourceManager.ContainerService.Models { - public partial class ManagedClusterCredential : IUtf8JsonSerializable, IJsonModel + public partial class FleetCredentialResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ManagedClusterCredential)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(FleetCredentialResult)} does not support '{format}' format."); } writer.WriteStartObject(); @@ -54,19 +54,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead writer.WriteEndObject(); } - ManagedClusterCredential IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + FleetCredentialResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ManagedClusterCredential)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(FleetCredentialResult)} does not support '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterCredential(document.RootElement, options); + return DeserializeFleetCredentialResult(document.RootElement, options); } - internal static ManagedClusterCredential DeserializeManagedClusterCredential(JsonElement element, ModelReaderWriterOptions options = null) + internal static FleetCredentialResult DeserializeFleetCredentialResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= new ModelReaderWriterOptions("W"); @@ -100,38 +100,38 @@ internal static ManagedClusterCredential DeserializeManagedClusterCredential(Jso } } serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterCredential(name.Value, value.Value, serializedAdditionalRawData); + return new FleetCredentialResult(name.Value, value.Value, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + 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(ManagedClusterCredential)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(FleetCredentialResult)} does not support '{options.Format}' format."); } } - ManagedClusterCredential IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + FleetCredentialResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterCredential(document.RootElement, options); + return DeserializeFleetCredentialResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ManagedClusterCredential)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(FleetCredentialResult)} does not support '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterCredential.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetCredentialResult.cs similarity index 82% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterCredential.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetCredentialResult.cs index cfebe40f3551a..3a56e8207e4d7 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterCredential.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetCredentialResult.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.ContainerService.Models { - /// The credential result response. - public partial class ManagedClusterCredential + /// One credential result item. + public partial class FleetCredentialResult { /// /// Keeps track of any properties unknown to the library. @@ -45,16 +45,16 @@ public partial class ManagedClusterCredential /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal ManagedClusterCredential() + /// Initializes a new instance of . + internal FleetCredentialResult() { } - /// Initializes a new instance of . + /// 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 ManagedClusterCredential(string name, byte[] value, IDictionary serializedAdditionalRawData) + internal FleetCredentialResult(string name, byte[] value, IDictionary serializedAdditionalRawData) { Name = name; Value = value; diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesPatchVersion.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetCredentialResults.Serialization.cs similarity index 63% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesPatchVersion.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetCredentialResults.Serialization.cs index ce00af2d6fc84..adff0dd3eb428 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesPatchVersion.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetCredentialResults.Serialization.cs @@ -13,26 +13,26 @@ namespace Azure.ResourceManager.ContainerService.Models { - public partial class KubernetesPatchVersion : IUtf8JsonSerializable, IJsonModel + public partial class FleetCredentialResults : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(KubernetesPatchVersion)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(FleetCredentialResults)} does not support '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Upgrades)) + if (options.Format != "W" && Optional.IsCollectionDefined(Kubeconfigs)) { - writer.WritePropertyName("upgrades"u8); + writer.WritePropertyName("kubeconfigs"u8); writer.WriteStartArray(); - foreach (var item in Upgrades) + foreach (var item in Kubeconfigs) { - writer.WriteStringValue(item); + writer.WriteObjectValue(item); } writer.WriteEndArray(); } @@ -54,19 +54,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader writer.WriteEndObject(); } - KubernetesPatchVersion IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + FleetCredentialResults IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(KubernetesPatchVersion)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(FleetCredentialResults)} does not support '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeKubernetesPatchVersion(document.RootElement, options); + return DeserializeFleetCredentialResults(document.RootElement, options); } - internal static KubernetesPatchVersion DeserializeKubernetesPatchVersion(JsonElement element, ModelReaderWriterOptions options = null) + internal static FleetCredentialResults DeserializeFleetCredentialResults(JsonElement element, ModelReaderWriterOptions options = null) { options ??= new ModelReaderWriterOptions("W"); @@ -74,23 +74,23 @@ internal static KubernetesPatchVersion DeserializeKubernetesPatchVersion(JsonEle { return null; } - Optional> upgrades = default; + Optional> kubeconfigs = default; IDictionary serializedAdditionalRawData = default; Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("upgrades"u8)) + if (property.NameEquals("kubeconfigs"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(item.GetString()); + array.Add(FleetCredentialResult.DeserializeFleetCredentialResult(item)); } - upgrades = array; + kubeconfigs = array; continue; } if (options.Format != "W") @@ -99,38 +99,38 @@ internal static KubernetesPatchVersion DeserializeKubernetesPatchVersion(JsonEle } } serializedAdditionalRawData = additionalPropertiesDictionary; - return new KubernetesPatchVersion(Optional.ToList(upgrades), serializedAdditionalRawData); + return new FleetCredentialResults(Optional.ToList(kubeconfigs), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + 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(KubernetesPatchVersion)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(FleetCredentialResults)} does not support '{options.Format}' format."); } } - KubernetesPatchVersion IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + FleetCredentialResults IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeKubernetesPatchVersion(document.RootElement, options); + return DeserializeFleetCredentialResults(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(KubernetesPatchVersion)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(FleetCredentialResults)} does not support '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterCredentials.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetCredentialResults.cs similarity index 69% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterCredentials.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetCredentialResults.cs index 44389aa97afa5..1f593682df8f1 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterCredentials.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetCredentialResults.cs @@ -11,8 +11,8 @@ namespace Azure.ResourceManager.ContainerService.Models { - /// The list credential result response. - public partial class ManagedClusterCredentials + /// The Credential results response. + public partial class FleetCredentialResults { /// /// Keeps track of any properties unknown to the library. @@ -46,22 +46,22 @@ public partial class ManagedClusterCredentials /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal ManagedClusterCredentials() + /// Initializes a new instance of . + internal FleetCredentialResults() { - Kubeconfigs = new ChangeTrackingList(); + Kubeconfigs = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// Base64-encoded Kubernetes configuration file. + /// Initializes a new instance of . + /// Array of base64-encoded Kubernetes configuration files. /// Keeps track of any properties unknown to the library. - internal ManagedClusterCredentials(IReadOnlyList kubeconfigs, IDictionary serializedAdditionalRawData) + internal FleetCredentialResults(IReadOnlyList kubeconfigs, IDictionary serializedAdditionalRawData) { Kubeconfigs = kubeconfigs; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Base64-encoded Kubernetes configuration file. - public IReadOnlyList Kubeconfigs { get; } + /// Array of base64-encoded Kubernetes configuration files. + public IReadOnlyList Kubeconfigs { get; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAccessProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetData.Serialization.cs similarity index 61% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAccessProfile.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetData.Serialization.cs index 33d7a07050815..f173ba375fb20 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAccessProfile.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetData.Serialization.cs @@ -9,24 +9,36 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure; using Azure.Core; +using Azure.ResourceManager.ContainerService.Models; using Azure.ResourceManager.Models; -namespace Azure.ResourceManager.ContainerService.Models +namespace Azure.ResourceManager.ContainerService { - public partial class ManagedClusterAccessProfile : IUtf8JsonSerializable, IJsonModel + public partial class FleetData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ManagedClusterAccessProfile)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(FleetData)} does not support '{format}' format."); } writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(ETag)) + { + writer.WritePropertyName("eTag"u8); + writer.WriteStringValue(ETag.Value.ToString()); + } + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + JsonSerializer.Serialize(writer, Identity); + } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -62,10 +74,15 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); - if (Optional.IsDefined(KubeConfig)) + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) { - writer.WritePropertyName("kubeConfig"u8); - writer.WriteBase64StringValue(KubeConfig, "D"); + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(HubProfile)) + { + writer.WritePropertyName("hubProfile"u8); + writer.WriteObjectValue(HubProfile); } writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -86,19 +103,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR writer.WriteEndObject(); } - ManagedClusterAccessProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + FleetData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ManagedClusterAccessProfile)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(FleetData)} does not support '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterAccessProfile(document.RootElement, options); + return DeserializeFleetData(document.RootElement, options); } - internal static ManagedClusterAccessProfile DeserializeManagedClusterAccessProfile(JsonElement element, ModelReaderWriterOptions options = null) + internal static FleetData DeserializeFleetData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= new ModelReaderWriterOptions("W"); @@ -106,17 +123,38 @@ internal static ManagedClusterAccessProfile DeserializeManagedClusterAccessProfi { return null; } + Optional eTag = default; + Optional identity = default; Optional> tags = default; AzureLocation location = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; Optional systemData = default; - Optional kubeConfig = default; + Optional provisioningState = default; + Optional hubProfile = default; IDictionary serializedAdditionalRawData = default; Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("eTag"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + eTag = new ETag(property.Value.GetString()); + continue; + } + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identity = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -169,13 +207,22 @@ internal static ManagedClusterAccessProfile DeserializeManagedClusterAccessProfi } foreach (var property0 in property.Value.EnumerateObject()) { - if (property0.NameEquals("kubeConfig"u8)) + 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; } - kubeConfig = property0.Value.GetBytesFromBase64("D"); + hubProfile = FleetHubProfile.DeserializeFleetHubProfile(property0.Value); continue; } } @@ -187,38 +234,38 @@ internal static ManagedClusterAccessProfile DeserializeManagedClusterAccessProfi } } serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterAccessProfile(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, kubeConfig.Value, serializedAdditionalRawData); + return new FleetData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, Optional.ToNullable(eTag), identity, Optional.ToNullable(provisioningState), hubProfile.Value, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + 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(ManagedClusterAccessProfile)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(FleetData)} does not support '{options.Format}' format."); } } - ManagedClusterAccessProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + FleetData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterAccessProfile(document.RootElement, options); + return DeserializeFleetData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ManagedClusterAccessProfile)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(FleetData)} does not support '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetHubProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetHubProfile.Serialization.cs new file mode 100644 index 0000000000000..4fc2319625fa8 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetHubProfile.Serialization.cs @@ -0,0 +1,185 @@ +// 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.ContainerService.Models +{ + public partial class FleetHubProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel.Write(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 '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(DnsPrefix)) + { + writer.WritePropertyName("dnsPrefix"u8); + writer.WriteStringValue(DnsPrefix); + } + if (Optional.IsDefined(ApiServerAccessProfile)) + { + writer.WritePropertyName("apiServerAccessProfile"u8); + writer.WriteObjectValue(ApiServerAccessProfile); + } + if (Optional.IsDefined(AgentProfile)) + { + writer.WritePropertyName("agentProfile"u8); + writer.WriteObjectValue(AgentProfile); + } + 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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + 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 '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetHubProfile(document.RootElement, options); + } + + internal static FleetHubProfile DeserializeFleetHubProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional dnsPrefix = default; + Optional apiServerAccessProfile = default; + Optional agentProfile = default; + Optional fqdn = default; + Optional kubernetesVersion = default; + Optional portalFqdn = default; + IDictionary serializedAdditionalRawData = default; + Dictionary additionalPropertiesDictionary = 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); + continue; + } + if (property.NameEquals("agentProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + agentProfile = AgentProfile.DeserializeAgentProfile(property.Value); + 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") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FleetHubProfile(dnsPrefix.Value, apiServerAccessProfile.Value, agentProfile.Value, fqdn.Value, kubernetesVersion.Value, portalFqdn.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(FleetHubProfile)} does not support '{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); + return DeserializeFleetHubProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetHubProfile)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeProfilePropertiesUpgradesItem.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetHubProfile.cs similarity index 50% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeProfilePropertiesUpgradesItem.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetHubProfile.cs index 0dc33327c3b50..9ec304562dcf4 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeProfilePropertiesUpgradesItem.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetHubProfile.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.ContainerService.Models { - /// The AgentPoolUpgradeProfilePropertiesUpgradesItem. - public partial class AgentPoolUpgradeProfilePropertiesUpgradesItem + /// The FleetHubProfile configures the fleet hub. + public partial class FleetHubProfile { /// /// Keeps track of any properties unknown to the library. @@ -45,25 +45,41 @@ public partial class AgentPoolUpgradeProfilePropertiesUpgradesItem /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal AgentPoolUpgradeProfilePropertiesUpgradesItem() + /// Initializes a new instance of . + public FleetHubProfile() { } - /// Initializes a new instance of . - /// The Kubernetes version (major.minor.patch). - /// Whether the Kubernetes version is currently in preview. + /// 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 AgentPoolUpgradeProfilePropertiesUpgradesItem(string kubernetesVersion, bool? isPreview, IDictionary serializedAdditionalRawData) + 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; - IsPreview = isPreview; + PortalFqdn = portalFqdn; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The Kubernetes version (major.minor.patch). + /// 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; } - /// Whether the Kubernetes version is currently in preview. - public bool? IsPreview { get; } + /// The Azure Portal FQDN of the Fleet hub. + public string PortalFqdn { get; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshUpgradeProfileList.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetListResult.Serialization.cs similarity index 56% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshUpgradeProfileList.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetListResult.Serialization.cs index 187186b1e9ee4..2b2a84ddd1ce1 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshUpgradeProfileList.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetListResult.Serialization.cs @@ -14,33 +14,30 @@ namespace Azure.ResourceManager.ContainerService.Models { - internal partial class MeshUpgradeProfileList : IUtf8JsonSerializable, IJsonModel + internal partial class FleetListResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MeshUpgradeProfileList)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(FleetListResult)} does not support '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item); } - if (options.Format != "W" && Optional.IsDefined(NextLink)) + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -60,19 +57,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader writer.WriteEndObject(); } - MeshUpgradeProfileList IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + FleetListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MeshUpgradeProfileList)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(FleetListResult)} does not support '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMeshUpgradeProfileList(document.RootElement, options); + return DeserializeFleetListResult(document.RootElement, options); } - internal static MeshUpgradeProfileList DeserializeMeshUpgradeProfileList(JsonElement element, ModelReaderWriterOptions options = null) + internal static FleetListResult DeserializeFleetListResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= new ModelReaderWriterOptions("W"); @@ -80,29 +77,29 @@ internal static MeshUpgradeProfileList DeserializeMeshUpgradeProfileList(JsonEle { return null; } - Optional> value = default; - Optional nextLink = default; + IReadOnlyList value = default; + Optional nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(MeshUpgradeProfileData.DeserializeMeshUpgradeProfileData(item)); + array.Add(FleetData.DeserializeFleetData(item)); } value = array; continue; } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -111,38 +108,38 @@ internal static MeshUpgradeProfileList DeserializeMeshUpgradeProfileList(JsonEle } } serializedAdditionalRawData = additionalPropertiesDictionary; - return new MeshUpgradeProfileList(Optional.ToList(value), nextLink.Value, serializedAdditionalRawData); + return new FleetListResult(value, nextLink.Value, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + 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(MeshUpgradeProfileList)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(FleetListResult)} does not support '{options.Format}' format."); } } - MeshUpgradeProfileList IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + FleetListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMeshUpgradeProfileList(document.RootElement, options); + return DeserializeFleetListResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(MeshUpgradeProfileList)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(FleetListResult)} does not support '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/OutboundEnvironmentEndpointListResult.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetListResult.cs similarity index 61% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/OutboundEnvironmentEndpointListResult.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetListResult.cs index 9aaf57cafe6c5..5b5d3cc75a510 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/OutboundEnvironmentEndpointListResult.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetListResult.cs @@ -9,11 +9,12 @@ using System.Collections.Generic; using System.Linq; using Azure.Core; +using Azure.ResourceManager.ContainerService; namespace Azure.ResourceManager.ContainerService.Models { - /// Collection of OutboundEnvironmentEndpoint. - internal partial class OutboundEnvironmentEndpointListResult + /// The response of a Fleet list operation. + internal partial class FleetListResult { /// /// Keeps track of any properties unknown to the library. @@ -47,35 +48,35 @@ internal partial class OutboundEnvironmentEndpointListResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// Collection of resources. + /// Initializes a new instance of . + /// The Fleet items on this page. /// is null. - internal OutboundEnvironmentEndpointListResult(IEnumerable value) + internal FleetListResult(IEnumerable value) { Argument.AssertNotNull(value, nameof(value)); Value = value.ToList(); } - /// Initializes a new instance of . - /// Collection of resources. - /// Link to next page of resources. + /// 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 OutboundEnvironmentEndpointListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal FleetListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal OutboundEnvironmentEndpointListResult() + /// Initializes a new instance of for deserialization. + internal FleetListResult() { } - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } + /// 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/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTrustedAccessRoleBindingData.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetMemberData.Serialization.cs similarity index 62% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTrustedAccessRoleBindingData.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetMemberData.Serialization.cs index 89ebb6bcb1edb..12d80db1f1673 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTrustedAccessRoleBindingData.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetMemberData.Serialization.cs @@ -9,25 +9,31 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure; using Azure.Core; using Azure.ResourceManager.ContainerService.Models; using Azure.ResourceManager.Models; namespace Azure.ResourceManager.ContainerService { - public partial class ContainerServiceTrustedAccessRoleBindingData : IUtf8JsonSerializable, IJsonModel + public partial class FleetMemberData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServiceTrustedAccessRoleBindingData)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(FleetMemberData)} does not support '{format}' format."); } writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(ETag)) + { + writer.WritePropertyName("eTag"u8); + writer.WriteStringValue(ETag.Value.ToString()); + } if (options.Format != "W") { writer.WritePropertyName("id"u8); @@ -50,20 +56,21 @@ void IJsonModel.Write(Utf8JsonWrit } 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()); } - writer.WritePropertyName("sourceResourceId"u8); - writer.WriteStringValue(SourceResourceId); - writer.WritePropertyName("roles"u8); - writer.WriteStartArray(); - foreach (var item in Roles) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -83,19 +90,19 @@ void IJsonModel.Write(Utf8JsonWrit writer.WriteEndObject(); } - ContainerServiceTrustedAccessRoleBindingData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + FleetMemberData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServiceTrustedAccessRoleBindingData)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(FleetMemberData)} does not support '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceTrustedAccessRoleBindingData(document.RootElement, options); + return DeserializeFleetMemberData(document.RootElement, options); } - internal static ContainerServiceTrustedAccessRoleBindingData DeserializeContainerServiceTrustedAccessRoleBindingData(JsonElement element, ModelReaderWriterOptions options = null) + internal static FleetMemberData DeserializeFleetMemberData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= new ModelReaderWriterOptions("W"); @@ -103,17 +110,27 @@ internal static ContainerServiceTrustedAccessRoleBindingData DeserializeContaine { return null; } + Optional eTag = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; Optional systemData = default; - Optional provisioningState = default; - ResourceIdentifier sourceResourceId = default; - IList roles = default; + Optional clusterResourceId = default; + Optional group = default; + Optional provisioningState = default; IDictionary serializedAdditionalRawData = default; Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("eTag"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + eTag = new ETag(property.Value.GetString()); + continue; + } if (property.NameEquals("id"u8)) { id = new ResourceIdentifier(property.Value.GetString()); @@ -147,28 +164,27 @@ internal static ContainerServiceTrustedAccessRoleBindingData DeserializeContaine } foreach (var property0 in property.Value.EnumerateObject()) { - if (property0.NameEquals("provisioningState"u8)) + if (property0.NameEquals("clusterResourceId"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } - provisioningState = new ContainerServiceTrustedAccessRoleBindingProvisioningState(property0.Value.GetString()); + clusterResourceId = new ResourceIdentifier(property0.Value.GetString()); continue; } - if (property0.NameEquals("sourceResourceId"u8)) + if (property0.NameEquals("group"u8)) { - sourceResourceId = new ResourceIdentifier(property0.Value.GetString()); + group = property0.Value.GetString(); continue; } - if (property0.NameEquals("roles"u8)) + if (property0.NameEquals("provisioningState"u8)) { - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) + if (property0.Value.ValueKind == JsonValueKind.Null) { - array.Add(item.GetString()); + continue; } - roles = array; + provisioningState = new FleetMemberProvisioningState(property0.Value.GetString()); continue; } } @@ -180,38 +196,38 @@ internal static ContainerServiceTrustedAccessRoleBindingData DeserializeContaine } } serializedAdditionalRawData = additionalPropertiesDictionary; - return new ContainerServiceTrustedAccessRoleBindingData(id, name, type, systemData.Value, Optional.ToNullable(provisioningState), sourceResourceId, roles, serializedAdditionalRawData); + return new FleetMemberData(id, name, type, systemData.Value, Optional.ToNullable(eTag), clusterResourceId.Value, group.Value, Optional.ToNullable(provisioningState), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + 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(ContainerServiceTrustedAccessRoleBindingData)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(FleetMemberData)} does not support '{options.Format}' format."); } } - ContainerServiceTrustedAccessRoleBindingData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + FleetMemberData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContainerServiceTrustedAccessRoleBindingData(document.RootElement, options); + return DeserializeFleetMemberData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ContainerServiceTrustedAccessRoleBindingData)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(FleetMemberData)} does not support '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceIPTag.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetMemberListResult.Serialization.cs similarity index 55% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceIPTag.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetMemberListResult.Serialization.cs index 3324b03917565..632e94a166c92 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceIPTag.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetMemberListResult.Serialization.cs @@ -10,31 +10,34 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.ContainerService; namespace Azure.ResourceManager.ContainerService.Models { - public partial class ContainerServiceIPTag : IUtf8JsonSerializable, IJsonModel + internal partial class FleetMemberListResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServiceIPTag)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(FleetMemberListResult)} does not support '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(IPTagType)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("ipTagType"u8); - writer.WriteStringValue(IPTagType); + writer.WriteObjectValue(item); } - if (Optional.IsDefined(Tag)) + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) { - writer.WritePropertyName("tag"u8); - writer.WriteStringValue(Tag); + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -54,19 +57,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW writer.WriteEndObject(); } - ContainerServiceIPTag IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + FleetMemberListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServiceIPTag)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(FleetMemberListResult)} does not support '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceIPTag(document.RootElement, options); + return DeserializeFleetMemberListResult(document.RootElement, options); } - internal static ContainerServiceIPTag DeserializeContainerServiceIPTag(JsonElement element, ModelReaderWriterOptions options = null) + internal static FleetMemberListResult DeserializeFleetMemberListResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= new ModelReaderWriterOptions("W"); @@ -74,20 +77,29 @@ internal static ContainerServiceIPTag DeserializeContainerServiceIPTag(JsonEleme { return null; } - Optional ipTagType = default; - Optional tag = default; + IReadOnlyList value = default; + Optional nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("ipTagType"u8)) + if (property.NameEquals("value"u8)) { - ipTagType = property.Value.GetString(); + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FleetMemberData.DeserializeFleetMemberData(item)); + } + value = array; continue; } - if (property.NameEquals("tag"u8)) + if (property.NameEquals("nextLink"u8)) { - tag = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -96,38 +108,38 @@ internal static ContainerServiceIPTag DeserializeContainerServiceIPTag(JsonEleme } } serializedAdditionalRawData = additionalPropertiesDictionary; - return new ContainerServiceIPTag(ipTagType.Value, tag.Value, serializedAdditionalRawData); + return new FleetMemberListResult(value, nextLink.Value, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + 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(ContainerServiceIPTag)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(FleetMemberListResult)} does not support '{options.Format}' format."); } } - ContainerServiceIPTag IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + FleetMemberListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContainerServiceIPTag(document.RootElement, options); + return DeserializeFleetMemberListResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ContainerServiceIPTag)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(FleetMemberListResult)} does not support '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/TrustedAccessRoleBindingListResult.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetMemberListResult.cs similarity index 58% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/TrustedAccessRoleBindingListResult.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetMemberListResult.cs index 41a276d3f12ee..d50897e25f4ca 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/TrustedAccessRoleBindingListResult.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetMemberListResult.cs @@ -7,13 +7,14 @@ using System; using System.Collections.Generic; +using System.Linq; using Azure.Core; using Azure.ResourceManager.ContainerService; namespace Azure.ResourceManager.ContainerService.Models { - /// List of trusted access role bindings. - internal partial class TrustedAccessRoleBindingListResult + /// The response of a FleetMember list operation. + internal partial class FleetMemberListResult { /// /// Keeps track of any properties unknown to the library. @@ -47,26 +48,35 @@ internal partial class TrustedAccessRoleBindingListResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal TrustedAccessRoleBindingListResult() + /// Initializes a new instance of . + /// The FleetMember items on this page. + /// is null. + internal FleetMemberListResult(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } - /// Initializes a new instance of . - /// Role binding list. - /// Link to next page of resources. + /// 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 TrustedAccessRoleBindingListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal FleetMemberListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Role binding list. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } + /// 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/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceCreationData.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetMemberPatch.Serialization.cs similarity index 55% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceCreationData.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetMemberPatch.Serialization.cs index 97fdf3174d8bf..0ed2dd5848dab 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceCreationData.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetMemberPatch.Serialization.cs @@ -13,24 +13,27 @@ namespace Azure.ResourceManager.ContainerService.Models { - internal partial class ContainerServiceCreationData : IUtf8JsonSerializable, IJsonModel + public partial class FleetMemberPatch : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServiceCreationData)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(FleetMemberPatch)} does not support '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(SourceResourceId)) + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(Group)) { - writer.WritePropertyName("sourceResourceId"u8); - writer.WriteStringValue(SourceResourceId); + writer.WritePropertyName("group"u8); + writer.WriteStringValue(Group); } + writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -49,19 +52,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model writer.WriteEndObject(); } - ContainerServiceCreationData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + FleetMemberPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServiceCreationData)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(FleetMemberPatch)} does not support '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceCreationData(document.RootElement, options); + return DeserializeFleetMemberPatch(document.RootElement, options); } - internal static ContainerServiceCreationData DeserializeContainerServiceCreationData(JsonElement element, ModelReaderWriterOptions options = null) + internal static FleetMemberPatch DeserializeFleetMemberPatch(JsonElement element, ModelReaderWriterOptions options = null) { options ??= new ModelReaderWriterOptions("W"); @@ -69,18 +72,26 @@ internal static ContainerServiceCreationData DeserializeContainerServiceCreation { return null; } - Optional sourceResourceId = default; + Optional group = default; IDictionary serializedAdditionalRawData = default; Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("sourceResourceId"u8)) + if (property.NameEquals("properties"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { + property.ThrowNonNullablePropertyIsNull(); continue; } - sourceResourceId = new ResourceIdentifier(property.Value.GetString()); + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("group"u8)) + { + group = property0.Value.GetString(); + continue; + } + } continue; } if (options.Format != "W") @@ -89,38 +100,38 @@ internal static ContainerServiceCreationData DeserializeContainerServiceCreation } } serializedAdditionalRawData = additionalPropertiesDictionary; - return new ContainerServiceCreationData(sourceResourceId.Value, serializedAdditionalRawData); + return new FleetMemberPatch(group.Value, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + 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(ContainerServiceCreationData)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(FleetMemberPatch)} does not support '{options.Format}' format."); } } - ContainerServiceCreationData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + FleetMemberPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContainerServiceCreationData(document.RootElement, options); + return DeserializeFleetMemberPatch(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ContainerServiceCreationData)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(FleetMemberPatch)} does not support '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ClusterUpgradeSettings.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetMemberPatch.cs similarity index 71% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ClusterUpgradeSettings.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetMemberPatch.cs index 61257e310374a..61ec9cccb288e 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ClusterUpgradeSettings.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetMemberPatch.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.ContainerService.Models { - /// Settings for upgrading a cluster. - internal partial class ClusterUpgradeSettings + /// The type used for update operations of the FleetMember. + public partial class FleetMemberPatch { /// /// Keeps track of any properties unknown to the library. @@ -45,21 +45,21 @@ internal partial class ClusterUpgradeSettings /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public ClusterUpgradeSettings() + /// Initializes a new instance of . + public FleetMemberPatch() { } - /// Initializes a new instance of . - /// Settings for overrides. + /// 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 ClusterUpgradeSettings(UpgradeOverrideSettings overrideSettings, IDictionary serializedAdditionalRawData) + internal FleetMemberPatch(string group, IDictionary serializedAdditionalRawData) { - OverrideSettings = overrideSettings; + Group = group; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Settings for overrides. - public UpgradeOverrideSettings OverrideSettings { get; set; } + /// The group this member belongs to for multi-cluster update management. + public string Group { get; set; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetMemberProvisioningState.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetMemberProvisioningState.cs new file mode 100644 index 0000000000000..028eeea9278cd --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/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.ContainerService.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 string 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?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTagsObject.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetPatch.Serialization.cs similarity index 61% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTagsObject.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetPatch.Serialization.cs index 6c7ad79509b00..608fb5b0d5495 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTagsObject.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetPatch.Serialization.cs @@ -10,19 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.Models; namespace Azure.ResourceManager.ContainerService.Models { - public partial class ContainerServiceTagsObject : IUtf8JsonSerializable, IJsonModel + public partial class FleetPatch : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServiceTagsObject)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(FleetPatch)} does not support '{format}' format."); } writer.WriteStartObject(); @@ -37,6 +38,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe } writer.WriteEndObject(); } + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + JsonSerializer.Serialize(writer, Identity); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -55,19 +61,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe writer.WriteEndObject(); } - ContainerServiceTagsObject IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + FleetPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServiceTagsObject)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(FleetPatch)} does not support '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceTagsObject(document.RootElement, options); + return DeserializeFleetPatch(document.RootElement, options); } - internal static ContainerServiceTagsObject DeserializeContainerServiceTagsObject(JsonElement element, ModelReaderWriterOptions options = null) + internal static FleetPatch DeserializeFleetPatch(JsonElement element, ModelReaderWriterOptions options = null) { options ??= new ModelReaderWriterOptions("W"); @@ -76,6 +82,7 @@ internal static ContainerServiceTagsObject DeserializeContainerServiceTagsObject return null; } Optional> tags = default; + Optional identity = default; IDictionary serializedAdditionalRawData = default; Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -94,44 +101,53 @@ internal static ContainerServiceTagsObject DeserializeContainerServiceTagsObject tags = dictionary; continue; } + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identity = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } if (options.Format != "W") { additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = additionalPropertiesDictionary; - return new ContainerServiceTagsObject(Optional.ToDictionary(tags), serializedAdditionalRawData); + return new FleetPatch(Optional.ToDictionary(tags), identity, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + 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(ContainerServiceTagsObject)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(FleetPatch)} does not support '{options.Format}' format."); } } - ContainerServiceTagsObject IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + FleetPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContainerServiceTagsObject(document.RootElement, options); + return DeserializeFleetPatch(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ContainerServiceTagsObject)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(FleetPatch)} does not support '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTagsObject.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetPatch.cs similarity index 73% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTagsObject.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetPatch.cs index 002b72b664b13..b0da8b5588710 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTagsObject.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetPatch.cs @@ -8,11 +8,12 @@ using System; using System.Collections.Generic; using Azure.Core; +using Azure.ResourceManager.Models; namespace Azure.ResourceManager.ContainerService.Models { - /// Tags object for patch operations. - public partial class ContainerServiceTagsObject + /// Properties of a Fleet that can be patched. + public partial class FleetPatch { /// /// Keeps track of any properties unknown to the library. @@ -46,22 +47,26 @@ public partial class ContainerServiceTagsObject /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public ContainerServiceTagsObject() + /// Initializes a new instance of . + public FleetPatch() { Tags = new ChangeTrackingDictionary(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Resource tags. + /// Managed identity. /// Keeps track of any properties unknown to the library. - internal ContainerServiceTagsObject(IDictionary tags, IDictionary serializedAdditionalRawData) + internal FleetPatch(IDictionary tags, ResourceManager.Models.ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) { Tags = tags; + Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } /// Resource tags. public IDictionary Tags { get; } + /// Managed identity. + public ResourceManager.Models.ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetProvisioningState.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetProvisioningState.cs new file mode 100644 index 0000000000000..4b2c2f7720b13 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/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.ContainerService.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 string 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?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateEndpointConnectionData.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetUpdateStrategyData.Serialization.cs similarity index 59% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateEndpointConnectionData.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetUpdateStrategyData.Serialization.cs index f1fc9784bfa07..80fac96770c11 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateEndpointConnectionData.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetUpdateStrategyData.Serialization.cs @@ -9,26 +9,31 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure; using Azure.Core; using Azure.ResourceManager.ContainerService.Models; using Azure.ResourceManager.Models; -using Azure.ResourceManager.Resources.Models; namespace Azure.ResourceManager.ContainerService { - public partial class ContainerServicePrivateEndpointConnectionData : IUtf8JsonSerializable, IJsonModel + public partial class FleetUpdateStrategyData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServicePrivateEndpointConnectionData)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(FleetUpdateStrategyData)} does not support '{format}' format."); } writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(ETag)) + { + writer.WritePropertyName("eTag"u8); + writer.WriteStringValue(ETag.Value.ToString()); + } if (options.Format != "W") { writer.WritePropertyName("id"u8); @@ -56,15 +61,10 @@ void IJsonModel.Write(Utf8JsonWri writer.WritePropertyName("provisioningState"u8); writer.WriteStringValue(ProvisioningState.Value.ToString()); } - if (Optional.IsDefined(PrivateEndpoint)) + if (Optional.IsDefined(Strategy)) { - writer.WritePropertyName("privateEndpoint"u8); - JsonSerializer.Serialize(writer, PrivateEndpoint); - } - if (Optional.IsDefined(ConnectionState)) - { - writer.WritePropertyName("privateLinkServiceConnectionState"u8); - writer.WriteObjectValue(ConnectionState); + writer.WritePropertyName("strategy"u8); + writer.WriteObjectValue(Strategy); } writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -85,19 +85,19 @@ void IJsonModel.Write(Utf8JsonWri writer.WriteEndObject(); } - ContainerServicePrivateEndpointConnectionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + FleetUpdateStrategyData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServicePrivateEndpointConnectionData)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(FleetUpdateStrategyData)} does not support '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServicePrivateEndpointConnectionData(document.RootElement, options); + return DeserializeFleetUpdateStrategyData(document.RootElement, options); } - internal static ContainerServicePrivateEndpointConnectionData DeserializeContainerServicePrivateEndpointConnectionData(JsonElement element, ModelReaderWriterOptions options = null) + internal static FleetUpdateStrategyData DeserializeFleetUpdateStrategyData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= new ModelReaderWriterOptions("W"); @@ -105,17 +105,26 @@ internal static ContainerServicePrivateEndpointConnectionData DeserializeContain { return null; } + Optional eTag = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; Optional systemData = default; - Optional provisioningState = default; - Optional privateEndpoint = default; - Optional privateLinkServiceConnectionState = default; + Optional provisioningState = default; + Optional strategy = default; IDictionary serializedAdditionalRawData = default; Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("eTag"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + eTag = new ETag(property.Value.GetString()); + continue; + } if (property.NameEquals("id"u8)) { id = new ResourceIdentifier(property.Value.GetString()); @@ -155,25 +164,16 @@ internal static ContainerServicePrivateEndpointConnectionData DeserializeContain { continue; } - provisioningState = new ContainerServicePrivateEndpointConnectionProvisioningState(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("privateEndpoint"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - privateEndpoint = JsonSerializer.Deserialize(property0.Value.GetRawText()); + provisioningState = new FleetUpdateStrategyProvisioningState(property0.Value.GetString()); continue; } - if (property0.NameEquals("privateLinkServiceConnectionState"u8)) + if (property0.NameEquals("strategy"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } - privateLinkServiceConnectionState = ContainerServicePrivateLinkServiceConnectionState.DeserializeContainerServicePrivateLinkServiceConnectionState(property0.Value); + strategy = UpdateRunStrategy.DeserializeUpdateRunStrategy(property0.Value); continue; } } @@ -185,38 +185,38 @@ internal static ContainerServicePrivateEndpointConnectionData DeserializeContain } } serializedAdditionalRawData = additionalPropertiesDictionary; - return new ContainerServicePrivateEndpointConnectionData(id, name, type, systemData.Value, Optional.ToNullable(provisioningState), privateEndpoint, privateLinkServiceConnectionState.Value, serializedAdditionalRawData); + return new FleetUpdateStrategyData(id, name, type, systemData.Value, Optional.ToNullable(eTag), Optional.ToNullable(provisioningState), strategy.Value, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + 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(ContainerServicePrivateEndpointConnectionData)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(FleetUpdateStrategyData)} does not support '{options.Format}' format."); } } - ContainerServicePrivateEndpointConnectionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + FleetUpdateStrategyData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContainerServicePrivateEndpointConnectionData(document.RootElement, options); + return DeserializeFleetUpdateStrategyData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ContainerServicePrivateEndpointConnectionData)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(FleetUpdateStrategyData)} does not support '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshRevisionProfileProperties.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetUpdateStrategyListResult.Serialization.cs similarity index 57% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshRevisionProfileProperties.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetUpdateStrategyListResult.Serialization.cs index 1aeaf7147b0c4..59356ddb8e524 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshRevisionProfileProperties.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetUpdateStrategyListResult.Serialization.cs @@ -10,31 +10,34 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.ContainerService; namespace Azure.ResourceManager.ContainerService.Models { - internal partial class MeshRevisionProfileProperties : IUtf8JsonSerializable, IJsonModel + internal partial class FleetUpdateStrategyListResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MeshRevisionProfileProperties)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(FleetUpdateStrategyListResult)} does not support '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsCollectionDefined(MeshRevisions)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("meshRevisions"u8); - writer.WriteStartArray(); - foreach (var item in MeshRevisions) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -54,19 +57,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode writer.WriteEndObject(); } - MeshRevisionProfileProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + FleetUpdateStrategyListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MeshRevisionProfileProperties)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(FleetUpdateStrategyListResult)} does not support '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMeshRevisionProfileProperties(document.RootElement, options); + return DeserializeFleetUpdateStrategyListResult(document.RootElement, options); } - internal static MeshRevisionProfileProperties DeserializeMeshRevisionProfileProperties(JsonElement element, ModelReaderWriterOptions options = null) + internal static FleetUpdateStrategyListResult DeserializeFleetUpdateStrategyListResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= new ModelReaderWriterOptions("W"); @@ -74,23 +77,29 @@ internal static MeshRevisionProfileProperties DeserializeMeshRevisionProfileProp { return null; } - Optional> meshRevisions = default; + IReadOnlyList value = default; + Optional nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("meshRevisions"u8)) + if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) { - continue; + array.Add(FleetUpdateStrategyData.DeserializeFleetUpdateStrategyData(item)); } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) { - array.Add(MeshRevision.DeserializeMeshRevision(item)); + continue; } - meshRevisions = array; + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -99,38 +108,38 @@ internal static MeshRevisionProfileProperties DeserializeMeshRevisionProfileProp } } serializedAdditionalRawData = additionalPropertiesDictionary; - return new MeshRevisionProfileProperties(Optional.ToList(meshRevisions), serializedAdditionalRawData); + return new FleetUpdateStrategyListResult(value, nextLink.Value, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + 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(MeshRevisionProfileProperties)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(FleetUpdateStrategyListResult)} does not support '{options.Format}' format."); } } - MeshRevisionProfileProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + FleetUpdateStrategyListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMeshRevisionProfileProperties(document.RootElement, options); + return DeserializeFleetUpdateStrategyListResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(MeshRevisionProfileProperties)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(FleetUpdateStrategyListResult)} does not support '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceSshConfiguration.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetUpdateStrategyListResult.cs similarity index 56% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceSshConfiguration.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetUpdateStrategyListResult.cs index 55ba9572a945b..af53132cb2236 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceSshConfiguration.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetUpdateStrategyListResult.cs @@ -9,11 +9,12 @@ using System.Collections.Generic; using System.Linq; using Azure.Core; +using Azure.ResourceManager.ContainerService; namespace Azure.ResourceManager.ContainerService.Models { - /// SSH configuration for Linux-based VMs running on Azure. - public partial class ContainerServiceSshConfiguration + /// The response of a FleetUpdateStrategy list operation. + internal partial class FleetUpdateStrategyListResult { /// /// Keeps track of any properties unknown to the library. @@ -47,31 +48,35 @@ public partial class ContainerServiceSshConfiguration /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The list of SSH public keys used to authenticate with Linux-based VMs. A maximum of 1 key may be specified. - /// is null. - public ContainerServiceSshConfiguration(IEnumerable publicKeys) + /// Initializes a new instance of . + /// The FleetUpdateStrategy items on this page. + /// is null. + internal FleetUpdateStrategyListResult(IEnumerable value) { - Argument.AssertNotNull(publicKeys, nameof(publicKeys)); + Argument.AssertNotNull(value, nameof(value)); - PublicKeys = publicKeys.ToList(); + Value = value.ToList(); } - /// Initializes a new instance of . - /// The list of SSH public keys used to authenticate with Linux-based VMs. A maximum of 1 key may be specified. + /// 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 ContainerServiceSshConfiguration(IList publicKeys, IDictionary serializedAdditionalRawData) + internal FleetUpdateStrategyListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { - PublicKeys = publicKeys; + Value = value; + NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal ContainerServiceSshConfiguration() + /// Initializes a new instance of for deserialization. + internal FleetUpdateStrategyListResult() { } - /// The list of SSH public keys used to authenticate with Linux-based VMs. A maximum of 1 key may be specified. - public IList PublicKeys { get; } + /// 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/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetUpdateStrategyProvisioningState.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetUpdateStrategyProvisioningState.cs new file mode 100644 index 0000000000000..a9822dce20915 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/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.ContainerService.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 string 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?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/GpuInstanceProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/GpuInstanceProfile.cs deleted file mode 100644 index 31a9b6a6d0ce4..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/GpuInstanceProfile.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. - public readonly partial struct GpuInstanceProfile : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public GpuInstanceProfile(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string Mig1GValue = "MIG1g"; - private const string Mig2GValue = "MIG2g"; - private const string Mig3GValue = "MIG3g"; - private const string Mig4GValue = "MIG4g"; - private const string Mig7GValue = "MIG7g"; - - /// MIG1g. - public static GpuInstanceProfile Mig1G { get; } = new GpuInstanceProfile(Mig1GValue); - /// MIG2g. - public static GpuInstanceProfile Mig2G { get; } = new GpuInstanceProfile(Mig2GValue); - /// MIG3g. - public static GpuInstanceProfile Mig3G { get; } = new GpuInstanceProfile(Mig3GValue); - /// MIG4g. - public static GpuInstanceProfile Mig4G { get; } = new GpuInstanceProfile(Mig4GValue); - /// MIG7g. - public static GpuInstanceProfile Mig7G { get; } = new GpuInstanceProfile(Mig7GValue); - /// Determines if two values are the same. - public static bool operator ==(GpuInstanceProfile left, GpuInstanceProfile right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(GpuInstanceProfile left, GpuInstanceProfile right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator GpuInstanceProfile(string value) => new GpuInstanceProfile(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is GpuInstanceProfile other && Equals(other); - /// - public bool Equals(GpuInstanceProfile other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IPFamily.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IPFamily.cs deleted file mode 100644 index 32b68b15470e3..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IPFamily.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The IP version to use for cluster networking and IP assignment. - public readonly partial struct IPFamily : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public IPFamily(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string IPv4Value = "IPv4"; - private const string IPv6Value = "IPv6"; - - /// IPv4. - public static IPFamily IPv4 { get; } = new IPFamily(IPv4Value); - /// IPv6. - public static IPFamily IPv6 { get; } = new IPFamily(IPv6Value); - /// Determines if two values are the same. - public static bool operator ==(IPFamily left, IPFamily right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(IPFamily left, IPFamily right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator IPFamily(string value) => new IPFamily(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is IPFamily other && Equals(other); - /// - public bool Equals(IPFamily other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioCertificateAuthority.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioCertificateAuthority.Serialization.cs deleted file mode 100644 index 1860ef9e7c6d7..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioCertificateAuthority.Serialization.cs +++ /dev/null @@ -1,126 +0,0 @@ -// 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.ContainerService.Models -{ - internal partial class IstioCertificateAuthority : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(IstioCertificateAuthority)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Plugin)) - { - writer.WritePropertyName("plugin"u8); - writer.WriteObjectValue(Plugin); - } - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - IstioCertificateAuthority 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(IstioCertificateAuthority)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeIstioCertificateAuthority(document.RootElement, options); - } - - internal static IstioCertificateAuthority DeserializeIstioCertificateAuthority(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional plugin = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("plugin"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - plugin = IstioPluginCertificateAuthority.DeserializeIstioPluginCertificateAuthority(property.Value); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new IstioCertificateAuthority(plugin.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(IstioCertificateAuthority)} does not support '{options.Format}' format."); - } - } - - IstioCertificateAuthority 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); - return DeserializeIstioCertificateAuthority(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(IstioCertificateAuthority)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioCertificateAuthority.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioCertificateAuthority.cs deleted file mode 100644 index ebe0325999fe2..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioCertificateAuthority.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Istio Service Mesh Certificate Authority (CA) configuration. For now, we only support plugin certificates as described here https://aka.ms/asm-plugin-ca. - internal partial class IstioCertificateAuthority - { - /// - /// 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 IstioCertificateAuthority() - { - } - - /// Initializes a new instance of . - /// Plugin certificates information for Service Mesh. - /// Keeps track of any properties unknown to the library. - internal IstioCertificateAuthority(IstioPluginCertificateAuthority plugin, IDictionary serializedAdditionalRawData) - { - Plugin = plugin; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Plugin certificates information for Service Mesh. - public IstioPluginCertificateAuthority Plugin { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioComponents.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioComponents.cs deleted file mode 100644 index 49fb8b7943140..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioComponents.cs +++ /dev/null @@ -1,72 +0,0 @@ -// 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.ContainerService.Models -{ - /// Istio components configuration. - public partial class IstioComponents - { - /// - /// 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 IstioComponents() - { - IngressGateways = new ChangeTrackingList(); - EgressGateways = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Istio ingress gateways. - /// Istio egress gateways. - /// Keeps track of any properties unknown to the library. - internal IstioComponents(IList ingressGateways, IList egressGateways, IDictionary serializedAdditionalRawData) - { - IngressGateways = ingressGateways; - EgressGateways = egressGateways; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Istio ingress gateways. - public IList IngressGateways { get; } - /// Istio egress gateways. - public IList EgressGateways { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioEgressGateway.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioEgressGateway.Serialization.cs deleted file mode 100644 index e69cee5aee40d..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioEgressGateway.Serialization.cs +++ /dev/null @@ -1,145 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class IstioEgressGateway : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(IstioEgressGateway)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(IsEnabled); - if (Optional.IsCollectionDefined(NodeSelector)) - { - writer.WritePropertyName("nodeSelector"u8); - writer.WriteStartObject(); - foreach (var item in NodeSelector) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - IstioEgressGateway 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(IstioEgressGateway)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeIstioEgressGateway(document.RootElement, options); - } - - internal static IstioEgressGateway DeserializeIstioEgressGateway(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - bool enabled = default; - Optional> nodeSelector = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("enabled"u8)) - { - enabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("nodeSelector"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()); - } - nodeSelector = dictionary; - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new IstioEgressGateway(enabled, Optional.ToDictionary(nodeSelector), 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(IstioEgressGateway)} does not support '{options.Format}' format."); - } - } - - IstioEgressGateway 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); - return DeserializeIstioEgressGateway(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(IstioEgressGateway)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioEgressGateway.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioEgressGateway.cs deleted file mode 100644 index d0d25e09255f0..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioEgressGateway.cs +++ /dev/null @@ -1,78 +0,0 @@ -// 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.ContainerService.Models -{ - /// Istio egress gateway configuration. - public partial class IstioEgressGateway - { - /// - /// 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 . - /// Whether to enable the egress gateway. - public IstioEgressGateway(bool isEnabled) - { - IsEnabled = isEnabled; - NodeSelector = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of . - /// Whether to enable the egress gateway. - /// NodeSelector for scheduling the egress gateway. - /// Keeps track of any properties unknown to the library. - internal IstioEgressGateway(bool isEnabled, IDictionary nodeSelector, IDictionary serializedAdditionalRawData) - { - IsEnabled = isEnabled; - NodeSelector = nodeSelector; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal IstioEgressGateway() - { - } - - /// Whether to enable the egress gateway. - public bool IsEnabled { get; set; } - /// NodeSelector for scheduling the egress gateway. - public IDictionary NodeSelector { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioIngressGateway.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioIngressGateway.cs deleted file mode 100644 index be541e2542789..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioIngressGateway.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Istio ingress gateway configuration. For now, we support up to one external ingress gateway named `aks-istio-ingressgateway-external` and one internal ingress gateway named `aks-istio-ingressgateway-internal`. - public partial class IstioIngressGateway - { - /// - /// 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 . - /// Mode of an ingress gateway. - /// Whether to enable the ingress gateway. - public IstioIngressGateway(IstioIngressGatewayMode mode, bool isEnabled) - { - Mode = mode; - IsEnabled = isEnabled; - } - - /// Initializes a new instance of . - /// Mode of an ingress gateway. - /// Whether to enable the ingress gateway. - /// Keeps track of any properties unknown to the library. - internal IstioIngressGateway(IstioIngressGatewayMode mode, bool isEnabled, IDictionary serializedAdditionalRawData) - { - Mode = mode; - IsEnabled = isEnabled; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal IstioIngressGateway() - { - } - - /// Mode of an ingress gateway. - public IstioIngressGatewayMode Mode { get; set; } - /// Whether to enable the ingress gateway. - public bool IsEnabled { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioIngressGatewayMode.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioIngressGatewayMode.cs deleted file mode 100644 index 0e8e48a22c540..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioIngressGatewayMode.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Mode of an ingress gateway. - public readonly partial struct IstioIngressGatewayMode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public IstioIngressGatewayMode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ExternalValue = "External"; - private const string InternalValue = "Internal"; - - /// The ingress gateway is assigned a public IP address and is publicly accessible. - public static IstioIngressGatewayMode External { get; } = new IstioIngressGatewayMode(ExternalValue); - /// The ingress gateway is assigned an internal IP address and cannot is accessed publicly. - public static IstioIngressGatewayMode Internal { get; } = new IstioIngressGatewayMode(InternalValue); - /// Determines if two values are the same. - public static bool operator ==(IstioIngressGatewayMode left, IstioIngressGatewayMode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(IstioIngressGatewayMode left, IstioIngressGatewayMode right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator IstioIngressGatewayMode(string value) => new IstioIngressGatewayMode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is IstioIngressGatewayMode other && Equals(other); - /// - public bool Equals(IstioIngressGatewayMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioPluginCertificateAuthority.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioPluginCertificateAuthority.Serialization.cs deleted file mode 100644 index 7fcb487fb2f8d..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioPluginCertificateAuthority.Serialization.cs +++ /dev/null @@ -1,170 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class IstioPluginCertificateAuthority : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(IstioPluginCertificateAuthority)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(KeyVaultId)) - { - writer.WritePropertyName("keyVaultId"u8); - writer.WriteStringValue(KeyVaultId); - } - if (Optional.IsDefined(CertObjectName)) - { - writer.WritePropertyName("certObjectName"u8); - writer.WriteStringValue(CertObjectName); - } - if (Optional.IsDefined(KeyObjectName)) - { - writer.WritePropertyName("keyObjectName"u8); - writer.WriteStringValue(KeyObjectName); - } - if (Optional.IsDefined(RootCertObjectName)) - { - writer.WritePropertyName("rootCertObjectName"u8); - writer.WriteStringValue(RootCertObjectName); - } - if (Optional.IsDefined(CertChainObjectName)) - { - writer.WritePropertyName("certChainObjectName"u8); - writer.WriteStringValue(CertChainObjectName); - } - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - IstioPluginCertificateAuthority 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(IstioPluginCertificateAuthority)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeIstioPluginCertificateAuthority(document.RootElement, options); - } - - internal static IstioPluginCertificateAuthority DeserializeIstioPluginCertificateAuthority(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional keyVaultId = default; - Optional certObjectName = default; - Optional keyObjectName = default; - Optional rootCertObjectName = default; - Optional certChainObjectName = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("keyVaultId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - keyVaultId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("certObjectName"u8)) - { - certObjectName = property.Value.GetString(); - continue; - } - if (property.NameEquals("keyObjectName"u8)) - { - keyObjectName = property.Value.GetString(); - continue; - } - if (property.NameEquals("rootCertObjectName"u8)) - { - rootCertObjectName = property.Value.GetString(); - continue; - } - if (property.NameEquals("certChainObjectName"u8)) - { - certChainObjectName = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new IstioPluginCertificateAuthority(keyVaultId.Value, certObjectName.Value, keyObjectName.Value, rootCertObjectName.Value, certChainObjectName.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(IstioPluginCertificateAuthority)} does not support '{options.Format}' format."); - } - } - - IstioPluginCertificateAuthority 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); - return DeserializeIstioPluginCertificateAuthority(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(IstioPluginCertificateAuthority)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioPluginCertificateAuthority.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioPluginCertificateAuthority.cs deleted file mode 100644 index c73d47b11e412..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioPluginCertificateAuthority.cs +++ /dev/null @@ -1,82 +0,0 @@ -// 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.ContainerService.Models -{ - /// Plugin certificates information for Service Mesh. - public partial class IstioPluginCertificateAuthority - { - /// - /// 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 IstioPluginCertificateAuthority() - { - } - - /// Initializes a new instance of . - /// The resource ID of the Key Vault. - /// Intermediate certificate object name in Azure Key Vault. - /// Intermediate certificate private key object name in Azure Key Vault. - /// Root certificate object name in Azure Key Vault. - /// Certificate chain object name in Azure Key Vault. - /// Keeps track of any properties unknown to the library. - internal IstioPluginCertificateAuthority(ResourceIdentifier keyVaultId, string certObjectName, string keyObjectName, string rootCertObjectName, string certChainObjectName, IDictionary serializedAdditionalRawData) - { - KeyVaultId = keyVaultId; - CertObjectName = certObjectName; - KeyObjectName = keyObjectName; - RootCertObjectName = rootCertObjectName; - CertChainObjectName = certChainObjectName; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The resource ID of the Key Vault. - public ResourceIdentifier KeyVaultId { get; set; } - /// Intermediate certificate object name in Azure Key Vault. - public string CertObjectName { get; set; } - /// Intermediate certificate private key object name in Azure Key Vault. - public string KeyObjectName { get; set; } - /// Root certificate object name in Azure Key Vault. - public string RootCertObjectName { get; set; } - /// Certificate chain object name in Azure Key Vault. - public string CertChainObjectName { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioServiceMesh.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioServiceMesh.Serialization.cs deleted file mode 100644 index 1e362466b5a77..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioServiceMesh.Serialization.cs +++ /dev/null @@ -1,166 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class IstioServiceMesh : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(IstioServiceMesh)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Components)) - { - writer.WritePropertyName("components"u8); - writer.WriteObjectValue(Components); - } - if (Optional.IsDefined(CertificateAuthority)) - { - writer.WritePropertyName("certificateAuthority"u8); - writer.WriteObjectValue(CertificateAuthority); - } - if (Optional.IsCollectionDefined(Revisions)) - { - writer.WritePropertyName("revisions"u8); - writer.WriteStartArray(); - foreach (var item in Revisions) - { - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - IstioServiceMesh 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(IstioServiceMesh)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeIstioServiceMesh(document.RootElement, options); - } - - internal static IstioServiceMesh DeserializeIstioServiceMesh(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional components = default; - Optional certificateAuthority = default; - Optional> revisions = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("components"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - components = IstioComponents.DeserializeIstioComponents(property.Value); - continue; - } - if (property.NameEquals("certificateAuthority"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - certificateAuthority = IstioCertificateAuthority.DeserializeIstioCertificateAuthority(property.Value); - continue; - } - if (property.NameEquals("revisions"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - revisions = array; - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new IstioServiceMesh(components.Value, certificateAuthority.Value, Optional.ToList(revisions), 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(IstioServiceMesh)} does not support '{options.Format}' format."); - } - } - - IstioServiceMesh 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); - return DeserializeIstioServiceMesh(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(IstioServiceMesh)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioServiceMesh.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioServiceMesh.cs deleted file mode 100644 index e926c08eac369..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioServiceMesh.cs +++ /dev/null @@ -1,87 +0,0 @@ -// 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.ContainerService.Models -{ - /// Istio service mesh configuration. - public partial class IstioServiceMesh - { - /// - /// 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 IstioServiceMesh() - { - Revisions = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Istio components configuration. - /// Istio Service Mesh Certificate Authority (CA) configuration. For now, we only support plugin certificates as described here https://aka.ms/asm-plugin-ca. - /// The list of revisions of the Istio control plane. When an upgrade is not in progress, this holds one value. When canary upgrade is in progress, this can only hold two consecutive values. For more information, see: https://learn.microsoft.com/en-us/azure/aks/istio-upgrade. - /// Keeps track of any properties unknown to the library. - internal IstioServiceMesh(IstioComponents components, IstioCertificateAuthority certificateAuthority, IList revisions, IDictionary serializedAdditionalRawData) - { - Components = components; - CertificateAuthority = certificateAuthority; - Revisions = revisions; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Istio components configuration. - public IstioComponents Components { get; set; } - /// Istio Service Mesh Certificate Authority (CA) configuration. For now, we only support plugin certificates as described here https://aka.ms/asm-plugin-ca. - internal IstioCertificateAuthority CertificateAuthority { get; set; } - /// Plugin certificates information for Service Mesh. - public IstioPluginCertificateAuthority CertificateAuthorityPlugin - { - get => CertificateAuthority is null ? default : CertificateAuthority.Plugin; - set - { - if (CertificateAuthority is null) - CertificateAuthority = new IstioCertificateAuthority(); - CertificateAuthority.Plugin = value; - } - } - - /// The list of revisions of the Istio control plane. When an upgrade is not in progress, this holds one value. When canary upgrade is in progress, this can only hold two consecutive values. For more information, see: https://learn.microsoft.com/en-us/azure/aks/istio-upgrade. - public IList Revisions { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubeConfigFormat.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubeConfigFormat.cs deleted file mode 100644 index 53f94f36ab1ec..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubeConfigFormat.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The KubeConfigFormat. - public readonly partial struct KubeConfigFormat : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public KubeConfigFormat(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AzureValue = "azure"; - private const string ExecValue = "exec"; - - /// Return azure auth-provider kubeconfig. This format is deprecated in v1.22 and will be fully removed in v1.26. See: https://aka.ms/k8s/changes-1-26. - public static KubeConfigFormat Azure { get; } = new KubeConfigFormat(AzureValue); - /// Return exec format kubeconfig. This format requires kubelogin binary in the path. - public static KubeConfigFormat Exec { get; } = new KubeConfigFormat(ExecValue); - /// Determines if two values are the same. - public static bool operator ==(KubeConfigFormat left, KubeConfigFormat right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(KubeConfigFormat left, KubeConfigFormat right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator KubeConfigFormat(string value) => new KubeConfigFormat(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is KubeConfigFormat other && Equals(other); - /// - public bool Equals(KubeConfigFormat other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubeletConfig.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubeletConfig.Serialization.cs deleted file mode 100644 index 8da09281a52ab..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubeletConfig.Serialization.cs +++ /dev/null @@ -1,274 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class KubeletConfig : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(KubeletConfig)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(CpuManagerPolicy)) - { - writer.WritePropertyName("cpuManagerPolicy"u8); - writer.WriteStringValue(CpuManagerPolicy); - } - if (Optional.IsDefined(IsCpuCfsQuotaEnabled)) - { - writer.WritePropertyName("cpuCfsQuota"u8); - writer.WriteBooleanValue(IsCpuCfsQuotaEnabled.Value); - } - if (Optional.IsDefined(CpuCfsQuotaPeriod)) - { - writer.WritePropertyName("cpuCfsQuotaPeriod"u8); - writer.WriteStringValue(CpuCfsQuotaPeriod); - } - if (Optional.IsDefined(ImageGcHighThreshold)) - { - writer.WritePropertyName("imageGcHighThreshold"u8); - writer.WriteNumberValue(ImageGcHighThreshold.Value); - } - if (Optional.IsDefined(ImageGcLowThreshold)) - { - writer.WritePropertyName("imageGcLowThreshold"u8); - writer.WriteNumberValue(ImageGcLowThreshold.Value); - } - if (Optional.IsDefined(TopologyManagerPolicy)) - { - writer.WritePropertyName("topologyManagerPolicy"u8); - writer.WriteStringValue(TopologyManagerPolicy); - } - if (Optional.IsCollectionDefined(AllowedUnsafeSysctls)) - { - writer.WritePropertyName("allowedUnsafeSysctls"u8); - writer.WriteStartArray(); - foreach (var item in AllowedUnsafeSysctls) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(FailStartWithSwapOn)) - { - writer.WritePropertyName("failSwapOn"u8); - writer.WriteBooleanValue(FailStartWithSwapOn.Value); - } - if (Optional.IsDefined(ContainerLogMaxSizeInMB)) - { - writer.WritePropertyName("containerLogMaxSizeMB"u8); - writer.WriteNumberValue(ContainerLogMaxSizeInMB.Value); - } - if (Optional.IsDefined(ContainerLogMaxFiles)) - { - writer.WritePropertyName("containerLogMaxFiles"u8); - writer.WriteNumberValue(ContainerLogMaxFiles.Value); - } - if (Optional.IsDefined(PodMaxPids)) - { - writer.WritePropertyName("podMaxPids"u8); - writer.WriteNumberValue(PodMaxPids.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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - KubeletConfig 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(KubeletConfig)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeKubeletConfig(document.RootElement, options); - } - - internal static KubeletConfig DeserializeKubeletConfig(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional cpuManagerPolicy = default; - Optional cpuCfsQuota = default; - Optional cpuCfsQuotaPeriod = default; - Optional imageGcHighThreshold = default; - Optional imageGcLowThreshold = default; - Optional topologyManagerPolicy = default; - Optional> allowedUnsafeSysctls = default; - Optional failSwapOn = default; - Optional containerLogMaxSizeMB = default; - Optional containerLogMaxFiles = default; - Optional podMaxPids = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("cpuManagerPolicy"u8)) - { - cpuManagerPolicy = property.Value.GetString(); - continue; - } - if (property.NameEquals("cpuCfsQuota"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - cpuCfsQuota = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("cpuCfsQuotaPeriod"u8)) - { - cpuCfsQuotaPeriod = property.Value.GetString(); - continue; - } - if (property.NameEquals("imageGcHighThreshold"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - imageGcHighThreshold = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("imageGcLowThreshold"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - imageGcLowThreshold = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("topologyManagerPolicy"u8)) - { - topologyManagerPolicy = property.Value.GetString(); - continue; - } - if (property.NameEquals("allowedUnsafeSysctls"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - allowedUnsafeSysctls = array; - continue; - } - if (property.NameEquals("failSwapOn"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - failSwapOn = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("containerLogMaxSizeMB"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - containerLogMaxSizeMB = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("containerLogMaxFiles"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - containerLogMaxFiles = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("podMaxPids"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - podMaxPids = property.Value.GetInt32(); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new KubeletConfig(cpuManagerPolicy.Value, Optional.ToNullable(cpuCfsQuota), cpuCfsQuotaPeriod.Value, Optional.ToNullable(imageGcHighThreshold), Optional.ToNullable(imageGcLowThreshold), topologyManagerPolicy.Value, Optional.ToList(allowedUnsafeSysctls), Optional.ToNullable(failSwapOn), Optional.ToNullable(containerLogMaxSizeMB), Optional.ToNullable(containerLogMaxFiles), Optional.ToNullable(podMaxPids), 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(KubeletConfig)} does not support '{options.Format}' format."); - } - } - - KubeletConfig 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); - return DeserializeKubeletConfig(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(KubeletConfig)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubeletConfig.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubeletConfig.cs deleted file mode 100644 index 0cd2a21eb91c7..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubeletConfig.cs +++ /dev/null @@ -1,107 +0,0 @@ -// 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.ContainerService.Models -{ - /// See [AKS custom node configuration](https://docs.microsoft.com/azure/aks/custom-node-configuration) for more details. - public partial class KubeletConfig - { - /// - /// 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 KubeletConfig() - { - AllowedUnsafeSysctls = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// The default is 'none'. See [Kubernetes CPU management policies](https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/#cpu-management-policies) for more information. Allowed values are 'none' and 'static'. - /// The default is true. - /// The default is '100ms.' Valid values are a sequence of decimal numbers with an optional fraction and a unit suffix. For example: '300ms', '2h45m'. Supported units are 'ns', 'us', 'ms', 's', 'm', and 'h'. - /// To disable image garbage collection, set to 100. The default is 85%. - /// This cannot be set higher than imageGcHighThreshold. The default is 80%. - /// For more information see [Kubernetes Topology Manager](https://kubernetes.io/docs/tasks/administer-cluster/topology-manager). The default is 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. - /// Allowed list of unsafe sysctls or unsafe sysctl patterns (ending in `*`). - /// If set to true it will make the Kubelet fail to start if swap is enabled on the node. - /// The maximum size (e.g. 10Mi) of container log file before it is rotated. - /// The maximum number of container log files that can be present for a container. The number must be ≥ 2. - /// The maximum number of processes per pod. - /// Keeps track of any properties unknown to the library. - internal KubeletConfig(string cpuManagerPolicy, bool? isCpuCfsQuotaEnabled, string cpuCfsQuotaPeriod, int? imageGcHighThreshold, int? imageGcLowThreshold, string topologyManagerPolicy, IList allowedUnsafeSysctls, bool? failStartWithSwapOn, int? containerLogMaxSizeInMB, int? containerLogMaxFiles, int? podMaxPids, IDictionary serializedAdditionalRawData) - { - CpuManagerPolicy = cpuManagerPolicy; - IsCpuCfsQuotaEnabled = isCpuCfsQuotaEnabled; - CpuCfsQuotaPeriod = cpuCfsQuotaPeriod; - ImageGcHighThreshold = imageGcHighThreshold; - ImageGcLowThreshold = imageGcLowThreshold; - TopologyManagerPolicy = topologyManagerPolicy; - AllowedUnsafeSysctls = allowedUnsafeSysctls; - FailStartWithSwapOn = failStartWithSwapOn; - ContainerLogMaxSizeInMB = containerLogMaxSizeInMB; - ContainerLogMaxFiles = containerLogMaxFiles; - PodMaxPids = podMaxPids; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The default is 'none'. See [Kubernetes CPU management policies](https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/#cpu-management-policies) for more information. Allowed values are 'none' and 'static'. - public string CpuManagerPolicy { get; set; } - /// The default is true. - public bool? IsCpuCfsQuotaEnabled { get; set; } - /// The default is '100ms.' Valid values are a sequence of decimal numbers with an optional fraction and a unit suffix. For example: '300ms', '2h45m'. Supported units are 'ns', 'us', 'ms', 's', 'm', and 'h'. - public string CpuCfsQuotaPeriod { get; set; } - /// To disable image garbage collection, set to 100. The default is 85%. - public int? ImageGcHighThreshold { get; set; } - /// This cannot be set higher than imageGcHighThreshold. The default is 80%. - public int? ImageGcLowThreshold { get; set; } - /// For more information see [Kubernetes Topology Manager](https://kubernetes.io/docs/tasks/administer-cluster/topology-manager). The default is 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. - public string TopologyManagerPolicy { get; set; } - /// Allowed list of unsafe sysctls or unsafe sysctl patterns (ending in `*`). - public IList AllowedUnsafeSysctls { get; } - /// If set to true it will make the Kubelet fail to start if swap is enabled on the node. - public bool? FailStartWithSwapOn { get; set; } - /// The maximum size (e.g. 10Mi) of container log file before it is rotated. - public int? ContainerLogMaxSizeInMB { get; set; } - /// The maximum number of container log files that can be present for a container. The number must be ≥ 2. - public int? ContainerLogMaxFiles { get; set; } - /// The maximum number of processes per pod. - public int? PodMaxPids { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubeletDiskType.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubeletDiskType.cs deleted file mode 100644 index 8638bf3c6c349..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubeletDiskType.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. - public readonly partial struct KubeletDiskType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public KubeletDiskType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string OSValue = "OS"; - private const string TemporaryValue = "Temporary"; - - /// Kubelet will use the OS disk for its data. - public static KubeletDiskType OS { get; } = new KubeletDiskType(OSValue); - /// Kubelet will use the temporary disk for its data. - public static KubeletDiskType Temporary { get; } = new KubeletDiskType(TemporaryValue); - /// Determines if two values are the same. - public static bool operator ==(KubeletDiskType left, KubeletDiskType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(KubeletDiskType left, KubeletDiskType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator KubeletDiskType(string value) => new KubeletDiskType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is KubeletDiskType other && Equals(other); - /// - public bool Equals(KubeletDiskType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesPatchVersion.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesPatchVersion.cs deleted file mode 100644 index 4ae44b4507cd9..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesPatchVersion.cs +++ /dev/null @@ -1,67 +0,0 @@ -// 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.ContainerService.Models -{ - /// Kubernetes patch version profile. - public partial class KubernetesPatchVersion - { - /// - /// 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 KubernetesPatchVersion() - { - Upgrades = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Possible upgrade path for given patch version. - /// Keeps track of any properties unknown to the library. - internal KubernetesPatchVersion(IReadOnlyList upgrades, IDictionary serializedAdditionalRawData) - { - Upgrades = upgrades; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Possible upgrade path for given patch version. - public IReadOnlyList Upgrades { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesSupportPlan.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesSupportPlan.cs deleted file mode 100644 index 965276809f7b3..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesSupportPlan.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Different support tiers for AKS managed clusters. - public readonly partial struct KubernetesSupportPlan : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public KubernetesSupportPlan(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string KubernetesOfficialValue = "KubernetesOfficial"; - private const string AKSLongTermSupportValue = "AKSLongTermSupport"; - - /// Support for the version is the same as for the open source Kubernetes offering. Official Kubernetes open source community support versions for 1 year after release. - public static KubernetesSupportPlan KubernetesOfficial { get; } = new KubernetesSupportPlan(KubernetesOfficialValue); - /// Support for the version extended past the KubernetesOfficial support of 1 year. AKS continues to patch CVEs for another 1 year, for a total of 2 years of support. - public static KubernetesSupportPlan AKSLongTermSupport { get; } = new KubernetesSupportPlan(AKSLongTermSupportValue); - /// Determines if two values are the same. - public static bool operator ==(KubernetesSupportPlan left, KubernetesSupportPlan right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(KubernetesSupportPlan left, KubernetesSupportPlan right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator KubernetesSupportPlan(string value) => new KubernetesSupportPlan(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is KubernetesSupportPlan other && Equals(other); - /// - public bool Equals(KubernetesSupportPlan other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersion.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersion.cs deleted file mode 100644 index 6cc265351e707..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersion.cs +++ /dev/null @@ -1,85 +0,0 @@ -// 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.ContainerService.Models -{ - /// Kubernetes version profile for given major.minor release. - public partial class KubernetesVersion - { - /// - /// 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 KubernetesVersion() - { - PatchVersions = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of . - /// major.minor version of Kubernetes release. - /// Capabilities on this Kubernetes version. - /// Whether this version is in preview mode. - /// Patch versions of Kubernetes release. - /// Keeps track of any properties unknown to the library. - internal KubernetesVersion(string version, KubernetesVersionCapabilities capabilities, bool? isPreview, IReadOnlyDictionary patchVersions, IDictionary serializedAdditionalRawData) - { - Version = version; - Capabilities = capabilities; - IsPreview = isPreview; - PatchVersions = patchVersions; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// major.minor version of Kubernetes release. - public string Version { get; } - /// Capabilities on this Kubernetes version. - internal KubernetesVersionCapabilities Capabilities { get; } - /// Gets the capabilities support plan. - public IReadOnlyList CapabilitiesSupportPlan - { - get => Capabilities?.SupportPlan; - } - - /// Whether this version is in preview mode. - public bool? IsPreview { get; } - /// Patch versions of Kubernetes release. - public IReadOnlyDictionary PatchVersions { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersionCapabilities.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersionCapabilities.Serialization.cs deleted file mode 100644 index d3f0fba06b479..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersionCapabilities.Serialization.cs +++ /dev/null @@ -1,136 +0,0 @@ -// 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.ContainerService.Models -{ - internal partial class KubernetesVersionCapabilities : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(KubernetesVersionCapabilities)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(SupportPlan)) - { - writer.WritePropertyName("supportPlan"u8); - writer.WriteStartArray(); - foreach (var item in SupportPlan) - { - writer.WriteStringValue(item.ToString()); - } - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - KubernetesVersionCapabilities 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(KubernetesVersionCapabilities)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeKubernetesVersionCapabilities(document.RootElement, options); - } - - internal static KubernetesVersionCapabilities DeserializeKubernetesVersionCapabilities(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> supportPlan = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("supportPlan"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(new KubernetesSupportPlan(item.GetString())); - } - supportPlan = array; - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new KubernetesVersionCapabilities(Optional.ToList(supportPlan), 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(KubernetesVersionCapabilities)} does not support '{options.Format}' format."); - } - } - - KubernetesVersionCapabilities 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); - return DeserializeKubernetesVersionCapabilities(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(KubernetesVersionCapabilities)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersionCapabilities.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersionCapabilities.cs deleted file mode 100644 index a20daeb560a2e..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersionCapabilities.cs +++ /dev/null @@ -1,67 +0,0 @@ -// 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.ContainerService.Models -{ - /// Capabilities on this Kubernetes version. - internal partial class KubernetesVersionCapabilities - { - /// - /// 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 KubernetesVersionCapabilities() - { - SupportPlan = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// - /// Keeps track of any properties unknown to the library. - internal KubernetesVersionCapabilities(IReadOnlyList supportPlan, IDictionary serializedAdditionalRawData) - { - SupportPlan = supportPlan; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Gets the support plan. - public IReadOnlyList SupportPlan { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersionListResult.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersionListResult.Serialization.cs deleted file mode 100644 index b55627ac02ac2..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersionListResult.Serialization.cs +++ /dev/null @@ -1,136 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class KubernetesVersionListResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(KubernetesVersionListResult)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Values)) - { - writer.WritePropertyName("values"u8); - writer.WriteStartArray(); - foreach (var item in Values) - { - writer.WriteObjectValue(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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - KubernetesVersionListResult 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(KubernetesVersionListResult)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeKubernetesVersionListResult(document.RootElement, options); - } - - internal static KubernetesVersionListResult DeserializeKubernetesVersionListResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> values = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("values"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(KubernetesVersion.DeserializeKubernetesVersion(item)); - } - values = array; - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new KubernetesVersionListResult(Optional.ToList(values), 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(KubernetesVersionListResult)} does not support '{options.Format}' format."); - } - } - - KubernetesVersionListResult 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); - return DeserializeKubernetesVersionListResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(KubernetesVersionListResult)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/LinuxOSConfig.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/LinuxOSConfig.Serialization.cs deleted file mode 100644 index f343915ca3618..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/LinuxOSConfig.Serialization.cs +++ /dev/null @@ -1,163 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class LinuxOSConfig : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(LinuxOSConfig)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Sysctls)) - { - writer.WritePropertyName("sysctls"u8); - writer.WriteObjectValue(Sysctls); - } - if (Optional.IsDefined(TransparentHugePageEnabled)) - { - writer.WritePropertyName("transparentHugePageEnabled"u8); - writer.WriteStringValue(TransparentHugePageEnabled); - } - if (Optional.IsDefined(TransparentHugePageDefrag)) - { - writer.WritePropertyName("transparentHugePageDefrag"u8); - writer.WriteStringValue(TransparentHugePageDefrag); - } - if (Optional.IsDefined(SwapFileSizeInMB)) - { - writer.WritePropertyName("swapFileSizeMB"u8); - writer.WriteNumberValue(SwapFileSizeInMB.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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - LinuxOSConfig 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(LinuxOSConfig)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeLinuxOSConfig(document.RootElement, options); - } - - internal static LinuxOSConfig DeserializeLinuxOSConfig(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional sysctls = default; - Optional transparentHugePageEnabled = default; - Optional transparentHugePageDefrag = default; - Optional swapFileSizeMB = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("sysctls"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - sysctls = SysctlConfig.DeserializeSysctlConfig(property.Value); - continue; - } - if (property.NameEquals("transparentHugePageEnabled"u8)) - { - transparentHugePageEnabled = property.Value.GetString(); - continue; - } - if (property.NameEquals("transparentHugePageDefrag"u8)) - { - transparentHugePageDefrag = property.Value.GetString(); - continue; - } - if (property.NameEquals("swapFileSizeMB"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - swapFileSizeMB = property.Value.GetInt32(); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new LinuxOSConfig(sysctls.Value, transparentHugePageEnabled.Value, transparentHugePageDefrag.Value, Optional.ToNullable(swapFileSizeMB), 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(LinuxOSConfig)} does not support '{options.Format}' format."); - } - } - - LinuxOSConfig 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); - return DeserializeLinuxOSConfig(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(LinuxOSConfig)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/LinuxOSConfig.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/LinuxOSConfig.cs deleted file mode 100644 index ef69a04378768..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/LinuxOSConfig.cs +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// See [AKS custom node configuration](https://docs.microsoft.com/azure/aks/custom-node-configuration) for more details. - public partial class LinuxOSConfig - { - /// - /// 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 LinuxOSConfig() - { - } - - /// Initializes a new instance of . - /// Sysctl settings for Linux agent nodes. - /// Valid values are 'always', 'madvise', and 'never'. The default is 'always'. For more information see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge). - /// Valid values are 'always', 'defer', 'defer+madvise', 'madvise' and 'never'. The default is 'madvise'. For more information see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge). - /// The size in MB of a swap file that will be created on each node. - /// Keeps track of any properties unknown to the library. - internal LinuxOSConfig(SysctlConfig sysctls, string transparentHugePageEnabled, string transparentHugePageDefrag, int? swapFileSizeInMB, IDictionary serializedAdditionalRawData) - { - Sysctls = sysctls; - TransparentHugePageEnabled = transparentHugePageEnabled; - TransparentHugePageDefrag = transparentHugePageDefrag; - SwapFileSizeInMB = swapFileSizeInMB; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Sysctl settings for Linux agent nodes. - public SysctlConfig Sysctls { get; set; } - /// Valid values are 'always', 'madvise', and 'never'. The default is 'always'. For more information see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge). - public string TransparentHugePageEnabled { get; set; } - /// Valid values are 'always', 'defer', 'defer+madvise', 'madvise' and 'never'. The default is 'madvise'. For more information see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge). - public string TransparentHugePageDefrag { get; set; } - /// The size in MB of a swap file that will be created on each node. - public int? SwapFileSizeInMB { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAadProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAadProfile.Serialization.cs deleted file mode 100644 index a5c3e55ab4079..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAadProfile.Serialization.cs +++ /dev/null @@ -1,222 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class ManagedClusterAadProfile : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterAadProfile)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(IsManagedAadEnabled)) - { - writer.WritePropertyName("managed"u8); - writer.WriteBooleanValue(IsManagedAadEnabled.Value); - } - if (Optional.IsDefined(IsAzureRbacEnabled)) - { - writer.WritePropertyName("enableAzureRBAC"u8); - writer.WriteBooleanValue(IsAzureRbacEnabled.Value); - } - if (Optional.IsCollectionDefined(AdminGroupObjectIds)) - { - writer.WritePropertyName("adminGroupObjectIDs"u8); - writer.WriteStartArray(); - foreach (var item in AdminGroupObjectIds) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(ClientAppId)) - { - writer.WritePropertyName("clientAppID"u8); - writer.WriteStringValue(ClientAppId.Value); - } - if (Optional.IsDefined(ServerAppId)) - { - writer.WritePropertyName("serverAppID"u8); - writer.WriteStringValue(ServerAppId.Value); - } - if (Optional.IsDefined(ServerAppSecret)) - { - writer.WritePropertyName("serverAppSecret"u8); - writer.WriteStringValue(ServerAppSecret); - } - if (Optional.IsDefined(TenantId)) - { - writer.WritePropertyName("tenantID"u8); - writer.WriteStringValue(TenantId.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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterAadProfile 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(ManagedClusterAadProfile)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterAadProfile(document.RootElement, options); - } - - internal static ManagedClusterAadProfile DeserializeManagedClusterAadProfile(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional managed = default; - Optional enableAzureRBAC = default; - Optional> adminGroupObjectIds = default; - Optional clientAppId = default; - Optional serverAppId = default; - Optional serverAppSecret = default; - Optional tenantId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("managed"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - managed = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("enableAzureRBAC"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableAzureRBAC = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("adminGroupObjectIDs"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetGuid()); - } - adminGroupObjectIds = array; - continue; - } - if (property.NameEquals("clientAppID"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - clientAppId = property.Value.GetGuid(); - continue; - } - if (property.NameEquals("serverAppID"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - serverAppId = property.Value.GetGuid(); - continue; - } - if (property.NameEquals("serverAppSecret"u8)) - { - serverAppSecret = property.Value.GetString(); - continue; - } - if (property.NameEquals("tenantID"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - tenantId = property.Value.GetGuid(); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterAadProfile(Optional.ToNullable(managed), Optional.ToNullable(enableAzureRBAC), Optional.ToList(adminGroupObjectIds), Optional.ToNullable(clientAppId), Optional.ToNullable(serverAppId), serverAppSecret.Value, Optional.ToNullable(tenantId), 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(ManagedClusterAadProfile)} does not support '{options.Format}' format."); - } - } - - ManagedClusterAadProfile 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); - return DeserializeManagedClusterAadProfile(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterAadProfile)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAadProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAadProfile.cs deleted file mode 100644 index 8ded8df5fb193..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAadProfile.cs +++ /dev/null @@ -1,91 +0,0 @@ -// 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.ContainerService.Models -{ - /// For more details see [managed AAD on AKS](https://docs.microsoft.com/azure/aks/managed-aad). - public partial class ManagedClusterAadProfile - { - /// - /// 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 ManagedClusterAadProfile() - { - AdminGroupObjectIds = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Whether to enable managed AAD. - /// Whether to enable Azure RBAC for Kubernetes authorization. - /// The list of AAD group object IDs that will have admin role of the cluster. - /// (DEPRECATED) The client AAD application ID. Learn more at https://aka.ms/aks/aad-legacy. - /// (DEPRECATED) The server AAD application ID. Learn more at https://aka.ms/aks/aad-legacy. - /// (DEPRECATED) The server AAD application secret. Learn more at https://aka.ms/aks/aad-legacy. - /// The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterAadProfile(bool? isManagedAadEnabled, bool? isAzureRbacEnabled, IList adminGroupObjectIds, Guid? clientAppId, Guid? serverAppId, string serverAppSecret, Guid? tenantId, IDictionary serializedAdditionalRawData) - { - IsManagedAadEnabled = isManagedAadEnabled; - IsAzureRbacEnabled = isAzureRbacEnabled; - AdminGroupObjectIds = adminGroupObjectIds; - ClientAppId = clientAppId; - ServerAppId = serverAppId; - ServerAppSecret = serverAppSecret; - TenantId = tenantId; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Whether to enable managed AAD. - public bool? IsManagedAadEnabled { get; set; } - /// Whether to enable Azure RBAC for Kubernetes authorization. - public bool? IsAzureRbacEnabled { get; set; } - /// The list of AAD group object IDs that will have admin role of the cluster. - public IList AdminGroupObjectIds { get; } - /// (DEPRECATED) The client AAD application ID. Learn more at https://aka.ms/aks/aad-legacy. - public Guid? ClientAppId { get; set; } - /// (DEPRECATED) The server AAD application ID. Learn more at https://aka.ms/aks/aad-legacy. - public Guid? ServerAppId { get; set; } - /// (DEPRECATED) The server AAD application secret. Learn more at https://aka.ms/aks/aad-legacy. - public string ServerAppSecret { get; set; } - /// The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. - public Guid? TenantId { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAccessProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAccessProfile.cs deleted file mode 100644 index 1ae4080acb645..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAccessProfile.cs +++ /dev/null @@ -1,79 +0,0 @@ -// 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.Models; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Managed cluster Access Profile. - public partial class ManagedClusterAccessProfile : 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 ManagedClusterAccessProfile(AzureLocation location) : base(location) - { - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// Base64-encoded Kubernetes configuration file. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterAccessProfile(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, byte[] kubeConfig, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) - { - KubeConfig = kubeConfig; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ManagedClusterAccessProfile() - { - } - - /// Base64-encoded Kubernetes configuration file. - public byte[] KubeConfig { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAddonProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAddonProfile.Serialization.cs deleted file mode 100644 index 5071b628b962e..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAddonProfile.Serialization.cs +++ /dev/null @@ -1,160 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class ManagedClusterAddonProfile : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterAddonProfile)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(IsEnabled); - if (Optional.IsCollectionDefined(Config)) - { - writer.WritePropertyName("config"u8); - writer.WriteStartObject(); - foreach (var item in Config) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - if (options.Format != "W" && Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - writer.WriteObjectValue(Identity); - } - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterAddonProfile 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(ManagedClusterAddonProfile)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterAddonProfile(document.RootElement, options); - } - - internal static ManagedClusterAddonProfile DeserializeManagedClusterAddonProfile(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - bool enabled = default; - Optional> config = default; - Optional identity = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("enabled"u8)) - { - enabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("config"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()); - } - config = dictionary; - continue; - } - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - identity = ManagedClusterAddonProfileIdentity.DeserializeManagedClusterAddonProfileIdentity(property.Value); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterAddonProfile(enabled, Optional.ToDictionary(config), identity.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(ManagedClusterAddonProfile)} does not support '{options.Format}' format."); - } - } - - ManagedClusterAddonProfile 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); - return DeserializeManagedClusterAddonProfile(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterAddonProfile)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAddonProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAddonProfile.cs deleted file mode 100644 index 134b77271b83e..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAddonProfile.cs +++ /dev/null @@ -1,82 +0,0 @@ -// 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.ContainerService.Models -{ - /// A Kubernetes add-on profile for a managed cluster. - public partial class ManagedClusterAddonProfile - { - /// - /// 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 . - /// Whether the add-on is enabled or not. - public ManagedClusterAddonProfile(bool isEnabled) - { - IsEnabled = isEnabled; - Config = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of . - /// Whether the add-on is enabled or not. - /// Key-value pairs for configuring an add-on. - /// Information of user assigned identity used by this add-on. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterAddonProfile(bool isEnabled, IDictionary config, ManagedClusterAddonProfileIdentity identity, IDictionary serializedAdditionalRawData) - { - IsEnabled = isEnabled; - Config = config; - Identity = identity; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ManagedClusterAddonProfile() - { - } - - /// Whether the add-on is enabled or not. - public bool IsEnabled { get; set; } - /// Key-value pairs for configuring an add-on. - public IDictionary Config { get; } - /// Information of user assigned identity used by this add-on. - public ManagedClusterAddonProfileIdentity Identity { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAddonProfileIdentity.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAddonProfileIdentity.Serialization.cs deleted file mode 100644 index b129c196fc65f..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAddonProfileIdentity.Serialization.cs +++ /dev/null @@ -1,156 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class ManagedClusterAddonProfileIdentity : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterAddonProfileIdentity)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(ResourceId)) - { - writer.WritePropertyName("resourceId"u8); - writer.WriteStringValue(ResourceId); - } - if (Optional.IsDefined(ClientId)) - { - writer.WritePropertyName("clientId"u8); - writer.WriteStringValue(ClientId.Value); - } - if (Optional.IsDefined(ObjectId)) - { - writer.WritePropertyName("objectId"u8); - writer.WriteStringValue(ObjectId.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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterAddonProfileIdentity 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(ManagedClusterAddonProfileIdentity)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterAddonProfileIdentity(document.RootElement, options); - } - - internal static ManagedClusterAddonProfileIdentity DeserializeManagedClusterAddonProfileIdentity(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional resourceId = default; - Optional clientId = default; - Optional objectId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("resourceId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - resourceId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("clientId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - clientId = property.Value.GetGuid(); - continue; - } - if (property.NameEquals("objectId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - objectId = property.Value.GetGuid(); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterAddonProfileIdentity(resourceId.Value, Optional.ToNullable(clientId), Optional.ToNullable(objectId), 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(ManagedClusterAddonProfileIdentity)} does not support '{options.Format}' format."); - } - } - - ManagedClusterAddonProfileIdentity 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); - return DeserializeManagedClusterAddonProfileIdentity(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterAddonProfileIdentity)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAddonProfileIdentity.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAddonProfileIdentity.cs deleted file mode 100644 index 4ce9fa1c8e1d3..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAddonProfileIdentity.cs +++ /dev/null @@ -1,31 +0,0 @@ -// 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.ContainerService.Models -{ - /// Information of user assigned identity used by this add-on. - public partial class ManagedClusterAddonProfileIdentity : ContainerServiceUserAssignedIdentity - { - /// Initializes a new instance of . - public ManagedClusterAddonProfileIdentity() - { - } - - /// Initializes a new instance of . - /// The resource ID of the user assigned identity. - /// The client ID of the user assigned identity. - /// The object ID of the user assigned identity. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterAddonProfileIdentity(ResourceIdentifier resourceId, Guid? clientId, Guid? objectId, IDictionary serializedAdditionalRawData) : base(resourceId, clientId, objectId, serializedAdditionalRawData) - { - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.Serialization.cs deleted file mode 100644 index 4a9d614f3e67e..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.Serialization.cs +++ /dev/null @@ -1,786 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class ManagedClusterAgentPoolProfile : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterAgentPoolProfile)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - if (Optional.IsDefined(Count)) - { - writer.WritePropertyName("count"u8); - writer.WriteNumberValue(Count.Value); - } - if (Optional.IsDefined(VmSize)) - { - writer.WritePropertyName("vmSize"u8); - writer.WriteStringValue(VmSize); - } - if (Optional.IsDefined(OSDiskSizeInGB)) - { - writer.WritePropertyName("osDiskSizeGB"u8); - writer.WriteNumberValue(OSDiskSizeInGB.Value); - } - if (Optional.IsDefined(OSDiskType)) - { - writer.WritePropertyName("osDiskType"u8); - writer.WriteStringValue(OSDiskType.Value.ToString()); - } - if (Optional.IsDefined(KubeletDiskType)) - { - writer.WritePropertyName("kubeletDiskType"u8); - writer.WriteStringValue(KubeletDiskType.Value.ToString()); - } - if (Optional.IsDefined(WorkloadRuntime)) - { - writer.WritePropertyName("workloadRuntime"u8); - writer.WriteStringValue(WorkloadRuntime.Value.ToString()); - } - if (Optional.IsDefined(VnetSubnetId)) - { - writer.WritePropertyName("vnetSubnetID"u8); - writer.WriteStringValue(VnetSubnetId); - } - if (Optional.IsDefined(PodSubnetId)) - { - writer.WritePropertyName("podSubnetID"u8); - writer.WriteStringValue(PodSubnetId); - } - if (Optional.IsDefined(MaxPods)) - { - writer.WritePropertyName("maxPods"u8); - writer.WriteNumberValue(MaxPods.Value); - } - if (Optional.IsDefined(OSType)) - { - writer.WritePropertyName("osType"u8); - writer.WriteStringValue(OSType.Value.ToString()); - } - if (Optional.IsDefined(OSSku)) - { - writer.WritePropertyName("osSKU"u8); - writer.WriteStringValue(OSSku.Value.ToString()); - } - if (Optional.IsDefined(MaxCount)) - { - writer.WritePropertyName("maxCount"u8); - writer.WriteNumberValue(MaxCount.Value); - } - if (Optional.IsDefined(MinCount)) - { - writer.WritePropertyName("minCount"u8); - writer.WriteNumberValue(MinCount.Value); - } - if (Optional.IsDefined(EnableAutoScaling)) - { - writer.WritePropertyName("enableAutoScaling"u8); - writer.WriteBooleanValue(EnableAutoScaling.Value); - } - if (Optional.IsDefined(ScaleDownMode)) - { - writer.WritePropertyName("scaleDownMode"u8); - writer.WriteStringValue(ScaleDownMode.Value.ToString()); - } - if (Optional.IsDefined(AgentPoolType)) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(AgentPoolType.Value.ToString()); - } - if (Optional.IsDefined(Mode)) - { - writer.WritePropertyName("mode"u8); - writer.WriteStringValue(Mode.Value.ToString()); - } - if (Optional.IsDefined(OrchestratorVersion)) - { - writer.WritePropertyName("orchestratorVersion"u8); - writer.WriteStringValue(OrchestratorVersion); - } - if (options.Format != "W" && Optional.IsDefined(CurrentOrchestratorVersion)) - { - writer.WritePropertyName("currentOrchestratorVersion"u8); - writer.WriteStringValue(CurrentOrchestratorVersion); - } - if (options.Format != "W" && Optional.IsDefined(NodeImageVersion)) - { - writer.WritePropertyName("nodeImageVersion"u8); - writer.WriteStringValue(NodeImageVersion); - } - if (Optional.IsDefined(UpgradeSettings)) - { - writer.WritePropertyName("upgradeSettings"u8); - writer.WriteObjectValue(UpgradeSettings); - } - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState); - } - if (Optional.IsDefined(PowerState)) - { - writer.WritePropertyName("powerState"u8); - writer.WriteObjectValue(PowerState); - } - if (Optional.IsCollectionDefined(AvailabilityZones)) - { - writer.WritePropertyName("availabilityZones"u8); - writer.WriteStartArray(); - foreach (var item in AvailabilityZones) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(EnableNodePublicIP)) - { - writer.WritePropertyName("enableNodePublicIP"u8); - writer.WriteBooleanValue(EnableNodePublicIP.Value); - } - if (Optional.IsDefined(NodePublicIPPrefixId)) - { - writer.WritePropertyName("nodePublicIPPrefixID"u8); - writer.WriteStringValue(NodePublicIPPrefixId); - } - if (Optional.IsDefined(ScaleSetPriority)) - { - writer.WritePropertyName("scaleSetPriority"u8); - writer.WriteStringValue(ScaleSetPriority.Value.ToString()); - } - if (Optional.IsDefined(ScaleSetEvictionPolicy)) - { - writer.WritePropertyName("scaleSetEvictionPolicy"u8); - writer.WriteStringValue(ScaleSetEvictionPolicy.Value.ToString()); - } - if (Optional.IsDefined(SpotMaxPrice)) - { - writer.WritePropertyName("spotMaxPrice"u8); - writer.WriteNumberValue(SpotMaxPrice.Value); - } - 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.IsCollectionDefined(NodeLabels)) - { - writer.WritePropertyName("nodeLabels"u8); - writer.WriteStartObject(); - foreach (var item in NodeLabels) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - if (Optional.IsCollectionDefined(NodeTaints)) - { - writer.WritePropertyName("nodeTaints"u8); - writer.WriteStartArray(); - foreach (var item in NodeTaints) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(ProximityPlacementGroupId)) - { - writer.WritePropertyName("proximityPlacementGroupID"u8); - writer.WriteStringValue(ProximityPlacementGroupId); - } - if (Optional.IsDefined(KubeletConfig)) - { - writer.WritePropertyName("kubeletConfig"u8); - writer.WriteObjectValue(KubeletConfig); - } - if (Optional.IsDefined(LinuxOSConfig)) - { - writer.WritePropertyName("linuxOSConfig"u8); - writer.WriteObjectValue(LinuxOSConfig); - } - if (Optional.IsDefined(EnableEncryptionAtHost)) - { - writer.WritePropertyName("enableEncryptionAtHost"u8); - writer.WriteBooleanValue(EnableEncryptionAtHost.Value); - } - if (Optional.IsDefined(EnableUltraSsd)) - { - writer.WritePropertyName("enableUltraSSD"u8); - writer.WriteBooleanValue(EnableUltraSsd.Value); - } - if (Optional.IsDefined(EnableFips)) - { - writer.WritePropertyName("enableFIPS"u8); - writer.WriteBooleanValue(EnableFips.Value); - } - if (Optional.IsDefined(GpuInstanceProfile)) - { - writer.WritePropertyName("gpuInstanceProfile"u8); - writer.WriteStringValue(GpuInstanceProfile.Value.ToString()); - } - if (Optional.IsDefined(CreationData)) - { - writer.WritePropertyName("creationData"u8); - writer.WriteObjectValue(CreationData); - } - if (Optional.IsDefined(CapacityReservationGroupId)) - { - writer.WritePropertyName("capacityReservationGroupID"u8); - writer.WriteStringValue(CapacityReservationGroupId); - } - if (Optional.IsDefined(HostGroupId)) - { - writer.WritePropertyName("hostGroupID"u8); - writer.WriteStringValue(HostGroupId); - } - if (Optional.IsDefined(NetworkProfile)) - { - writer.WritePropertyName("networkProfile"u8); - writer.WriteObjectValue(NetworkProfile); - } - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterAgentPoolProfile 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(ManagedClusterAgentPoolProfile)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterAgentPoolProfile(document.RootElement, options); - } - - internal static ManagedClusterAgentPoolProfile DeserializeManagedClusterAgentPoolProfile(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string name = default; - Optional count = default; - Optional vmSize = default; - Optional osDiskSizeGB = default; - Optional osDiskType = default; - Optional kubeletDiskType = default; - Optional workloadRuntime = default; - Optional vnetSubnetId = default; - Optional podSubnetId = default; - Optional maxPods = default; - Optional osType = default; - Optional osSku = default; - Optional maxCount = default; - Optional minCount = default; - Optional enableAutoScaling = default; - Optional scaleDownMode = default; - Optional type = default; - Optional mode = default; - Optional orchestratorVersion = default; - Optional currentOrchestratorVersion = default; - Optional nodeImageVersion = default; - Optional upgradeSettings = default; - Optional provisioningState = default; - Optional powerState = default; - Optional> availabilityZones = default; - Optional enableNodePublicIP = default; - Optional nodePublicIPPrefixId = default; - Optional scaleSetPriority = default; - Optional scaleSetEvictionPolicy = default; - Optional spotMaxPrice = default; - Optional> tags = default; - Optional> nodeLabels = default; - Optional> nodeTaints = default; - Optional proximityPlacementGroupId = default; - Optional kubeletConfig = default; - Optional linuxOSConfig = default; - Optional enableEncryptionAtHost = default; - Optional enableUltraSsd = default; - Optional enableFIPS = default; - Optional gpuInstanceProfile = default; - Optional creationData = default; - Optional capacityReservationGroupId = default; - Optional hostGroupId = default; - Optional networkProfile = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("count"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - count = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("vmSize"u8)) - { - vmSize = property.Value.GetString(); - continue; - } - if (property.NameEquals("osDiskSizeGB"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - osDiskSizeGB = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("osDiskType"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - osDiskType = new ContainerServiceOSDiskType(property.Value.GetString()); - continue; - } - if (property.NameEquals("kubeletDiskType"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - kubeletDiskType = new KubeletDiskType(property.Value.GetString()); - continue; - } - if (property.NameEquals("workloadRuntime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - workloadRuntime = new WorkloadRuntime(property.Value.GetString()); - continue; - } - if (property.NameEquals("vnetSubnetID"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - vnetSubnetId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("podSubnetID"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - podSubnetId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("maxPods"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - maxPods = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("osType"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - osType = new ContainerServiceOSType(property.Value.GetString()); - continue; - } - if (property.NameEquals("osSKU"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - osSku = new ContainerServiceOSSku(property.Value.GetString()); - continue; - } - if (property.NameEquals("maxCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - maxCount = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("minCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - minCount = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("enableAutoScaling"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableAutoScaling = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("scaleDownMode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - scaleDownMode = new ScaleDownMode(property.Value.GetString()); - continue; - } - if (property.NameEquals("type"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - type = new AgentPoolType(property.Value.GetString()); - continue; - } - if (property.NameEquals("mode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - mode = new AgentPoolMode(property.Value.GetString()); - continue; - } - if (property.NameEquals("orchestratorVersion"u8)) - { - orchestratorVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("currentOrchestratorVersion"u8)) - { - currentOrchestratorVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("nodeImageVersion"u8)) - { - nodeImageVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("upgradeSettings"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - upgradeSettings = AgentPoolUpgradeSettings.DeserializeAgentPoolUpgradeSettings(property.Value); - continue; - } - if (property.NameEquals("provisioningState"u8)) - { - provisioningState = property.Value.GetString(); - continue; - } - if (property.NameEquals("powerState"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - powerState = ContainerServicePowerState.DeserializeContainerServicePowerState(property.Value); - continue; - } - if (property.NameEquals("availabilityZones"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - availabilityZones = array; - continue; - } - if (property.NameEquals("enableNodePublicIP"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableNodePublicIP = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("nodePublicIPPrefixID"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - nodePublicIPPrefixId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("scaleSetPriority"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - scaleSetPriority = new ScaleSetPriority(property.Value.GetString()); - continue; - } - if (property.NameEquals("scaleSetEvictionPolicy"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - scaleSetEvictionPolicy = new ScaleSetEvictionPolicy(property.Value.GetString()); - continue; - } - if (property.NameEquals("spotMaxPrice"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - spotMaxPrice = property.Value.GetSingle(); - 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("nodeLabels"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()); - } - nodeLabels = dictionary; - continue; - } - if (property.NameEquals("nodeTaints"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - nodeTaints = array; - continue; - } - if (property.NameEquals("proximityPlacementGroupID"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - proximityPlacementGroupId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("kubeletConfig"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - kubeletConfig = KubeletConfig.DeserializeKubeletConfig(property.Value); - continue; - } - if (property.NameEquals("linuxOSConfig"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - linuxOSConfig = LinuxOSConfig.DeserializeLinuxOSConfig(property.Value); - continue; - } - if (property.NameEquals("enableEncryptionAtHost"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableEncryptionAtHost = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("enableUltraSSD"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableUltraSsd = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("enableFIPS"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableFIPS = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("gpuInstanceProfile"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - gpuInstanceProfile = new GpuInstanceProfile(property.Value.GetString()); - continue; - } - if (property.NameEquals("creationData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - creationData = ContainerServiceCreationData.DeserializeContainerServiceCreationData(property.Value); - continue; - } - if (property.NameEquals("capacityReservationGroupID"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - capacityReservationGroupId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("hostGroupID"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - hostGroupId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("networkProfile"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - networkProfile = AgentPoolNetworkProfile.DeserializeAgentPoolNetworkProfile(property.Value); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterAgentPoolProfile(Optional.ToNullable(count), vmSize.Value, Optional.ToNullable(osDiskSizeGB), Optional.ToNullable(osDiskType), Optional.ToNullable(kubeletDiskType), Optional.ToNullable(workloadRuntime), vnetSubnetId.Value, podSubnetId.Value, Optional.ToNullable(maxPods), Optional.ToNullable(osType), Optional.ToNullable(osSku), Optional.ToNullable(maxCount), Optional.ToNullable(minCount), Optional.ToNullable(enableAutoScaling), Optional.ToNullable(scaleDownMode), Optional.ToNullable(type), Optional.ToNullable(mode), orchestratorVersion.Value, currentOrchestratorVersion.Value, nodeImageVersion.Value, upgradeSettings.Value, provisioningState.Value, powerState.Value, Optional.ToList(availabilityZones), Optional.ToNullable(enableNodePublicIP), nodePublicIPPrefixId.Value, Optional.ToNullable(scaleSetPriority), Optional.ToNullable(scaleSetEvictionPolicy), Optional.ToNullable(spotMaxPrice), Optional.ToDictionary(tags), Optional.ToDictionary(nodeLabels), Optional.ToList(nodeTaints), proximityPlacementGroupId.Value, kubeletConfig.Value, linuxOSConfig.Value, Optional.ToNullable(enableEncryptionAtHost), Optional.ToNullable(enableUltraSsd), Optional.ToNullable(enableFIPS), Optional.ToNullable(gpuInstanceProfile), creationData.Value, capacityReservationGroupId.Value, hostGroupId.Value, networkProfile.Value, serializedAdditionalRawData, name); - } - - 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(ManagedClusterAgentPoolProfile)} does not support '{options.Format}' format."); - } - } - - ManagedClusterAgentPoolProfile 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); - return DeserializeManagedClusterAgentPoolProfile(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterAgentPoolProfile)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.cs deleted file mode 100644 index b110730162b5d..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.cs +++ /dev/null @@ -1,86 +0,0 @@ -// 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.ContainerService.Models -{ - /// Profile for the container service agent pool. - public partial class ManagedClusterAgentPoolProfile : ManagedClusterAgentPoolProfileProperties - { - /// Initializes a new instance of . - /// Windows agent pool names must be 6 characters or less. - /// is null. - public ManagedClusterAgentPoolProfile(string name) - { - Argument.AssertNotNull(name, nameof(name)); - - Name = name; - } - - /// Initializes a new instance of . - /// Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. - /// VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. - /// OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. - /// The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). - /// Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. - /// Determines the type of workload a node can run. - /// If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - /// If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - /// The maximum number of pods that can run on a node. - /// The operating system type. The default is Linux. - /// Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows. - /// The maximum number of nodes for auto-scaling. - /// The minimum number of nodes for auto-scaling. - /// Whether to enable auto-scaler. - /// This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. - /// The type of Agent Pool. - /// A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools. - /// Both patch version <major.minor.patch> (e.g. 1.20.13) and <major.minor> (e.g. 1.20) are supported. When <major.minor> is specified, the latest supported GA patch version is chosen automatically. Updating the cluster with the same <major.minor> once it has been created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). - /// If orchestratorVersion is a fully specified version <major.minor.patch>, this field will be exactly equal to it. If orchestratorVersion is <major.minor>, this field will contain the full <major.minor.patch> version being used. - /// The version of node image. - /// Settings for upgrading the agentpool. - /// The current deployment or provisioning state. - /// When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded. - /// The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. - /// Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). The default is false. - /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. - /// The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. - /// This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. - /// Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing). - /// The tags to be persisted on the agent pool virtual machine scale set. - /// The node labels to be persisted across all nodes in agent pool. - /// The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - /// The ID for Proximity Placement Group. - /// The Kubelet configuration on the agent pool nodes. - /// The OS configuration of Linux agent nodes. - /// This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption. - /// Whether to enable UltraSSD. - /// See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more details. - /// GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. - /// CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot. - /// AKS will associate the specified agent pool with the Capacity Reservation Group. - /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts). - /// Network-related settings of an agent pool. - /// Keeps track of any properties unknown to the library. - /// Windows agent pool names must be 6 characters or less. - internal ManagedClusterAgentPoolProfile(int? count, string vmSize, int? osDiskSizeInGB, ContainerServiceOSDiskType? osDiskType, KubeletDiskType? kubeletDiskType, WorkloadRuntime? workloadRuntime, ResourceIdentifier vnetSubnetId, ResourceIdentifier podSubnetId, int? maxPods, ContainerServiceOSType? osType, ContainerServiceOSSku? osSku, int? maxCount, int? minCount, bool? enableAutoScaling, ScaleDownMode? scaleDownMode, AgentPoolType? agentPoolType, AgentPoolMode? mode, string orchestratorVersion, string currentOrchestratorVersion, string nodeImageVersion, AgentPoolUpgradeSettings upgradeSettings, string provisioningState, ContainerServicePowerState powerState, IList availabilityZones, bool? enableNodePublicIP, ResourceIdentifier nodePublicIPPrefixId, ScaleSetPriority? scaleSetPriority, ScaleSetEvictionPolicy? scaleSetEvictionPolicy, float? spotMaxPrice, IDictionary tags, IDictionary nodeLabels, IList nodeTaints, ResourceIdentifier proximityPlacementGroupId, KubeletConfig kubeletConfig, LinuxOSConfig linuxOSConfig, bool? enableEncryptionAtHost, bool? enableUltraSsd, bool? enableFips, GpuInstanceProfile? gpuInstanceProfile, ContainerServiceCreationData creationData, ResourceIdentifier capacityReservationGroupId, ResourceIdentifier hostGroupId, AgentPoolNetworkProfile networkProfile, IDictionary serializedAdditionalRawData, string name) : base(count, vmSize, osDiskSizeInGB, osDiskType, kubeletDiskType, workloadRuntime, vnetSubnetId, podSubnetId, maxPods, osType, osSku, maxCount, minCount, enableAutoScaling, scaleDownMode, agentPoolType, mode, orchestratorVersion, currentOrchestratorVersion, nodeImageVersion, upgradeSettings, provisioningState, powerState, availabilityZones, enableNodePublicIP, nodePublicIPPrefixId, scaleSetPriority, scaleSetEvictionPolicy, spotMaxPrice, tags, nodeLabels, nodeTaints, proximityPlacementGroupId, kubeletConfig, linuxOSConfig, enableEncryptionAtHost, enableUltraSsd, enableFips, gpuInstanceProfile, creationData, capacityReservationGroupId, hostGroupId, networkProfile, serializedAdditionalRawData) - { - Name = name; - } - - /// Initializes a new instance of for deserialization. - internal ManagedClusterAgentPoolProfile() - { - } - - /// Windows agent pool names must be 6 characters or less. - public string Name { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfileProperties.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfileProperties.Serialization.cs deleted file mode 100644 index 3247dd1ceb593..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfileProperties.Serialization.cs +++ /dev/null @@ -1,778 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class ManagedClusterAgentPoolProfileProperties : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterAgentPoolProfileProperties)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Count)) - { - writer.WritePropertyName("count"u8); - writer.WriteNumberValue(Count.Value); - } - if (Optional.IsDefined(VmSize)) - { - writer.WritePropertyName("vmSize"u8); - writer.WriteStringValue(VmSize); - } - if (Optional.IsDefined(OSDiskSizeInGB)) - { - writer.WritePropertyName("osDiskSizeGB"u8); - writer.WriteNumberValue(OSDiskSizeInGB.Value); - } - if (Optional.IsDefined(OSDiskType)) - { - writer.WritePropertyName("osDiskType"u8); - writer.WriteStringValue(OSDiskType.Value.ToString()); - } - if (Optional.IsDefined(KubeletDiskType)) - { - writer.WritePropertyName("kubeletDiskType"u8); - writer.WriteStringValue(KubeletDiskType.Value.ToString()); - } - if (Optional.IsDefined(WorkloadRuntime)) - { - writer.WritePropertyName("workloadRuntime"u8); - writer.WriteStringValue(WorkloadRuntime.Value.ToString()); - } - if (Optional.IsDefined(VnetSubnetId)) - { - writer.WritePropertyName("vnetSubnetID"u8); - writer.WriteStringValue(VnetSubnetId); - } - if (Optional.IsDefined(PodSubnetId)) - { - writer.WritePropertyName("podSubnetID"u8); - writer.WriteStringValue(PodSubnetId); - } - if (Optional.IsDefined(MaxPods)) - { - writer.WritePropertyName("maxPods"u8); - writer.WriteNumberValue(MaxPods.Value); - } - if (Optional.IsDefined(OSType)) - { - writer.WritePropertyName("osType"u8); - writer.WriteStringValue(OSType.Value.ToString()); - } - if (Optional.IsDefined(OSSku)) - { - writer.WritePropertyName("osSKU"u8); - writer.WriteStringValue(OSSku.Value.ToString()); - } - if (Optional.IsDefined(MaxCount)) - { - writer.WritePropertyName("maxCount"u8); - writer.WriteNumberValue(MaxCount.Value); - } - if (Optional.IsDefined(MinCount)) - { - writer.WritePropertyName("minCount"u8); - writer.WriteNumberValue(MinCount.Value); - } - if (Optional.IsDefined(EnableAutoScaling)) - { - writer.WritePropertyName("enableAutoScaling"u8); - writer.WriteBooleanValue(EnableAutoScaling.Value); - } - if (Optional.IsDefined(ScaleDownMode)) - { - writer.WritePropertyName("scaleDownMode"u8); - writer.WriteStringValue(ScaleDownMode.Value.ToString()); - } - if (Optional.IsDefined(AgentPoolType)) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(AgentPoolType.Value.ToString()); - } - if (Optional.IsDefined(Mode)) - { - writer.WritePropertyName("mode"u8); - writer.WriteStringValue(Mode.Value.ToString()); - } - if (Optional.IsDefined(OrchestratorVersion)) - { - writer.WritePropertyName("orchestratorVersion"u8); - writer.WriteStringValue(OrchestratorVersion); - } - if (options.Format != "W" && Optional.IsDefined(CurrentOrchestratorVersion)) - { - writer.WritePropertyName("currentOrchestratorVersion"u8); - writer.WriteStringValue(CurrentOrchestratorVersion); - } - if (options.Format != "W" && Optional.IsDefined(NodeImageVersion)) - { - writer.WritePropertyName("nodeImageVersion"u8); - writer.WriteStringValue(NodeImageVersion); - } - if (Optional.IsDefined(UpgradeSettings)) - { - writer.WritePropertyName("upgradeSettings"u8); - writer.WriteObjectValue(UpgradeSettings); - } - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState); - } - if (Optional.IsDefined(PowerState)) - { - writer.WritePropertyName("powerState"u8); - writer.WriteObjectValue(PowerState); - } - if (Optional.IsCollectionDefined(AvailabilityZones)) - { - writer.WritePropertyName("availabilityZones"u8); - writer.WriteStartArray(); - foreach (var item in AvailabilityZones) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(EnableNodePublicIP)) - { - writer.WritePropertyName("enableNodePublicIP"u8); - writer.WriteBooleanValue(EnableNodePublicIP.Value); - } - if (Optional.IsDefined(NodePublicIPPrefixId)) - { - writer.WritePropertyName("nodePublicIPPrefixID"u8); - writer.WriteStringValue(NodePublicIPPrefixId); - } - if (Optional.IsDefined(ScaleSetPriority)) - { - writer.WritePropertyName("scaleSetPriority"u8); - writer.WriteStringValue(ScaleSetPriority.Value.ToString()); - } - if (Optional.IsDefined(ScaleSetEvictionPolicy)) - { - writer.WritePropertyName("scaleSetEvictionPolicy"u8); - writer.WriteStringValue(ScaleSetEvictionPolicy.Value.ToString()); - } - if (Optional.IsDefined(SpotMaxPrice)) - { - writer.WritePropertyName("spotMaxPrice"u8); - writer.WriteNumberValue(SpotMaxPrice.Value); - } - 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.IsCollectionDefined(NodeLabels)) - { - writer.WritePropertyName("nodeLabels"u8); - writer.WriteStartObject(); - foreach (var item in NodeLabels) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - if (Optional.IsCollectionDefined(NodeTaints)) - { - writer.WritePropertyName("nodeTaints"u8); - writer.WriteStartArray(); - foreach (var item in NodeTaints) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(ProximityPlacementGroupId)) - { - writer.WritePropertyName("proximityPlacementGroupID"u8); - writer.WriteStringValue(ProximityPlacementGroupId); - } - if (Optional.IsDefined(KubeletConfig)) - { - writer.WritePropertyName("kubeletConfig"u8); - writer.WriteObjectValue(KubeletConfig); - } - if (Optional.IsDefined(LinuxOSConfig)) - { - writer.WritePropertyName("linuxOSConfig"u8); - writer.WriteObjectValue(LinuxOSConfig); - } - if (Optional.IsDefined(EnableEncryptionAtHost)) - { - writer.WritePropertyName("enableEncryptionAtHost"u8); - writer.WriteBooleanValue(EnableEncryptionAtHost.Value); - } - if (Optional.IsDefined(EnableUltraSsd)) - { - writer.WritePropertyName("enableUltraSSD"u8); - writer.WriteBooleanValue(EnableUltraSsd.Value); - } - if (Optional.IsDefined(EnableFips)) - { - writer.WritePropertyName("enableFIPS"u8); - writer.WriteBooleanValue(EnableFips.Value); - } - if (Optional.IsDefined(GpuInstanceProfile)) - { - writer.WritePropertyName("gpuInstanceProfile"u8); - writer.WriteStringValue(GpuInstanceProfile.Value.ToString()); - } - if (Optional.IsDefined(CreationData)) - { - writer.WritePropertyName("creationData"u8); - writer.WriteObjectValue(CreationData); - } - if (Optional.IsDefined(CapacityReservationGroupId)) - { - writer.WritePropertyName("capacityReservationGroupID"u8); - writer.WriteStringValue(CapacityReservationGroupId); - } - if (Optional.IsDefined(HostGroupId)) - { - writer.WritePropertyName("hostGroupID"u8); - writer.WriteStringValue(HostGroupId); - } - if (Optional.IsDefined(NetworkProfile)) - { - writer.WritePropertyName("networkProfile"u8); - writer.WriteObjectValue(NetworkProfile); - } - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterAgentPoolProfileProperties 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(ManagedClusterAgentPoolProfileProperties)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterAgentPoolProfileProperties(document.RootElement, options); - } - - internal static ManagedClusterAgentPoolProfileProperties DeserializeManagedClusterAgentPoolProfileProperties(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional count = default; - Optional vmSize = default; - Optional osDiskSizeGB = default; - Optional osDiskType = default; - Optional kubeletDiskType = default; - Optional workloadRuntime = default; - Optional vnetSubnetId = default; - Optional podSubnetId = default; - Optional maxPods = default; - Optional osType = default; - Optional osSku = default; - Optional maxCount = default; - Optional minCount = default; - Optional enableAutoScaling = default; - Optional scaleDownMode = default; - Optional type = default; - Optional mode = default; - Optional orchestratorVersion = default; - Optional currentOrchestratorVersion = default; - Optional nodeImageVersion = default; - Optional upgradeSettings = default; - Optional provisioningState = default; - Optional powerState = default; - Optional> availabilityZones = default; - Optional enableNodePublicIP = default; - Optional nodePublicIPPrefixId = default; - Optional scaleSetPriority = default; - Optional scaleSetEvictionPolicy = default; - Optional spotMaxPrice = default; - Optional> tags = default; - Optional> nodeLabels = default; - Optional> nodeTaints = default; - Optional proximityPlacementGroupId = default; - Optional kubeletConfig = default; - Optional linuxOSConfig = default; - Optional enableEncryptionAtHost = default; - Optional enableUltraSsd = default; - Optional enableFIPS = default; - Optional gpuInstanceProfile = default; - Optional creationData = default; - Optional capacityReservationGroupId = default; - Optional hostGroupId = default; - Optional networkProfile = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("count"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - count = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("vmSize"u8)) - { - vmSize = property.Value.GetString(); - continue; - } - if (property.NameEquals("osDiskSizeGB"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - osDiskSizeGB = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("osDiskType"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - osDiskType = new ContainerServiceOSDiskType(property.Value.GetString()); - continue; - } - if (property.NameEquals("kubeletDiskType"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - kubeletDiskType = new KubeletDiskType(property.Value.GetString()); - continue; - } - if (property.NameEquals("workloadRuntime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - workloadRuntime = new WorkloadRuntime(property.Value.GetString()); - continue; - } - if (property.NameEquals("vnetSubnetID"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - vnetSubnetId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("podSubnetID"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - podSubnetId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("maxPods"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - maxPods = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("osType"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - osType = new ContainerServiceOSType(property.Value.GetString()); - continue; - } - if (property.NameEquals("osSKU"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - osSku = new ContainerServiceOSSku(property.Value.GetString()); - continue; - } - if (property.NameEquals("maxCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - maxCount = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("minCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - minCount = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("enableAutoScaling"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableAutoScaling = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("scaleDownMode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - scaleDownMode = new ScaleDownMode(property.Value.GetString()); - continue; - } - if (property.NameEquals("type"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - type = new AgentPoolType(property.Value.GetString()); - continue; - } - if (property.NameEquals("mode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - mode = new AgentPoolMode(property.Value.GetString()); - continue; - } - if (property.NameEquals("orchestratorVersion"u8)) - { - orchestratorVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("currentOrchestratorVersion"u8)) - { - currentOrchestratorVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("nodeImageVersion"u8)) - { - nodeImageVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("upgradeSettings"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - upgradeSettings = AgentPoolUpgradeSettings.DeserializeAgentPoolUpgradeSettings(property.Value); - continue; - } - if (property.NameEquals("provisioningState"u8)) - { - provisioningState = property.Value.GetString(); - continue; - } - if (property.NameEquals("powerState"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - powerState = ContainerServicePowerState.DeserializeContainerServicePowerState(property.Value); - continue; - } - if (property.NameEquals("availabilityZones"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - availabilityZones = array; - continue; - } - if (property.NameEquals("enableNodePublicIP"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableNodePublicIP = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("nodePublicIPPrefixID"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - nodePublicIPPrefixId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("scaleSetPriority"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - scaleSetPriority = new ScaleSetPriority(property.Value.GetString()); - continue; - } - if (property.NameEquals("scaleSetEvictionPolicy"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - scaleSetEvictionPolicy = new ScaleSetEvictionPolicy(property.Value.GetString()); - continue; - } - if (property.NameEquals("spotMaxPrice"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - spotMaxPrice = property.Value.GetSingle(); - 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("nodeLabels"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()); - } - nodeLabels = dictionary; - continue; - } - if (property.NameEquals("nodeTaints"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - nodeTaints = array; - continue; - } - if (property.NameEquals("proximityPlacementGroupID"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - proximityPlacementGroupId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("kubeletConfig"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - kubeletConfig = KubeletConfig.DeserializeKubeletConfig(property.Value); - continue; - } - if (property.NameEquals("linuxOSConfig"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - linuxOSConfig = LinuxOSConfig.DeserializeLinuxOSConfig(property.Value); - continue; - } - if (property.NameEquals("enableEncryptionAtHost"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableEncryptionAtHost = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("enableUltraSSD"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableUltraSsd = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("enableFIPS"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableFIPS = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("gpuInstanceProfile"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - gpuInstanceProfile = new GpuInstanceProfile(property.Value.GetString()); - continue; - } - if (property.NameEquals("creationData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - creationData = ContainerServiceCreationData.DeserializeContainerServiceCreationData(property.Value); - continue; - } - if (property.NameEquals("capacityReservationGroupID"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - capacityReservationGroupId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("hostGroupID"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - hostGroupId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("networkProfile"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - networkProfile = AgentPoolNetworkProfile.DeserializeAgentPoolNetworkProfile(property.Value); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterAgentPoolProfileProperties(Optional.ToNullable(count), vmSize.Value, Optional.ToNullable(osDiskSizeGB), Optional.ToNullable(osDiskType), Optional.ToNullable(kubeletDiskType), Optional.ToNullable(workloadRuntime), vnetSubnetId.Value, podSubnetId.Value, Optional.ToNullable(maxPods), Optional.ToNullable(osType), Optional.ToNullable(osSku), Optional.ToNullable(maxCount), Optional.ToNullable(minCount), Optional.ToNullable(enableAutoScaling), Optional.ToNullable(scaleDownMode), Optional.ToNullable(type), Optional.ToNullable(mode), orchestratorVersion.Value, currentOrchestratorVersion.Value, nodeImageVersion.Value, upgradeSettings.Value, provisioningState.Value, powerState.Value, Optional.ToList(availabilityZones), Optional.ToNullable(enableNodePublicIP), nodePublicIPPrefixId.Value, Optional.ToNullable(scaleSetPriority), Optional.ToNullable(scaleSetEvictionPolicy), Optional.ToNullable(spotMaxPrice), Optional.ToDictionary(tags), Optional.ToDictionary(nodeLabels), Optional.ToList(nodeTaints), proximityPlacementGroupId.Value, kubeletConfig.Value, linuxOSConfig.Value, Optional.ToNullable(enableEncryptionAtHost), Optional.ToNullable(enableUltraSsd), Optional.ToNullable(enableFIPS), Optional.ToNullable(gpuInstanceProfile), creationData.Value, capacityReservationGroupId.Value, hostGroupId.Value, networkProfile.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(ManagedClusterAgentPoolProfileProperties)} does not support '{options.Format}' format."); - } - } - - ManagedClusterAgentPoolProfileProperties 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); - return DeserializeManagedClusterAgentPoolProfileProperties(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterAgentPoolProfileProperties)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfileProperties.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfileProperties.cs deleted file mode 100644 index 865ae8a4b00bb..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfileProperties.cs +++ /dev/null @@ -1,262 +0,0 @@ -// 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.ContainerService.Models -{ - /// Properties for the container service agent pool profile. - public partial class ManagedClusterAgentPoolProfileProperties - { - /// - /// 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 protected IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public ManagedClusterAgentPoolProfileProperties() - { - AvailabilityZones = new ChangeTrackingList(); - Tags = new ChangeTrackingDictionary(); - NodeLabels = new ChangeTrackingDictionary(); - NodeTaints = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. - /// VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. - /// OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. - /// The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). - /// Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. - /// Determines the type of workload a node can run. - /// If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - /// If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - /// The maximum number of pods that can run on a node. - /// The operating system type. The default is Linux. - /// Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows. - /// The maximum number of nodes for auto-scaling. - /// The minimum number of nodes for auto-scaling. - /// Whether to enable auto-scaler. - /// This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. - /// The type of Agent Pool. - /// A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools. - /// Both patch version <major.minor.patch> (e.g. 1.20.13) and <major.minor> (e.g. 1.20) are supported. When <major.minor> is specified, the latest supported GA patch version is chosen automatically. Updating the cluster with the same <major.minor> once it has been created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). - /// If orchestratorVersion is a fully specified version <major.minor.patch>, this field will be exactly equal to it. If orchestratorVersion is <major.minor>, this field will contain the full <major.minor.patch> version being used. - /// The version of node image. - /// Settings for upgrading the agentpool. - /// The current deployment or provisioning state. - /// When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded. - /// The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. - /// Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). The default is false. - /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. - /// The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. - /// This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. - /// Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing). - /// The tags to be persisted on the agent pool virtual machine scale set. - /// The node labels to be persisted across all nodes in agent pool. - /// The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - /// The ID for Proximity Placement Group. - /// The Kubelet configuration on the agent pool nodes. - /// The OS configuration of Linux agent nodes. - /// This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption. - /// Whether to enable UltraSSD. - /// See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more details. - /// GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. - /// CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot. - /// AKS will associate the specified agent pool with the Capacity Reservation Group. - /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts). - /// Network-related settings of an agent pool. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterAgentPoolProfileProperties(int? count, string vmSize, int? osDiskSizeInGB, ContainerServiceOSDiskType? osDiskType, KubeletDiskType? kubeletDiskType, WorkloadRuntime? workloadRuntime, ResourceIdentifier vnetSubnetId, ResourceIdentifier podSubnetId, int? maxPods, ContainerServiceOSType? osType, ContainerServiceOSSku? osSku, int? maxCount, int? minCount, bool? enableAutoScaling, ScaleDownMode? scaleDownMode, AgentPoolType? agentPoolType, AgentPoolMode? mode, string orchestratorVersion, string currentOrchestratorVersion, string nodeImageVersion, AgentPoolUpgradeSettings upgradeSettings, string provisioningState, ContainerServicePowerState powerState, IList availabilityZones, bool? enableNodePublicIP, ResourceIdentifier nodePublicIPPrefixId, ScaleSetPriority? scaleSetPriority, ScaleSetEvictionPolicy? scaleSetEvictionPolicy, float? spotMaxPrice, IDictionary tags, IDictionary nodeLabels, IList nodeTaints, ResourceIdentifier proximityPlacementGroupId, KubeletConfig kubeletConfig, LinuxOSConfig linuxOSConfig, bool? enableEncryptionAtHost, bool? enableUltraSsd, bool? enableFips, GpuInstanceProfile? gpuInstanceProfile, ContainerServiceCreationData creationData, ResourceIdentifier capacityReservationGroupId, ResourceIdentifier hostGroupId, AgentPoolNetworkProfile networkProfile, IDictionary serializedAdditionalRawData) - { - Count = count; - VmSize = vmSize; - OSDiskSizeInGB = osDiskSizeInGB; - OSDiskType = osDiskType; - KubeletDiskType = kubeletDiskType; - WorkloadRuntime = workloadRuntime; - VnetSubnetId = vnetSubnetId; - PodSubnetId = podSubnetId; - MaxPods = maxPods; - OSType = osType; - OSSku = osSku; - MaxCount = maxCount; - MinCount = minCount; - EnableAutoScaling = enableAutoScaling; - ScaleDownMode = scaleDownMode; - AgentPoolType = agentPoolType; - Mode = mode; - OrchestratorVersion = orchestratorVersion; - CurrentOrchestratorVersion = currentOrchestratorVersion; - NodeImageVersion = nodeImageVersion; - UpgradeSettings = upgradeSettings; - ProvisioningState = provisioningState; - PowerState = powerState; - AvailabilityZones = availabilityZones; - EnableNodePublicIP = enableNodePublicIP; - NodePublicIPPrefixId = nodePublicIPPrefixId; - ScaleSetPriority = scaleSetPriority; - ScaleSetEvictionPolicy = scaleSetEvictionPolicy; - SpotMaxPrice = spotMaxPrice; - Tags = tags; - NodeLabels = nodeLabels; - NodeTaints = nodeTaints; - ProximityPlacementGroupId = proximityPlacementGroupId; - KubeletConfig = kubeletConfig; - LinuxOSConfig = linuxOSConfig; - EnableEncryptionAtHost = enableEncryptionAtHost; - EnableUltraSsd = enableUltraSsd; - EnableFips = enableFips; - GpuInstanceProfile = gpuInstanceProfile; - CreationData = creationData; - CapacityReservationGroupId = capacityReservationGroupId; - HostGroupId = hostGroupId; - NetworkProfile = networkProfile; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. - public int? Count { get; set; } - /// VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. - public string VmSize { get; set; } - /// OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. - public int? OSDiskSizeInGB { get; set; } - /// The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). - public ContainerServiceOSDiskType? OSDiskType { get; set; } - /// Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. - public KubeletDiskType? KubeletDiskType { get; set; } - /// Determines the type of workload a node can run. - public WorkloadRuntime? WorkloadRuntime { get; set; } - /// If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - public ResourceIdentifier VnetSubnetId { get; set; } - /// If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - public ResourceIdentifier PodSubnetId { get; set; } - /// The maximum number of pods that can run on a node. - public int? MaxPods { get; set; } - /// The operating system type. The default is Linux. - public ContainerServiceOSType? OSType { get; set; } - /// Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows. - public ContainerServiceOSSku? OSSku { get; set; } - /// The maximum number of nodes for auto-scaling. - public int? MaxCount { get; set; } - /// The minimum number of nodes for auto-scaling. - public int? MinCount { get; set; } - /// Whether to enable auto-scaler. - public bool? EnableAutoScaling { get; set; } - /// This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. - public ScaleDownMode? ScaleDownMode { get; set; } - /// The type of Agent Pool. - public AgentPoolType? AgentPoolType { get; set; } - /// A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools. - public AgentPoolMode? Mode { get; set; } - /// Both patch version <major.minor.patch> (e.g. 1.20.13) and <major.minor> (e.g. 1.20) are supported. When <major.minor> is specified, the latest supported GA patch version is chosen automatically. Updating the cluster with the same <major.minor> once it has been created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). - public string OrchestratorVersion { get; set; } - /// If orchestratorVersion is a fully specified version <major.minor.patch>, this field will be exactly equal to it. If orchestratorVersion is <major.minor>, this field will contain the full <major.minor.patch> version being used. - public string CurrentOrchestratorVersion { get; } - /// The version of node image. - public string NodeImageVersion { get; } - /// Settings for upgrading the agentpool. - public AgentPoolUpgradeSettings UpgradeSettings { get; set; } - /// The current deployment or provisioning state. - public string ProvisioningState { get; } - /// When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded. - internal ContainerServicePowerState PowerState { get; set; } - /// Tells whether the cluster is Running or Stopped. - public ContainerServiceStateCode? PowerStateCode - { - get => PowerState is null ? default : PowerState.Code; - set - { - if (PowerState is null) - PowerState = new ContainerServicePowerState(); - PowerState.Code = value; - } - } - - /// The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. - public IList AvailabilityZones { get; } - /// Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). The default is false. - public bool? EnableNodePublicIP { get; set; } - /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. - public ResourceIdentifier NodePublicIPPrefixId { get; set; } - /// The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. - public ScaleSetPriority? ScaleSetPriority { get; set; } - /// This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. - public ScaleSetEvictionPolicy? ScaleSetEvictionPolicy { get; set; } - /// Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing). - public float? SpotMaxPrice { get; set; } - /// The tags to be persisted on the agent pool virtual machine scale set. - public IDictionary Tags { get; } - /// The node labels to be persisted across all nodes in agent pool. - public IDictionary NodeLabels { get; } - /// The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - public IList NodeTaints { get; } - /// The ID for Proximity Placement Group. - public ResourceIdentifier ProximityPlacementGroupId { get; set; } - /// The Kubelet configuration on the agent pool nodes. - public KubeletConfig KubeletConfig { get; set; } - /// The OS configuration of Linux agent nodes. - public LinuxOSConfig LinuxOSConfig { get; set; } - /// This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption. - public bool? EnableEncryptionAtHost { get; set; } - /// Whether to enable UltraSSD. - public bool? EnableUltraSsd { get; set; } - /// See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more details. - public bool? EnableFips { get; set; } - /// GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. - public GpuInstanceProfile? GpuInstanceProfile { get; set; } - /// CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot. - internal ContainerServiceCreationData CreationData { get; set; } - /// This is the ARM ID of the source object to be used to create the target object. - public ResourceIdentifier CreationDataSourceResourceId - { - get => CreationData is null ? default : CreationData.SourceResourceId; - set - { - if (CreationData is null) - CreationData = new ContainerServiceCreationData(); - CreationData.SourceResourceId = value; - } - } - - /// AKS will associate the specified agent pool with the Capacity Reservation Group. - public ResourceIdentifier CapacityReservationGroupId { get; set; } - /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts). - public ResourceIdentifier HostGroupId { get; set; } - /// Network-related settings of an agent pool. - public AgentPoolNetworkProfile NetworkProfile { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterApiServerAccessProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterApiServerAccessProfile.Serialization.cs deleted file mode 100644 index 934d5267a38de..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterApiServerAccessProfile.Serialization.cs +++ /dev/null @@ -1,192 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class ManagedClusterApiServerAccessProfile : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterApiServerAccessProfile)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(AuthorizedIPRanges)) - { - writer.WritePropertyName("authorizedIPRanges"u8); - writer.WriteStartArray(); - foreach (var item in AuthorizedIPRanges) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(EnablePrivateCluster)) - { - writer.WritePropertyName("enablePrivateCluster"u8); - writer.WriteBooleanValue(EnablePrivateCluster.Value); - } - if (Optional.IsDefined(PrivateDnsZone)) - { - writer.WritePropertyName("privateDNSZone"u8); - writer.WriteStringValue(PrivateDnsZone); - } - if (Optional.IsDefined(EnablePrivateClusterPublicFqdn)) - { - writer.WritePropertyName("enablePrivateClusterPublicFQDN"u8); - writer.WriteBooleanValue(EnablePrivateClusterPublicFqdn.Value); - } - if (Optional.IsDefined(DisableRunCommand)) - { - writer.WritePropertyName("disableRunCommand"u8); - writer.WriteBooleanValue(DisableRunCommand.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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterApiServerAccessProfile 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(ManagedClusterApiServerAccessProfile)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterApiServerAccessProfile(document.RootElement, options); - } - - internal static ManagedClusterApiServerAccessProfile DeserializeManagedClusterApiServerAccessProfile(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> authorizedIPRanges = default; - Optional enablePrivateCluster = default; - Optional privateDnsZone = default; - Optional enablePrivateClusterPublicFQDN = default; - Optional disableRunCommand = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("authorizedIPRanges"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - authorizedIPRanges = array; - continue; - } - if (property.NameEquals("enablePrivateCluster"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enablePrivateCluster = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("privateDNSZone"u8)) - { - privateDnsZone = property.Value.GetString(); - continue; - } - if (property.NameEquals("enablePrivateClusterPublicFQDN"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enablePrivateClusterPublicFQDN = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("disableRunCommand"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - disableRunCommand = property.Value.GetBoolean(); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterApiServerAccessProfile(Optional.ToList(authorizedIPRanges), Optional.ToNullable(enablePrivateCluster), privateDnsZone.Value, Optional.ToNullable(enablePrivateClusterPublicFQDN), Optional.ToNullable(disableRunCommand), 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(ManagedClusterApiServerAccessProfile)} does not support '{options.Format}' format."); - } - } - - ManagedClusterApiServerAccessProfile 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); - return DeserializeManagedClusterApiServerAccessProfile(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterApiServerAccessProfile)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterApiServerAccessProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterApiServerAccessProfile.cs deleted file mode 100644 index 724524ecadc0d..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterApiServerAccessProfile.cs +++ /dev/null @@ -1,83 +0,0 @@ -// 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.ContainerService.Models -{ - /// Access profile for managed cluster API server. - public partial class ManagedClusterApiServerAccessProfile - { - /// - /// 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 ManagedClusterApiServerAccessProfile() - { - AuthorizedIPRanges = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. This feature is not compatible with clusters that use Public IP Per Node, or clusters that are using a Basic Load Balancer. For more information see [API server authorized IP ranges](https://docs.microsoft.com/azure/aks/api-server-authorized-ip-ranges). - /// For more details, see [Creating a private AKS cluster](https://docs.microsoft.com/azure/aks/private-clusters). - /// The default is System. For more details see [configure private DNS zone](https://docs.microsoft.com/azure/aks/private-clusters#configure-private-dns-zone). Allowed values are 'system' and 'none'. - /// Whether to create additional public FQDN for private cluster or not. - /// Whether to disable run command for the cluster or not. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterApiServerAccessProfile(IList authorizedIPRanges, bool? enablePrivateCluster, string privateDnsZone, bool? enablePrivateClusterPublicFqdn, bool? disableRunCommand, IDictionary serializedAdditionalRawData) - { - AuthorizedIPRanges = authorizedIPRanges; - EnablePrivateCluster = enablePrivateCluster; - PrivateDnsZone = privateDnsZone; - EnablePrivateClusterPublicFqdn = enablePrivateClusterPublicFqdn; - DisableRunCommand = disableRunCommand; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. This feature is not compatible with clusters that use Public IP Per Node, or clusters that are using a Basic Load Balancer. For more information see [API server authorized IP ranges](https://docs.microsoft.com/azure/aks/api-server-authorized-ip-ranges). - public IList AuthorizedIPRanges { get; } - /// For more details, see [Creating a private AKS cluster](https://docs.microsoft.com/azure/aks/private-clusters). - public bool? EnablePrivateCluster { get; set; } - /// The default is System. For more details see [configure private DNS zone](https://docs.microsoft.com/azure/aks/private-clusters#configure-private-dns-zone). Allowed values are 'system' and 'none'. - public string PrivateDnsZone { get; set; } - /// Whether to create additional public FQDN for private cluster or not. - public bool? EnablePrivateClusterPublicFqdn { get; set; } - /// Whether to disable run command for the cluster or not. - public bool? DisableRunCommand { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAutoScalerProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAutoScalerProfile.Serialization.cs deleted file mode 100644 index ad19d693fd88f..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAutoScalerProfile.Serialization.cs +++ /dev/null @@ -1,302 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class ManagedClusterAutoScalerProfile : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterAutoScalerProfile)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(BalanceSimilarNodeGroups)) - { - writer.WritePropertyName("balance-similar-node-groups"u8); - writer.WriteStringValue(BalanceSimilarNodeGroups); - } - if (Optional.IsDefined(Expander)) - { - writer.WritePropertyName("expander"u8); - writer.WriteStringValue(Expander.Value.ToString()); - } - if (Optional.IsDefined(MaxEmptyBulkDelete)) - { - writer.WritePropertyName("max-empty-bulk-delete"u8); - writer.WriteStringValue(MaxEmptyBulkDelete); - } - if (Optional.IsDefined(MaxGracefulTerminationSec)) - { - writer.WritePropertyName("max-graceful-termination-sec"u8); - writer.WriteStringValue(MaxGracefulTerminationSec); - } - if (Optional.IsDefined(MaxNodeProvisionTime)) - { - writer.WritePropertyName("max-node-provision-time"u8); - writer.WriteStringValue(MaxNodeProvisionTime); - } - if (Optional.IsDefined(MaxTotalUnreadyPercentage)) - { - writer.WritePropertyName("max-total-unready-percentage"u8); - writer.WriteStringValue(MaxTotalUnreadyPercentage); - } - if (Optional.IsDefined(NewPodScaleUpDelay)) - { - writer.WritePropertyName("new-pod-scale-up-delay"u8); - writer.WriteStringValue(NewPodScaleUpDelay); - } - if (Optional.IsDefined(OkTotalUnreadyCount)) - { - writer.WritePropertyName("ok-total-unready-count"u8); - writer.WriteStringValue(OkTotalUnreadyCount); - } - if (Optional.IsDefined(ScanIntervalInSeconds)) - { - writer.WritePropertyName("scan-interval"u8); - writer.WriteStringValue(ScanIntervalInSeconds); - } - if (Optional.IsDefined(ScaleDownDelayAfterAdd)) - { - writer.WritePropertyName("scale-down-delay-after-add"u8); - writer.WriteStringValue(ScaleDownDelayAfterAdd); - } - if (Optional.IsDefined(ScaleDownDelayAfterDelete)) - { - writer.WritePropertyName("scale-down-delay-after-delete"u8); - writer.WriteStringValue(ScaleDownDelayAfterDelete); - } - if (Optional.IsDefined(ScaleDownDelayAfterFailure)) - { - writer.WritePropertyName("scale-down-delay-after-failure"u8); - writer.WriteStringValue(ScaleDownDelayAfterFailure); - } - if (Optional.IsDefined(ScaleDownUnneededTime)) - { - writer.WritePropertyName("scale-down-unneeded-time"u8); - writer.WriteStringValue(ScaleDownUnneededTime); - } - if (Optional.IsDefined(ScaleDownUnreadyTime)) - { - writer.WritePropertyName("scale-down-unready-time"u8); - writer.WriteStringValue(ScaleDownUnreadyTime); - } - if (Optional.IsDefined(ScaleDownUtilizationThreshold)) - { - writer.WritePropertyName("scale-down-utilization-threshold"u8); - writer.WriteStringValue(ScaleDownUtilizationThreshold); - } - if (Optional.IsDefined(SkipNodesWithLocalStorage)) - { - writer.WritePropertyName("skip-nodes-with-local-storage"u8); - writer.WriteStringValue(SkipNodesWithLocalStorage); - } - if (Optional.IsDefined(SkipNodesWithSystemPods)) - { - writer.WritePropertyName("skip-nodes-with-system-pods"u8); - writer.WriteStringValue(SkipNodesWithSystemPods); - } - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterAutoScalerProfile 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(ManagedClusterAutoScalerProfile)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterAutoScalerProfile(document.RootElement, options); - } - - internal static ManagedClusterAutoScalerProfile DeserializeManagedClusterAutoScalerProfile(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional balanceSimilarNodeGroups = default; - Optional expander = default; - Optional maxEmptyBulkDelete = default; - Optional maxGracefulTerminationSec = default; - Optional maxNodeProvisionTime = default; - Optional maxTotalUnreadyPercentage = default; - Optional newPodScaleUpDelay = default; - Optional okTotalUnreadyCount = default; - Optional scanInterval = default; - Optional scaleDownDelayAfterAdd = default; - Optional scaleDownDelayAfterDelete = default; - Optional scaleDownDelayAfterFailure = default; - Optional scaleDownUnneededTime = default; - Optional scaleDownUnreadyTime = default; - Optional scaleDownUtilizationThreshold = default; - Optional skipNodesWithLocalStorage = default; - Optional skipNodesWithSystemPods = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("balance-similar-node-groups"u8)) - { - balanceSimilarNodeGroups = property.Value.GetString(); - continue; - } - if (property.NameEquals("expander"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - expander = new AutoScaleExpander(property.Value.GetString()); - continue; - } - if (property.NameEquals("max-empty-bulk-delete"u8)) - { - maxEmptyBulkDelete = property.Value.GetString(); - continue; - } - if (property.NameEquals("max-graceful-termination-sec"u8)) - { - maxGracefulTerminationSec = property.Value.GetString(); - continue; - } - if (property.NameEquals("max-node-provision-time"u8)) - { - maxNodeProvisionTime = property.Value.GetString(); - continue; - } - if (property.NameEquals("max-total-unready-percentage"u8)) - { - maxTotalUnreadyPercentage = property.Value.GetString(); - continue; - } - if (property.NameEquals("new-pod-scale-up-delay"u8)) - { - newPodScaleUpDelay = property.Value.GetString(); - continue; - } - if (property.NameEquals("ok-total-unready-count"u8)) - { - okTotalUnreadyCount = property.Value.GetString(); - continue; - } - if (property.NameEquals("scan-interval"u8)) - { - scanInterval = property.Value.GetString(); - continue; - } - if (property.NameEquals("scale-down-delay-after-add"u8)) - { - scaleDownDelayAfterAdd = property.Value.GetString(); - continue; - } - if (property.NameEquals("scale-down-delay-after-delete"u8)) - { - scaleDownDelayAfterDelete = property.Value.GetString(); - continue; - } - if (property.NameEquals("scale-down-delay-after-failure"u8)) - { - scaleDownDelayAfterFailure = property.Value.GetString(); - continue; - } - if (property.NameEquals("scale-down-unneeded-time"u8)) - { - scaleDownUnneededTime = property.Value.GetString(); - continue; - } - if (property.NameEquals("scale-down-unready-time"u8)) - { - scaleDownUnreadyTime = property.Value.GetString(); - continue; - } - if (property.NameEquals("scale-down-utilization-threshold"u8)) - { - scaleDownUtilizationThreshold = property.Value.GetString(); - continue; - } - if (property.NameEquals("skip-nodes-with-local-storage"u8)) - { - skipNodesWithLocalStorage = property.Value.GetString(); - continue; - } - if (property.NameEquals("skip-nodes-with-system-pods"u8)) - { - skipNodesWithSystemPods = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterAutoScalerProfile(balanceSimilarNodeGroups.Value, Optional.ToNullable(expander), maxEmptyBulkDelete.Value, maxGracefulTerminationSec.Value, maxNodeProvisionTime.Value, maxTotalUnreadyPercentage.Value, newPodScaleUpDelay.Value, okTotalUnreadyCount.Value, scanInterval.Value, scaleDownDelayAfterAdd.Value, scaleDownDelayAfterDelete.Value, scaleDownDelayAfterFailure.Value, scaleDownUnneededTime.Value, scaleDownUnreadyTime.Value, scaleDownUtilizationThreshold.Value, skipNodesWithLocalStorage.Value, skipNodesWithSystemPods.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(ManagedClusterAutoScalerProfile)} does not support '{options.Format}' format."); - } - } - - ManagedClusterAutoScalerProfile 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); - return DeserializeManagedClusterAutoScalerProfile(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterAutoScalerProfile)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAutoScalerProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAutoScalerProfile.cs deleted file mode 100644 index 49c6bef9fb1cd..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAutoScalerProfile.cs +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Parameters to be applied to the cluster-autoscaler when enabled. - public partial class ManagedClusterAutoScalerProfile - { - /// - /// 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 ManagedClusterAutoScalerProfile() - { - } - - /// Initializes a new instance of . - /// Valid values are 'true' and 'false'. - /// If not specified, the default is 'random'. See [expanders](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-are-expanders) for more information. - /// The default is 10. - /// The default is 600. - /// The default is '15m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - /// The default is 45. The maximum is 100 and the minimum is 0. - /// For scenarios like burst/batch scale where you don't want CA to act before the kubernetes scheduler could schedule all the pods, you can tell CA to ignore unscheduled pods before they're a certain age. The default is '0s'. Values must be an integer followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). - /// This must be an integer. The default is 3. - /// The default is '10'. Values must be an integer number of seconds. - /// The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - /// The default is the scan-interval. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - /// The default is '3m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - /// The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - /// The default is '20m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - /// The default is '0.5'. - /// The default is true. - /// The default is true. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterAutoScalerProfile(string balanceSimilarNodeGroups, AutoScaleExpander? expander, string maxEmptyBulkDelete, string maxGracefulTerminationSec, string maxNodeProvisionTime, string maxTotalUnreadyPercentage, string newPodScaleUpDelay, string okTotalUnreadyCount, string scanIntervalInSeconds, string scaleDownDelayAfterAdd, string scaleDownDelayAfterDelete, string scaleDownDelayAfterFailure, string scaleDownUnneededTime, string scaleDownUnreadyTime, string scaleDownUtilizationThreshold, string skipNodesWithLocalStorage, string skipNodesWithSystemPods, IDictionary serializedAdditionalRawData) - { - BalanceSimilarNodeGroups = balanceSimilarNodeGroups; - Expander = expander; - MaxEmptyBulkDelete = maxEmptyBulkDelete; - MaxGracefulTerminationSec = maxGracefulTerminationSec; - MaxNodeProvisionTime = maxNodeProvisionTime; - MaxTotalUnreadyPercentage = maxTotalUnreadyPercentage; - NewPodScaleUpDelay = newPodScaleUpDelay; - OkTotalUnreadyCount = okTotalUnreadyCount; - ScanIntervalInSeconds = scanIntervalInSeconds; - ScaleDownDelayAfterAdd = scaleDownDelayAfterAdd; - ScaleDownDelayAfterDelete = scaleDownDelayAfterDelete; - ScaleDownDelayAfterFailure = scaleDownDelayAfterFailure; - ScaleDownUnneededTime = scaleDownUnneededTime; - ScaleDownUnreadyTime = scaleDownUnreadyTime; - ScaleDownUtilizationThreshold = scaleDownUtilizationThreshold; - SkipNodesWithLocalStorage = skipNodesWithLocalStorage; - SkipNodesWithSystemPods = skipNodesWithSystemPods; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Valid values are 'true' and 'false'. - public string BalanceSimilarNodeGroups { get; set; } - /// If not specified, the default is 'random'. See [expanders](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-are-expanders) for more information. - public AutoScaleExpander? Expander { get; set; } - /// The default is 10. - public string MaxEmptyBulkDelete { get; set; } - /// The default is 600. - public string MaxGracefulTerminationSec { get; set; } - /// The default is '15m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - public string MaxNodeProvisionTime { get; set; } - /// The default is 45. The maximum is 100 and the minimum is 0. - public string MaxTotalUnreadyPercentage { get; set; } - /// For scenarios like burst/batch scale where you don't want CA to act before the kubernetes scheduler could schedule all the pods, you can tell CA to ignore unscheduled pods before they're a certain age. The default is '0s'. Values must be an integer followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). - public string NewPodScaleUpDelay { get; set; } - /// This must be an integer. The default is 3. - public string OkTotalUnreadyCount { get; set; } - /// The default is '10'. Values must be an integer number of seconds. - public string ScanIntervalInSeconds { get; set; } - /// The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - public string ScaleDownDelayAfterAdd { get; set; } - /// The default is the scan-interval. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - public string ScaleDownDelayAfterDelete { get; set; } - /// The default is '3m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - public string ScaleDownDelayAfterFailure { get; set; } - /// The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - public string ScaleDownUnneededTime { get; set; } - /// The default is '20m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - public string ScaleDownUnreadyTime { get; set; } - /// The default is '0.5'. - public string ScaleDownUtilizationThreshold { get; set; } - /// The default is true. - public string SkipNodesWithLocalStorage { get; set; } - /// The default is true. - public string SkipNodesWithSystemPods { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAutoUpgradeProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAutoUpgradeProfile.Serialization.cs deleted file mode 100644 index 8f0079d6079f3..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAutoUpgradeProfile.Serialization.cs +++ /dev/null @@ -1,141 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class ManagedClusterAutoUpgradeProfile : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterAutoUpgradeProfile)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(UpgradeChannel)) - { - writer.WritePropertyName("upgradeChannel"u8); - writer.WriteStringValue(UpgradeChannel.Value.ToString()); - } - if (Optional.IsDefined(NodeOSUpgradeChannel)) - { - writer.WritePropertyName("nodeOSUpgradeChannel"u8); - writer.WriteStringValue(NodeOSUpgradeChannel.Value.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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterAutoUpgradeProfile 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(ManagedClusterAutoUpgradeProfile)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterAutoUpgradeProfile(document.RootElement, options); - } - - internal static ManagedClusterAutoUpgradeProfile DeserializeManagedClusterAutoUpgradeProfile(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional upgradeChannel = default; - Optional nodeOSUpgradeChannel = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("upgradeChannel"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - upgradeChannel = new UpgradeChannel(property.Value.GetString()); - continue; - } - if (property.NameEquals("nodeOSUpgradeChannel"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - nodeOSUpgradeChannel = new ManagedClusterNodeOSUpgradeChannel(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterAutoUpgradeProfile(Optional.ToNullable(upgradeChannel), Optional.ToNullable(nodeOSUpgradeChannel), 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(ManagedClusterAutoUpgradeProfile)} does not support '{options.Format}' format."); - } - } - - ManagedClusterAutoUpgradeProfile 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); - return DeserializeManagedClusterAutoUpgradeProfile(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterAutoUpgradeProfile)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAutoUpgradeProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAutoUpgradeProfile.cs deleted file mode 100644 index d44699577bbe8..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAutoUpgradeProfile.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Auto upgrade profile for a managed cluster. - public partial class ManagedClusterAutoUpgradeProfile - { - /// - /// 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 ManagedClusterAutoUpgradeProfile() - { - } - - /// Initializes a new instance of . - /// For more information see [setting the AKS cluster auto-upgrade channel](https://docs.microsoft.com/azure/aks/upgrade-cluster#set-auto-upgrade-channel). - /// Manner in which the OS on your nodes is updated. The default is NodeImage. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterAutoUpgradeProfile(UpgradeChannel? upgradeChannel, ManagedClusterNodeOSUpgradeChannel? nodeOSUpgradeChannel, IDictionary serializedAdditionalRawData) - { - UpgradeChannel = upgradeChannel; - NodeOSUpgradeChannel = nodeOSUpgradeChannel; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// For more information see [setting the AKS cluster auto-upgrade channel](https://docs.microsoft.com/azure/aks/upgrade-cluster#set-auto-upgrade-channel). - public UpgradeChannel? UpgradeChannel { get; set; } - /// Manner in which the OS on your nodes is updated. The default is NodeImage. - public ManagedClusterNodeOSUpgradeChannel? NodeOSUpgradeChannel { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAzureMonitorProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAzureMonitorProfile.cs deleted file mode 100644 index fc54e507bed89..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAzureMonitorProfile.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Azure Monitor addon profiles for monitoring the managed cluster. - internal partial class ManagedClusterAzureMonitorProfile - { - /// - /// 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 ManagedClusterAzureMonitorProfile() - { - } - - /// Initializes a new instance of . - /// Metrics profile for the Azure Monitor managed service for Prometheus addon. Collect out-of-the-box Kubernetes infrastructure metrics to send to an Azure Monitor Workspace and configure additional scraping for custom targets. See aka.ms/AzureManagedPrometheus for an overview. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterAzureMonitorProfile(ManagedClusterMonitorProfileMetrics metrics, IDictionary serializedAdditionalRawData) - { - Metrics = metrics; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Metrics profile for the Azure Monitor managed service for Prometheus addon. Collect out-of-the-box Kubernetes infrastructure metrics to send to an Azure Monitor Workspace and configure additional scraping for custom targets. See aka.ms/AzureManagedPrometheus for an overview. - public ManagedClusterMonitorProfileMetrics Metrics { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterDelegatedIdentity.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterDelegatedIdentity.cs deleted file mode 100644 index fc5dda7a24096..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterDelegatedIdentity.cs +++ /dev/null @@ -1,78 +0,0 @@ -// 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.ContainerService.Models -{ - /// Delegated resource properties - internal use only. - public partial class ManagedClusterDelegatedIdentity - { - /// - /// 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 ManagedClusterDelegatedIdentity() - { - } - - /// Initializes a new instance of . - /// The ARM resource id of the delegated resource - internal use only. - /// The tenant id of the delegated resource - internal use only. - /// The delegation id of the referral delegation (optional) - internal use only. - /// The source resource location - internal use only. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterDelegatedIdentity(ResourceIdentifier resourceId, Guid? tenantId, string referralResource, AzureLocation? location, IDictionary serializedAdditionalRawData) - { - ResourceId = resourceId; - TenantId = tenantId; - ReferralResource = referralResource; - Location = location; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The ARM resource id of the delegated resource - internal use only. - public ResourceIdentifier ResourceId { get; set; } - /// The tenant id of the delegated resource - internal use only. - public Guid? TenantId { get; set; } - /// The delegation id of the referral delegation (optional) - internal use only. - public string ReferralResource { get; set; } - /// The source resource location - internal use only. - public AzureLocation? Location { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterHttpProxyConfig.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterHttpProxyConfig.Serialization.cs deleted file mode 100644 index 3222f62efb4d3..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterHttpProxyConfig.Serialization.cs +++ /dev/null @@ -1,169 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class ManagedClusterHttpProxyConfig : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterHttpProxyConfig)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(HttpProxy)) - { - writer.WritePropertyName("httpProxy"u8); - writer.WriteStringValue(HttpProxy); - } - if (Optional.IsDefined(HttpsProxy)) - { - writer.WritePropertyName("httpsProxy"u8); - writer.WriteStringValue(HttpsProxy); - } - if (Optional.IsCollectionDefined(NoProxy)) - { - writer.WritePropertyName("noProxy"u8); - writer.WriteStartArray(); - foreach (var item in NoProxy) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(TrustedCA)) - { - writer.WritePropertyName("trustedCa"u8); - writer.WriteStringValue(TrustedCA); - } - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterHttpProxyConfig 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(ManagedClusterHttpProxyConfig)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterHttpProxyConfig(document.RootElement, options); - } - - internal static ManagedClusterHttpProxyConfig DeserializeManagedClusterHttpProxyConfig(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional httpProxy = default; - Optional httpsProxy = default; - Optional> noProxy = default; - Optional trustedCA = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("httpProxy"u8)) - { - httpProxy = property.Value.GetString(); - continue; - } - if (property.NameEquals("httpsProxy"u8)) - { - httpsProxy = property.Value.GetString(); - continue; - } - if (property.NameEquals("noProxy"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - noProxy = array; - continue; - } - if (property.NameEquals("trustedCa"u8)) - { - trustedCA = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterHttpProxyConfig(httpProxy.Value, httpsProxy.Value, Optional.ToList(noProxy), trustedCA.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(ManagedClusterHttpProxyConfig)} does not support '{options.Format}' format."); - } - } - - ManagedClusterHttpProxyConfig 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); - return DeserializeManagedClusterHttpProxyConfig(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterHttpProxyConfig)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterHttpProxyConfig.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterHttpProxyConfig.cs deleted file mode 100644 index 3f7d9e5955e03..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterHttpProxyConfig.cs +++ /dev/null @@ -1,79 +0,0 @@ -// 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.ContainerService.Models -{ - /// Cluster HTTP proxy configuration. - public partial class ManagedClusterHttpProxyConfig - { - /// - /// 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 ManagedClusterHttpProxyConfig() - { - NoProxy = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// The HTTP proxy server endpoint to use. - /// The HTTPS proxy server endpoint to use. - /// The endpoints that should not go through proxy. - /// Alternative CA cert to use for connecting to proxy servers. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterHttpProxyConfig(string httpProxy, string httpsProxy, IList noProxy, string trustedCA, IDictionary serializedAdditionalRawData) - { - HttpProxy = httpProxy; - HttpsProxy = httpsProxy; - NoProxy = noProxy; - TrustedCA = trustedCA; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The HTTP proxy server endpoint to use. - public string HttpProxy { get; set; } - /// The HTTPS proxy server endpoint to use. - public string HttpsProxy { get; set; } - /// The endpoints that should not go through proxy. - public IList NoProxy { get; } - /// Alternative CA cert to use for connecting to proxy servers. - public string TrustedCA { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterKeyVaultNetworkAccessType.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterKeyVaultNetworkAccessType.cs deleted file mode 100644 index 4f6481c50ab9f..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterKeyVaultNetworkAccessType.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Network access of key vault. The possible values are `Public` and `Private`. `Public` means the key vault allows public access from all networks. `Private` means the key vault disables public access and enables private link. The default value is `Public`. - public readonly partial struct ManagedClusterKeyVaultNetworkAccessType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ManagedClusterKeyVaultNetworkAccessType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string PublicValue = "Public"; - private const string PrivateValue = "Private"; - - /// Public. - public static ManagedClusterKeyVaultNetworkAccessType Public { get; } = new ManagedClusterKeyVaultNetworkAccessType(PublicValue); - /// Private. - public static ManagedClusterKeyVaultNetworkAccessType Private { get; } = new ManagedClusterKeyVaultNetworkAccessType(PrivateValue); - /// Determines if two values are the same. - public static bool operator ==(ManagedClusterKeyVaultNetworkAccessType left, ManagedClusterKeyVaultNetworkAccessType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ManagedClusterKeyVaultNetworkAccessType left, ManagedClusterKeyVaultNetworkAccessType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ManagedClusterKeyVaultNetworkAccessType(string value) => new ManagedClusterKeyVaultNetworkAccessType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ManagedClusterKeyVaultNetworkAccessType other && Equals(other); - /// - public bool Equals(ManagedClusterKeyVaultNetworkAccessType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterListResult.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterListResult.Serialization.cs deleted file mode 100644 index be43b770c2233..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterListResult.Serialization.cs +++ /dev/null @@ -1,148 +0,0 @@ -// 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.ContainerService; - -namespace Azure.ResourceManager.ContainerService.Models -{ - internal partial class ManagedClusterListResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterListResult)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); - } - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterListResult 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(ManagedClusterListResult)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterListResult(document.RootElement, options); - } - - internal static ManagedClusterListResult DeserializeManagedClusterListResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - Optional nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ContainerServiceManagedClusterData.DeserializeContainerServiceManagedClusterData(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterListResult(Optional.ToList(value), nextLink.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(ManagedClusterListResult)} does not support '{options.Format}' format."); - } - } - - ManagedClusterListResult 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); - return DeserializeManagedClusterListResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterListResult)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterListResult.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterListResult.cs deleted file mode 100644 index 6d30f4cccf021..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterListResult.cs +++ /dev/null @@ -1,72 +0,0 @@ -// 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.ContainerService; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The response from the List Managed Clusters operation. - internal partial class ManagedClusterListResult - { - /// - /// 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 ManagedClusterListResult() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// The list of managed clusters. - /// The URL to get the next set of managed cluster results. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) - { - Value = value; - NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The list of managed clusters. - public IReadOnlyList Value { get; } - /// The URL to get the next set of managed cluster results. - public string NextLink { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerBackendPoolType.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerBackendPoolType.cs deleted file mode 100644 index b4b6442b20e9d..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerBackendPoolType.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The type of the managed inbound Load Balancer BackendPool. - public readonly partial struct ManagedClusterLoadBalancerBackendPoolType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ManagedClusterLoadBalancerBackendPoolType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string NodeIPConfigurationValue = "NodeIPConfiguration"; - private const string NodeIPValue = "NodeIP"; - - /// The type of the managed inbound Load Balancer BackendPool. https://cloud-provider-azure.sigs.k8s.io/topics/loadbalancer/#configure-load-balancer-backend. - public static ManagedClusterLoadBalancerBackendPoolType NodeIPConfiguration { get; } = new ManagedClusterLoadBalancerBackendPoolType(NodeIPConfigurationValue); - /// The type of the managed inbound Load Balancer BackendPool. https://cloud-provider-azure.sigs.k8s.io/topics/loadbalancer/#configure-load-balancer-backend. - public static ManagedClusterLoadBalancerBackendPoolType NodeIP { get; } = new ManagedClusterLoadBalancerBackendPoolType(NodeIPValue); - /// Determines if two values are the same. - public static bool operator ==(ManagedClusterLoadBalancerBackendPoolType left, ManagedClusterLoadBalancerBackendPoolType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ManagedClusterLoadBalancerBackendPoolType left, ManagedClusterLoadBalancerBackendPoolType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ManagedClusterLoadBalancerBackendPoolType(string value) => new ManagedClusterLoadBalancerBackendPoolType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ManagedClusterLoadBalancerBackendPoolType other && Equals(other); - /// - public bool Equals(ManagedClusterLoadBalancerBackendPoolType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfile.Serialization.cs deleted file mode 100644 index 56f5e95ad4847..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfile.Serialization.cs +++ /dev/null @@ -1,242 +0,0 @@ -// 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.Resources.Models; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ManagedClusterLoadBalancerProfile : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterLoadBalancerProfile)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(ManagedOutboundIPs)) - { - writer.WritePropertyName("managedOutboundIPs"u8); - writer.WriteObjectValue(ManagedOutboundIPs); - } - if (Optional.IsDefined(OutboundIPPrefixes)) - { - writer.WritePropertyName("outboundIPPrefixes"u8); - writer.WriteObjectValue(OutboundIPPrefixes); - } - if (Optional.IsDefined(OutboundIPs)) - { - writer.WritePropertyName("outboundIPs"u8); - writer.WriteObjectValue(OutboundIPs); - } - if (Optional.IsCollectionDefined(EffectiveOutboundIPs)) - { - writer.WritePropertyName("effectiveOutboundIPs"u8); - writer.WriteStartArray(); - foreach (var item in EffectiveOutboundIPs) - { - JsonSerializer.Serialize(writer, item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(AllocatedOutboundPorts)) - { - writer.WritePropertyName("allocatedOutboundPorts"u8); - writer.WriteNumberValue(AllocatedOutboundPorts.Value); - } - if (Optional.IsDefined(IdleTimeoutInMinutes)) - { - writer.WritePropertyName("idleTimeoutInMinutes"u8); - writer.WriteNumberValue(IdleTimeoutInMinutes.Value); - } - if (Optional.IsDefined(EnableMultipleStandardLoadBalancers)) - { - writer.WritePropertyName("enableMultipleStandardLoadBalancers"u8); - writer.WriteBooleanValue(EnableMultipleStandardLoadBalancers.Value); - } - if (Optional.IsDefined(BackendPoolType)) - { - writer.WritePropertyName("backendPoolType"u8); - writer.WriteStringValue(BackendPoolType.Value.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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterLoadBalancerProfile 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(ManagedClusterLoadBalancerProfile)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterLoadBalancerProfile(document.RootElement, options); - } - - internal static ManagedClusterLoadBalancerProfile DeserializeManagedClusterLoadBalancerProfile(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional managedOutboundIPs = default; - Optional outboundIPPrefixes = default; - Optional outboundIPs = default; - Optional> effectiveOutboundIPs = default; - Optional allocatedOutboundPorts = default; - Optional idleTimeoutInMinutes = default; - Optional enableMultipleStandardLoadBalancers = default; - Optional backendPoolType = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("managedOutboundIPs"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - managedOutboundIPs = ManagedClusterLoadBalancerProfileManagedOutboundIPs.DeserializeManagedClusterLoadBalancerProfileManagedOutboundIPs(property.Value); - continue; - } - if (property.NameEquals("outboundIPPrefixes"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - outboundIPPrefixes = ManagedClusterLoadBalancerProfileOutboundIPPrefixes.DeserializeManagedClusterLoadBalancerProfileOutboundIPPrefixes(property.Value); - continue; - } - if (property.NameEquals("outboundIPs"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - outboundIPs = ManagedClusterLoadBalancerProfileOutboundIPs.DeserializeManagedClusterLoadBalancerProfileOutboundIPs(property.Value); - continue; - } - if (property.NameEquals("effectiveOutboundIPs"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(JsonSerializer.Deserialize(item.GetRawText())); - } - effectiveOutboundIPs = array; - continue; - } - if (property.NameEquals("allocatedOutboundPorts"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - allocatedOutboundPorts = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("idleTimeoutInMinutes"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - idleTimeoutInMinutes = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("enableMultipleStandardLoadBalancers"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableMultipleStandardLoadBalancers = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("backendPoolType"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - backendPoolType = new ManagedClusterLoadBalancerBackendPoolType(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterLoadBalancerProfile(managedOutboundIPs.Value, outboundIPPrefixes.Value, outboundIPs.Value, Optional.ToList(effectiveOutboundIPs), Optional.ToNullable(allocatedOutboundPorts), Optional.ToNullable(idleTimeoutInMinutes), Optional.ToNullable(enableMultipleStandardLoadBalancers), Optional.ToNullable(backendPoolType), 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(ManagedClusterLoadBalancerProfile)} does not support '{options.Format}' format."); - } - } - - ManagedClusterLoadBalancerProfile 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); - return DeserializeManagedClusterLoadBalancerProfile(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterLoadBalancerProfile)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfile.cs deleted file mode 100644 index bddec2a284658..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfile.cs +++ /dev/null @@ -1,118 +0,0 @@ -// 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.Resources.Models; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Profile of the managed cluster load balancer. - public partial class ManagedClusterLoadBalancerProfile - { - /// - /// 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 ManagedClusterLoadBalancerProfile() - { - EffectiveOutboundIPs = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Desired managed outbound IPs for the cluster load balancer. - /// Desired outbound IP Prefix resources for the cluster load balancer. - /// Desired outbound IP resources for the cluster load balancer. - /// The effective outbound IP resources of the cluster load balancer. - /// The desired number of allocated SNAT ports per VM. Allowed values are in the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure dynamically allocating ports. - /// Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value is 30 minutes. - /// Enable multiple standard load balancers per AKS cluster or not. - /// The type of the managed inbound Load Balancer BackendPool. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterLoadBalancerProfile(ManagedClusterLoadBalancerProfileManagedOutboundIPs managedOutboundIPs, ManagedClusterLoadBalancerProfileOutboundIPPrefixes outboundIPPrefixes, ManagedClusterLoadBalancerProfileOutboundIPs outboundIPs, IList effectiveOutboundIPs, int? allocatedOutboundPorts, int? idleTimeoutInMinutes, bool? enableMultipleStandardLoadBalancers, ManagedClusterLoadBalancerBackendPoolType? backendPoolType, IDictionary serializedAdditionalRawData) - { - ManagedOutboundIPs = managedOutboundIPs; - OutboundIPPrefixes = outboundIPPrefixes; - OutboundIPs = outboundIPs; - EffectiveOutboundIPs = effectiveOutboundIPs; - AllocatedOutboundPorts = allocatedOutboundPorts; - IdleTimeoutInMinutes = idleTimeoutInMinutes; - EnableMultipleStandardLoadBalancers = enableMultipleStandardLoadBalancers; - BackendPoolType = backendPoolType; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Desired managed outbound IPs for the cluster load balancer. - public ManagedClusterLoadBalancerProfileManagedOutboundIPs ManagedOutboundIPs { get; set; } - /// Desired outbound IP Prefix resources for the cluster load balancer. - internal ManagedClusterLoadBalancerProfileOutboundIPPrefixes OutboundIPPrefixes { get; set; } - /// A list of public IP prefix resources. - public IList OutboundPublicIPPrefixes - { - get - { - if (OutboundIPPrefixes is null) - OutboundIPPrefixes = new ManagedClusterLoadBalancerProfileOutboundIPPrefixes(); - return OutboundIPPrefixes.PublicIPPrefixes; - } - } - - /// Desired outbound IP resources for the cluster load balancer. - internal ManagedClusterLoadBalancerProfileOutboundIPs OutboundIPs { get; set; } - /// A list of public IP resources. - public IList OutboundPublicIPs - { - get - { - if (OutboundIPs is null) - OutboundIPs = new ManagedClusterLoadBalancerProfileOutboundIPs(); - return OutboundIPs.PublicIPs; - } - } - - /// The effective outbound IP resources of the cluster load balancer. - public IList EffectiveOutboundIPs { get; } - /// The desired number of allocated SNAT ports per VM. Allowed values are in the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure dynamically allocating ports. - public int? AllocatedOutboundPorts { get; set; } - /// Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value is 30 minutes. - public int? IdleTimeoutInMinutes { get; set; } - /// Enable multiple standard load balancers per AKS cluster or not. - public bool? EnableMultipleStandardLoadBalancers { get; set; } - /// The type of the managed inbound Load Balancer BackendPool. - public ManagedClusterLoadBalancerBackendPoolType? BackendPoolType { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileManagedOutboundIPs.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileManagedOutboundIPs.Serialization.cs deleted file mode 100644 index 5790914695917..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileManagedOutboundIPs.Serialization.cs +++ /dev/null @@ -1,141 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class ManagedClusterLoadBalancerProfileManagedOutboundIPs : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterLoadBalancerProfileManagedOutboundIPs)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Count)) - { - writer.WritePropertyName("count"u8); - writer.WriteNumberValue(Count.Value); - } - if (Optional.IsDefined(CountIPv6)) - { - writer.WritePropertyName("countIPv6"u8); - writer.WriteNumberValue(CountIPv6.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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterLoadBalancerProfileManagedOutboundIPs 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(ManagedClusterLoadBalancerProfileManagedOutboundIPs)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterLoadBalancerProfileManagedOutboundIPs(document.RootElement, options); - } - - internal static ManagedClusterLoadBalancerProfileManagedOutboundIPs DeserializeManagedClusterLoadBalancerProfileManagedOutboundIPs(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional count = default; - Optional countIPv6 = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("count"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - count = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("countIPv6"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - countIPv6 = property.Value.GetInt32(); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterLoadBalancerProfileManagedOutboundIPs(Optional.ToNullable(count), Optional.ToNullable(countIPv6), 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(ManagedClusterLoadBalancerProfileManagedOutboundIPs)} does not support '{options.Format}' format."); - } - } - - ManagedClusterLoadBalancerProfileManagedOutboundIPs 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); - return DeserializeManagedClusterLoadBalancerProfileManagedOutboundIPs(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterLoadBalancerProfileManagedOutboundIPs)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileManagedOutboundIPs.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileManagedOutboundIPs.cs deleted file mode 100644 index ea9437cfd9303..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileManagedOutboundIPs.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Desired managed outbound IPs for the cluster load balancer. - public partial class ManagedClusterLoadBalancerProfileManagedOutboundIPs - { - /// - /// 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 ManagedClusterLoadBalancerProfileManagedOutboundIPs() - { - } - - /// Initializes a new instance of . - /// The desired number of IPv4 outbound IPs created/managed by Azure for the cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - /// The desired number of IPv6 outbound IPs created/managed by Azure for the cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 0 for single-stack and 1 for dual-stack. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterLoadBalancerProfileManagedOutboundIPs(int? count, int? countIPv6, IDictionary serializedAdditionalRawData) - { - Count = count; - CountIPv6 = countIPv6; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The desired number of IPv4 outbound IPs created/managed by Azure for the cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - public int? Count { get; set; } - /// The desired number of IPv6 outbound IPs created/managed by Azure for the cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 0 for single-stack and 1 for dual-stack. - public int? CountIPv6 { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPPrefixes.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPPrefixes.Serialization.cs deleted file mode 100644 index 4ba66d2af19d6..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPPrefixes.Serialization.cs +++ /dev/null @@ -1,137 +0,0 @@ -// 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.Resources.Models; - -namespace Azure.ResourceManager.ContainerService.Models -{ - internal partial class ManagedClusterLoadBalancerProfileOutboundIPPrefixes : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterLoadBalancerProfileOutboundIPPrefixes)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(PublicIPPrefixes)) - { - writer.WritePropertyName("publicIPPrefixes"u8); - writer.WriteStartArray(); - foreach (var item in PublicIPPrefixes) - { - JsonSerializer.Serialize(writer, 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterLoadBalancerProfileOutboundIPPrefixes 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(ManagedClusterLoadBalancerProfileOutboundIPPrefixes)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterLoadBalancerProfileOutboundIPPrefixes(document.RootElement, options); - } - - internal static ManagedClusterLoadBalancerProfileOutboundIPPrefixes DeserializeManagedClusterLoadBalancerProfileOutboundIPPrefixes(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> publicIPPrefixes = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("publicIPPrefixes"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(JsonSerializer.Deserialize(item.GetRawText())); - } - publicIPPrefixes = array; - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterLoadBalancerProfileOutboundIPPrefixes(Optional.ToList(publicIPPrefixes), 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(ManagedClusterLoadBalancerProfileOutboundIPPrefixes)} does not support '{options.Format}' format."); - } - } - - ManagedClusterLoadBalancerProfileOutboundIPPrefixes 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); - return DeserializeManagedClusterLoadBalancerProfileOutboundIPPrefixes(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterLoadBalancerProfileOutboundIPPrefixes)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPPrefixes.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPPrefixes.cs deleted file mode 100644 index e3e69398ac292..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPPrefixes.cs +++ /dev/null @@ -1,68 +0,0 @@ -// 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.Resources.Models; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Desired outbound IP Prefix resources for the cluster load balancer. - internal partial class ManagedClusterLoadBalancerProfileOutboundIPPrefixes - { - /// - /// 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 ManagedClusterLoadBalancerProfileOutboundIPPrefixes() - { - PublicIPPrefixes = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// A list of public IP prefix resources. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterLoadBalancerProfileOutboundIPPrefixes(IList publicIPPrefixes, IDictionary serializedAdditionalRawData) - { - PublicIPPrefixes = publicIPPrefixes; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// A list of public IP prefix resources. - public IList PublicIPPrefixes { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPs.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPs.Serialization.cs deleted file mode 100644 index 0eaae19a36c31..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPs.Serialization.cs +++ /dev/null @@ -1,137 +0,0 @@ -// 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.Resources.Models; - -namespace Azure.ResourceManager.ContainerService.Models -{ - internal partial class ManagedClusterLoadBalancerProfileOutboundIPs : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterLoadBalancerProfileOutboundIPs)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(PublicIPs)) - { - writer.WritePropertyName("publicIPs"u8); - writer.WriteStartArray(); - foreach (var item in PublicIPs) - { - JsonSerializer.Serialize(writer, 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterLoadBalancerProfileOutboundIPs 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(ManagedClusterLoadBalancerProfileOutboundIPs)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterLoadBalancerProfileOutboundIPs(document.RootElement, options); - } - - internal static ManagedClusterLoadBalancerProfileOutboundIPs DeserializeManagedClusterLoadBalancerProfileOutboundIPs(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> publicIPs = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("publicIPs"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(JsonSerializer.Deserialize(item.GetRawText())); - } - publicIPs = array; - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterLoadBalancerProfileOutboundIPs(Optional.ToList(publicIPs), 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(ManagedClusterLoadBalancerProfileOutboundIPs)} does not support '{options.Format}' format."); - } - } - - ManagedClusterLoadBalancerProfileOutboundIPs 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); - return DeserializeManagedClusterLoadBalancerProfileOutboundIPs(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterLoadBalancerProfileOutboundIPs)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPs.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPs.cs deleted file mode 100644 index 0e836d497df3e..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPs.cs +++ /dev/null @@ -1,68 +0,0 @@ -// 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.Resources.Models; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Desired outbound IP resources for the cluster load balancer. - internal partial class ManagedClusterLoadBalancerProfileOutboundIPs - { - /// - /// 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 ManagedClusterLoadBalancerProfileOutboundIPs() - { - PublicIPs = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// A list of public IP resources. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterLoadBalancerProfileOutboundIPs(IList publicIPs, IDictionary serializedAdditionalRawData) - { - PublicIPs = publicIPs; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// A list of public IP resources. - public IList PublicIPs { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterManagedOutboundIPProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterManagedOutboundIPProfile.Serialization.cs deleted file mode 100644 index 9dda229fd25d4..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterManagedOutboundIPProfile.Serialization.cs +++ /dev/null @@ -1,126 +0,0 @@ -// 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.ContainerService.Models -{ - internal partial class ManagedClusterManagedOutboundIPProfile : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterManagedOutboundIPProfile)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Count)) - { - writer.WritePropertyName("count"u8); - writer.WriteNumberValue(Count.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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterManagedOutboundIPProfile 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(ManagedClusterManagedOutboundIPProfile)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterManagedOutboundIPProfile(document.RootElement, options); - } - - internal static ManagedClusterManagedOutboundIPProfile DeserializeManagedClusterManagedOutboundIPProfile(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional count = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("count"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - count = property.Value.GetInt32(); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterManagedOutboundIPProfile(Optional.ToNullable(count), 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(ManagedClusterManagedOutboundIPProfile)} does not support '{options.Format}' format."); - } - } - - ManagedClusterManagedOutboundIPProfile 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); - return DeserializeManagedClusterManagedOutboundIPProfile(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterManagedOutboundIPProfile)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterManagedOutboundIPProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterManagedOutboundIPProfile.cs deleted file mode 100644 index 3e4c34f5bf30a..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterManagedOutboundIPProfile.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Profile of the managed outbound IP resources of the managed cluster. - internal partial class ManagedClusterManagedOutboundIPProfile - { - /// - /// 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 ManagedClusterManagedOutboundIPProfile() - { - } - - /// Initializes a new instance of . - /// The desired number of outbound IPs created/managed by Azure. Allowed values must be in the range of 1 to 16 (inclusive). The default value is 1. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterManagedOutboundIPProfile(int? count, IDictionary serializedAdditionalRawData) - { - Count = count; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The desired number of outbound IPs created/managed by Azure. Allowed values must be in the range of 1 to 16 (inclusive). The default value is 1. - public int? Count { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterMonitorProfileKubeStateMetrics.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterMonitorProfileKubeStateMetrics.Serialization.cs deleted file mode 100644 index ee01bd7343fd3..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterMonitorProfileKubeStateMetrics.Serialization.cs +++ /dev/null @@ -1,133 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class ManagedClusterMonitorProfileKubeStateMetrics : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterMonitorProfileKubeStateMetrics)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(MetricLabelsAllowlist)) - { - writer.WritePropertyName("metricLabelsAllowlist"u8); - writer.WriteStringValue(MetricLabelsAllowlist); - } - if (Optional.IsDefined(MetricAnnotationsAllowList)) - { - writer.WritePropertyName("metricAnnotationsAllowList"u8); - writer.WriteStringValue(MetricAnnotationsAllowList); - } - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterMonitorProfileKubeStateMetrics 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(ManagedClusterMonitorProfileKubeStateMetrics)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterMonitorProfileKubeStateMetrics(document.RootElement, options); - } - - internal static ManagedClusterMonitorProfileKubeStateMetrics DeserializeManagedClusterMonitorProfileKubeStateMetrics(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional metricLabelsAllowlist = default; - Optional metricAnnotationsAllowList = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("metricLabelsAllowlist"u8)) - { - metricLabelsAllowlist = property.Value.GetString(); - continue; - } - if (property.NameEquals("metricAnnotationsAllowList"u8)) - { - metricAnnotationsAllowList = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterMonitorProfileKubeStateMetrics(metricLabelsAllowlist.Value, metricAnnotationsAllowList.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(ManagedClusterMonitorProfileKubeStateMetrics)} does not support '{options.Format}' format."); - } - } - - ManagedClusterMonitorProfileKubeStateMetrics 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); - return DeserializeManagedClusterMonitorProfileKubeStateMetrics(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterMonitorProfileKubeStateMetrics)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterMonitorProfileKubeStateMetrics.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterMonitorProfileKubeStateMetrics.cs deleted file mode 100644 index c24e722f1e1f2..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterMonitorProfileKubeStateMetrics.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Kube State Metrics profile for the Azure Managed Prometheus addon. These optional settings are for the kube-state-metrics pod that is deployed with the addon. See aka.ms/AzureManagedPrometheus-optional-parameters for details. - public partial class ManagedClusterMonitorProfileKubeStateMetrics - { - /// - /// 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 ManagedClusterMonitorProfileKubeStateMetrics() - { - } - - /// Initializes a new instance of . - /// Comma-separated list of additional Kubernetes label keys that will be used in the resource's labels metric (Example: 'namespaces=[k8s-label-1,k8s-label-n,...],pods=[app],...'). By default the metric contains only resource name and namespace labels. - /// Comma-separated list of Kubernetes annotation keys that will be used in the resource's labels metric (Example: 'namespaces=[kubernetes.io/team,...],pods=[kubernetes.io/team],...'). By default the metric contains only resource name and namespace labels. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterMonitorProfileKubeStateMetrics(string metricLabelsAllowlist, string metricAnnotationsAllowList, IDictionary serializedAdditionalRawData) - { - MetricLabelsAllowlist = metricLabelsAllowlist; - MetricAnnotationsAllowList = metricAnnotationsAllowList; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Comma-separated list of additional Kubernetes label keys that will be used in the resource's labels metric (Example: 'namespaces=[k8s-label-1,k8s-label-n,...],pods=[app],...'). By default the metric contains only resource name and namespace labels. - public string MetricLabelsAllowlist { get; set; } - /// Comma-separated list of Kubernetes annotation keys that will be used in the resource's labels metric (Example: 'namespaces=[kubernetes.io/team,...],pods=[kubernetes.io/team],...'). By default the metric contains only resource name and namespace labels. - public string MetricAnnotationsAllowList { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterMonitorProfileMetrics.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterMonitorProfileMetrics.Serialization.cs deleted file mode 100644 index 1823554729ae3..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterMonitorProfileMetrics.Serialization.cs +++ /dev/null @@ -1,134 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class ManagedClusterMonitorProfileMetrics : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterMonitorProfileMetrics)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(IsEnabled); - if (Optional.IsDefined(KubeStateMetrics)) - { - writer.WritePropertyName("kubeStateMetrics"u8); - writer.WriteObjectValue(KubeStateMetrics); - } - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterMonitorProfileMetrics 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(ManagedClusterMonitorProfileMetrics)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterMonitorProfileMetrics(document.RootElement, options); - } - - internal static ManagedClusterMonitorProfileMetrics DeserializeManagedClusterMonitorProfileMetrics(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - bool enabled = default; - Optional kubeStateMetrics = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("enabled"u8)) - { - enabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("kubeStateMetrics"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - kubeStateMetrics = ManagedClusterMonitorProfileKubeStateMetrics.DeserializeManagedClusterMonitorProfileKubeStateMetrics(property.Value); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterMonitorProfileMetrics(enabled, kubeStateMetrics.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(ManagedClusterMonitorProfileMetrics)} does not support '{options.Format}' format."); - } - } - - ManagedClusterMonitorProfileMetrics 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); - return DeserializeManagedClusterMonitorProfileMetrics(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterMonitorProfileMetrics)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterMonitorProfileMetrics.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterMonitorProfileMetrics.cs deleted file mode 100644 index 545b9ef80851d..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterMonitorProfileMetrics.cs +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Metrics profile for the Azure Monitor managed service for Prometheus addon. Collect out-of-the-box Kubernetes infrastructure metrics to send to an Azure Monitor Workspace and configure additional scraping for custom targets. See aka.ms/AzureManagedPrometheus for an overview. - public partial class ManagedClusterMonitorProfileMetrics - { - /// - /// 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 . - /// Whether to enable or disable the Azure Managed Prometheus addon for Prometheus monitoring. See aka.ms/AzureManagedPrometheus-aks-enable for details on enabling and disabling. - public ManagedClusterMonitorProfileMetrics(bool isEnabled) - { - IsEnabled = isEnabled; - } - - /// Initializes a new instance of . - /// Whether to enable or disable the Azure Managed Prometheus addon for Prometheus monitoring. See aka.ms/AzureManagedPrometheus-aks-enable for details on enabling and disabling. - /// Kube State Metrics profile for the Azure Managed Prometheus addon. These optional settings are for the kube-state-metrics pod that is deployed with the addon. See aka.ms/AzureManagedPrometheus-optional-parameters for details. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterMonitorProfileMetrics(bool isEnabled, ManagedClusterMonitorProfileKubeStateMetrics kubeStateMetrics, IDictionary serializedAdditionalRawData) - { - IsEnabled = isEnabled; - KubeStateMetrics = kubeStateMetrics; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ManagedClusterMonitorProfileMetrics() - { - } - - /// Whether to enable or disable the Azure Managed Prometheus addon for Prometheus monitoring. See aka.ms/AzureManagedPrometheus-aks-enable for details on enabling and disabling. - public bool IsEnabled { get; set; } - /// Kube State Metrics profile for the Azure Managed Prometheus addon. These optional settings are for the kube-state-metrics pod that is deployed with the addon. See aka.ms/AzureManagedPrometheus-optional-parameters for details. - public ManagedClusterMonitorProfileKubeStateMetrics KubeStateMetrics { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNatGatewayProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNatGatewayProfile.Serialization.cs deleted file mode 100644 index 8a462e07916ba..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNatGatewayProfile.Serialization.cs +++ /dev/null @@ -1,167 +0,0 @@ -// 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.Resources.Models; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ManagedClusterNatGatewayProfile : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterNatGatewayProfile)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(ManagedOutboundIPProfile)) - { - writer.WritePropertyName("managedOutboundIPProfile"u8); - writer.WriteObjectValue(ManagedOutboundIPProfile); - } - if (Optional.IsCollectionDefined(EffectiveOutboundIPs)) - { - writer.WritePropertyName("effectiveOutboundIPs"u8); - writer.WriteStartArray(); - foreach (var item in EffectiveOutboundIPs) - { - JsonSerializer.Serialize(writer, item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(IdleTimeoutInMinutes)) - { - writer.WritePropertyName("idleTimeoutInMinutes"u8); - writer.WriteNumberValue(IdleTimeoutInMinutes.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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterNatGatewayProfile 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(ManagedClusterNatGatewayProfile)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterNatGatewayProfile(document.RootElement, options); - } - - internal static ManagedClusterNatGatewayProfile DeserializeManagedClusterNatGatewayProfile(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional managedOutboundIPProfile = default; - Optional> effectiveOutboundIPs = default; - Optional idleTimeoutInMinutes = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("managedOutboundIPProfile"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - managedOutboundIPProfile = ManagedClusterManagedOutboundIPProfile.DeserializeManagedClusterManagedOutboundIPProfile(property.Value); - continue; - } - if (property.NameEquals("effectiveOutboundIPs"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(JsonSerializer.Deserialize(item.GetRawText())); - } - effectiveOutboundIPs = array; - continue; - } - if (property.NameEquals("idleTimeoutInMinutes"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - idleTimeoutInMinutes = property.Value.GetInt32(); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterNatGatewayProfile(managedOutboundIPProfile.Value, Optional.ToList(effectiveOutboundIPs), Optional.ToNullable(idleTimeoutInMinutes), 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(ManagedClusterNatGatewayProfile)} does not support '{options.Format}' format."); - } - } - - ManagedClusterNatGatewayProfile 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); - return DeserializeManagedClusterNatGatewayProfile(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterNatGatewayProfile)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNatGatewayProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNatGatewayProfile.cs deleted file mode 100644 index d7aa8dd9c6095..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNatGatewayProfile.cs +++ /dev/null @@ -1,88 +0,0 @@ -// 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.Resources.Models; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Profile of the managed cluster NAT gateway. - public partial class ManagedClusterNatGatewayProfile - { - /// - /// 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 ManagedClusterNatGatewayProfile() - { - EffectiveOutboundIPs = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Profile of the managed outbound IP resources of the cluster NAT gateway. - /// The effective outbound IP resources of the cluster NAT gateway. - /// Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value is 4 minutes. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterNatGatewayProfile(ManagedClusterManagedOutboundIPProfile managedOutboundIPProfile, IList effectiveOutboundIPs, int? idleTimeoutInMinutes, IDictionary serializedAdditionalRawData) - { - ManagedOutboundIPProfile = managedOutboundIPProfile; - EffectiveOutboundIPs = effectiveOutboundIPs; - IdleTimeoutInMinutes = idleTimeoutInMinutes; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Profile of the managed outbound IP resources of the cluster NAT gateway. - internal ManagedClusterManagedOutboundIPProfile ManagedOutboundIPProfile { get; set; } - /// The desired number of outbound IPs created/managed by Azure. Allowed values must be in the range of 1 to 16 (inclusive). The default value is 1. - public int? ManagedOutboundIPCount - { - get => ManagedOutboundIPProfile is null ? default : ManagedOutboundIPProfile.Count; - set - { - if (ManagedOutboundIPProfile is null) - ManagedOutboundIPProfile = new ManagedClusterManagedOutboundIPProfile(); - ManagedOutboundIPProfile.Count = value; - } - } - - /// The effective outbound IP resources of the cluster NAT gateway. - public IList EffectiveOutboundIPs { get; } - /// Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value is 4 minutes. - public int? IdleTimeoutInMinutes { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNodeOSUpgradeChannel.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNodeOSUpgradeChannel.cs deleted file mode 100644 index 4f6e930b6d979..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNodeOSUpgradeChannel.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Manner in which the OS on your nodes is updated. The default is NodeImage. - public readonly partial struct ManagedClusterNodeOSUpgradeChannel : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ManagedClusterNodeOSUpgradeChannel(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string NoneValue = "None"; - private const string UnmanagedValue = "Unmanaged"; - private const string NodeImageValue = "NodeImage"; - - /// No attempt to update your machines OS will be made either by OS or by rolling VHDs. This means you are responsible for your security updates. - public static ManagedClusterNodeOSUpgradeChannel None { get; } = new ManagedClusterNodeOSUpgradeChannel(NoneValue); - /// OS updates will be applied automatically through the OS built-in patching infrastructure. Newly scaled in machines will be unpatched initially and will be patched at some point by the OS's infrastructure. Behavior of this option depends on the OS in question. Ubuntu and Mariner apply security patches through unattended upgrade roughly once a day around 06:00 UTC. Windows does not apply security patches automatically and so for them this option is equivalent to None till further notice. - public static ManagedClusterNodeOSUpgradeChannel Unmanaged { get; } = new ManagedClusterNodeOSUpgradeChannel(UnmanagedValue); - /// AKS will update the nodes with a newly patched VHD containing security fixes and bugfixes on a weekly cadence. With the VHD update machines will be rolling reimaged to that VHD following maintenance windows and surge settings. No extra VHD cost is incurred when choosing this option as AKS hosts the images. - public static ManagedClusterNodeOSUpgradeChannel NodeImage { get; } = new ManagedClusterNodeOSUpgradeChannel(NodeImageValue); - /// Determines if two values are the same. - public static bool operator ==(ManagedClusterNodeOSUpgradeChannel left, ManagedClusterNodeOSUpgradeChannel right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ManagedClusterNodeOSUpgradeChannel left, ManagedClusterNodeOSUpgradeChannel right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ManagedClusterNodeOSUpgradeChannel(string value) => new ManagedClusterNodeOSUpgradeChannel(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ManagedClusterNodeOSUpgradeChannel other && Equals(other); - /// - public bool Equals(ManagedClusterNodeOSUpgradeChannel other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterOidcIssuerProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterOidcIssuerProfile.Serialization.cs deleted file mode 100644 index 860a3fa3abd27..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterOidcIssuerProfile.Serialization.cs +++ /dev/null @@ -1,137 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class ManagedClusterOidcIssuerProfile : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterOidcIssuerProfile)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(IssuerUriInfo)) - { - writer.WritePropertyName("issuerURL"u8); - writer.WriteStringValue(IssuerUriInfo); - } - if (Optional.IsDefined(IsEnabled)) - { - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(IsEnabled.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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterOidcIssuerProfile 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(ManagedClusterOidcIssuerProfile)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterOidcIssuerProfile(document.RootElement, options); - } - - internal static ManagedClusterOidcIssuerProfile DeserializeManagedClusterOidcIssuerProfile(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional issuerUrl = default; - Optional enabled = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("issuerURL"u8)) - { - issuerUrl = property.Value.GetString(); - continue; - } - if (property.NameEquals("enabled"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enabled = property.Value.GetBoolean(); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterOidcIssuerProfile(issuerUrl.Value, Optional.ToNullable(enabled), 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(ManagedClusterOidcIssuerProfile)} does not support '{options.Format}' format."); - } - } - - ManagedClusterOidcIssuerProfile 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); - return DeserializeManagedClusterOidcIssuerProfile(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterOidcIssuerProfile)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterOidcIssuerProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterOidcIssuerProfile.cs deleted file mode 100644 index ce6f2d2bcf025..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterOidcIssuerProfile.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The OIDC issuer profile of the Managed Cluster. - public partial class ManagedClusterOidcIssuerProfile - { - /// - /// 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 ManagedClusterOidcIssuerProfile() - { - } - - /// Initializes a new instance of . - /// The OIDC issuer url of the Managed Cluster. - /// Whether the OIDC issuer is enabled. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterOidcIssuerProfile(string issuerUriInfo, bool? isEnabled, IDictionary serializedAdditionalRawData) - { - IssuerUriInfo = issuerUriInfo; - IsEnabled = isEnabled; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The OIDC issuer url of the Managed Cluster. - public string IssuerUriInfo { get; } - /// Whether the OIDC issuer is enabled. - public bool? IsEnabled { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentity.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentity.Serialization.cs deleted file mode 100644 index 7b284659ce2d3..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentity.Serialization.cs +++ /dev/null @@ -1,176 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class ManagedClusterPodIdentity : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterPodIdentity)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - writer.WritePropertyName("namespace"u8); - writer.WriteStringValue(Namespace); - if (Optional.IsDefined(BindingSelector)) - { - writer.WritePropertyName("bindingSelector"u8); - writer.WriteStringValue(BindingSelector); - } - writer.WritePropertyName("identity"u8); - writer.WriteObjectValue(Identity); - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); - } - if (options.Format != "W" && Optional.IsDefined(ProvisioningInfo)) - { - writer.WritePropertyName("provisioningInfo"u8); - writer.WriteObjectValue(ProvisioningInfo); - } - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterPodIdentity 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(ManagedClusterPodIdentity)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterPodIdentity(document.RootElement, options); - } - - internal static ManagedClusterPodIdentity DeserializeManagedClusterPodIdentity(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string name = default; - string @namespace = default; - Optional bindingSelector = default; - ContainerServiceUserAssignedIdentity identity = default; - Optional provisioningState = default; - Optional provisioningInfo = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("namespace"u8)) - { - @namespace = property.Value.GetString(); - continue; - } - if (property.NameEquals("bindingSelector"u8)) - { - bindingSelector = property.Value.GetString(); - continue; - } - if (property.NameEquals("identity"u8)) - { - identity = ContainerServiceUserAssignedIdentity.DeserializeContainerServiceUserAssignedIdentity(property.Value); - continue; - } - if (property.NameEquals("provisioningState"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new ManagedClusterPodIdentityProvisioningState(property.Value.GetString()); - continue; - } - if (property.NameEquals("provisioningInfo"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningInfo = ManagedClusterPodIdentityProvisioningInfo.DeserializeManagedClusterPodIdentityProvisioningInfo(property.Value); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterPodIdentity(name, @namespace, bindingSelector.Value, identity, Optional.ToNullable(provisioningState), provisioningInfo.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(ManagedClusterPodIdentity)} does not support '{options.Format}' format."); - } - } - - ManagedClusterPodIdentity 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); - return DeserializeManagedClusterPodIdentity(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterPodIdentity)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentity.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentity.cs deleted file mode 100644 index f60889e56a758..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentity.cs +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Details about the pod identity assigned to the Managed Cluster. - public partial class ManagedClusterPodIdentity - { - /// - /// 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 pod identity. - /// The namespace of the pod identity. - /// The user assigned identity details. - /// , or is null. - public ManagedClusterPodIdentity(string name, string @namespace, ContainerServiceUserAssignedIdentity identity) - { - Argument.AssertNotNull(name, nameof(name)); - Argument.AssertNotNull(@namespace, nameof(@namespace)); - Argument.AssertNotNull(identity, nameof(identity)); - - Name = name; - Namespace = @namespace; - Identity = identity; - } - - /// Initializes a new instance of . - /// The name of the pod identity. - /// The namespace of the pod identity. - /// The binding selector to use for the AzureIdentityBinding resource. - /// The user assigned identity details. - /// The current provisioning state of the pod identity. - /// - /// Keeps track of any properties unknown to the library. - internal ManagedClusterPodIdentity(string name, string @namespace, string bindingSelector, ContainerServiceUserAssignedIdentity identity, ManagedClusterPodIdentityProvisioningState? provisioningState, ManagedClusterPodIdentityProvisioningInfo provisioningInfo, IDictionary serializedAdditionalRawData) - { - Name = name; - Namespace = @namespace; - BindingSelector = bindingSelector; - Identity = identity; - ProvisioningState = provisioningState; - ProvisioningInfo = provisioningInfo; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ManagedClusterPodIdentity() - { - } - - /// The name of the pod identity. - public string Name { get; set; } - /// The namespace of the pod identity. - public string Namespace { get; set; } - /// The binding selector to use for the AzureIdentityBinding resource. - public string BindingSelector { get; set; } - /// The user assigned identity details. - public ContainerServiceUserAssignedIdentity Identity { get; set; } - /// The current provisioning state of the pod identity. - public ManagedClusterPodIdentityProvisioningState? ProvisioningState { get; } - /// Gets the provisioning info. - internal ManagedClusterPodIdentityProvisioningInfo ProvisioningInfo { get; } - /// Details about the error. - public ResponseError ErrorDetail - { - get => ProvisioningInfo?.ErrorDetail; - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityException.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityException.Serialization.cs deleted file mode 100644 index 96c77564a5b8c..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityException.Serialization.cs +++ /dev/null @@ -1,146 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class ManagedClusterPodIdentityException : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterPodIdentityException)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - writer.WritePropertyName("namespace"u8); - writer.WriteStringValue(Namespace); - writer.WritePropertyName("podLabels"u8); - writer.WriteStartObject(); - foreach (var item in PodLabels) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterPodIdentityException 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(ManagedClusterPodIdentityException)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterPodIdentityException(document.RootElement, options); - } - - internal static ManagedClusterPodIdentityException DeserializeManagedClusterPodIdentityException(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string name = default; - string @namespace = default; - IDictionary podLabels = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("namespace"u8)) - { - @namespace = property.Value.GetString(); - continue; - } - if (property.NameEquals("podLabels"u8)) - { - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - podLabels = dictionary; - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterPodIdentityException(name, @namespace, podLabels, 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(ManagedClusterPodIdentityException)} does not support '{options.Format}' format."); - } - } - - ManagedClusterPodIdentityException 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); - return DeserializeManagedClusterPodIdentityException(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterPodIdentityException)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityException.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityException.cs deleted file mode 100644 index 52d4beeb8f7d1..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityException.cs +++ /dev/null @@ -1,90 +0,0 @@ -// 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.ContainerService.Models -{ - /// See [disable AAD Pod Identity for a specific Pod/Application](https://azure.github.io/aad-pod-identity/docs/configure/application_exception/) for more details. - public partial class ManagedClusterPodIdentityException - { - /// - /// 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 pod identity exception. - /// The namespace of the pod identity exception. - /// The pod labels to match. - /// , or is null. - public ManagedClusterPodIdentityException(string name, string @namespace, IDictionary podLabels) - { - Argument.AssertNotNull(name, nameof(name)); - Argument.AssertNotNull(@namespace, nameof(@namespace)); - Argument.AssertNotNull(podLabels, nameof(podLabels)); - - Name = name; - Namespace = @namespace; - PodLabels = podLabels; - } - - /// Initializes a new instance of . - /// The name of the pod identity exception. - /// The namespace of the pod identity exception. - /// The pod labels to match. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterPodIdentityException(string name, string @namespace, IDictionary podLabels, IDictionary serializedAdditionalRawData) - { - Name = name; - Namespace = @namespace; - PodLabels = podLabels; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ManagedClusterPodIdentityException() - { - } - - /// The name of the pod identity exception. - public string Name { get; set; } - /// The namespace of the pod identity exception. - public string Namespace { get; set; } - /// The pod labels to match. - public IDictionary PodLabels { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProfile.Serialization.cs deleted file mode 100644 index d879b8ba46d8f..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProfile.Serialization.cs +++ /dev/null @@ -1,191 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class ManagedClusterPodIdentityProfile : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterPodIdentityProfile)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(IsEnabled)) - { - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(IsEnabled.Value); - } - if (Optional.IsDefined(AllowNetworkPluginKubenet)) - { - writer.WritePropertyName("allowNetworkPluginKubenet"u8); - writer.WriteBooleanValue(AllowNetworkPluginKubenet.Value); - } - if (Optional.IsCollectionDefined(UserAssignedIdentities)) - { - writer.WritePropertyName("userAssignedIdentities"u8); - writer.WriteStartArray(); - foreach (var item in UserAssignedIdentities) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(UserAssignedIdentityExceptions)) - { - writer.WritePropertyName("userAssignedIdentityExceptions"u8); - writer.WriteStartArray(); - foreach (var item in UserAssignedIdentityExceptions) - { - writer.WriteObjectValue(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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterPodIdentityProfile 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(ManagedClusterPodIdentityProfile)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterPodIdentityProfile(document.RootElement, options); - } - - internal static ManagedClusterPodIdentityProfile DeserializeManagedClusterPodIdentityProfile(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional enabled = default; - Optional allowNetworkPluginKubenet = default; - Optional> userAssignedIdentities = default; - Optional> userAssignedIdentityExceptions = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("enabled"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("allowNetworkPluginKubenet"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - allowNetworkPluginKubenet = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("userAssignedIdentities"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ManagedClusterPodIdentity.DeserializeManagedClusterPodIdentity(item)); - } - userAssignedIdentities = array; - continue; - } - if (property.NameEquals("userAssignedIdentityExceptions"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ManagedClusterPodIdentityException.DeserializeManagedClusterPodIdentityException(item)); - } - userAssignedIdentityExceptions = array; - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterPodIdentityProfile(Optional.ToNullable(enabled), Optional.ToNullable(allowNetworkPluginKubenet), Optional.ToList(userAssignedIdentities), Optional.ToList(userAssignedIdentityExceptions), 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(ManagedClusterPodIdentityProfile)} does not support '{options.Format}' format."); - } - } - - ManagedClusterPodIdentityProfile 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); - return DeserializeManagedClusterPodIdentityProfile(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterPodIdentityProfile)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProfile.cs deleted file mode 100644 index f153f0eda48d1..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProfile.cs +++ /dev/null @@ -1,80 +0,0 @@ -// 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.ContainerService.Models -{ - /// See [use AAD pod identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity) for more details on pod identity integration. - public partial class ManagedClusterPodIdentityProfile - { - /// - /// 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 ManagedClusterPodIdentityProfile() - { - UserAssignedIdentities = new ChangeTrackingList(); - UserAssignedIdentityExceptions = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Whether the pod identity addon is enabled. - /// Running in Kubenet is disabled by default due to the security related nature of AAD Pod Identity and the risks of IP spoofing. See [using Kubenet network plugin with AAD Pod Identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity#using-kubenet-network-plugin-with-azure-active-directory-pod-managed-identities) for more information. - /// The pod identities to use in the cluster. - /// The pod identity exceptions to allow. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterPodIdentityProfile(bool? isEnabled, bool? allowNetworkPluginKubenet, IList userAssignedIdentities, IList userAssignedIdentityExceptions, IDictionary serializedAdditionalRawData) - { - IsEnabled = isEnabled; - AllowNetworkPluginKubenet = allowNetworkPluginKubenet; - UserAssignedIdentities = userAssignedIdentities; - UserAssignedIdentityExceptions = userAssignedIdentityExceptions; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Whether the pod identity addon is enabled. - public bool? IsEnabled { get; set; } - /// Running in Kubenet is disabled by default due to the security related nature of AAD Pod Identity and the risks of IP spoofing. See [using Kubenet network plugin with AAD Pod Identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity#using-kubenet-network-plugin-with-azure-active-directory-pod-managed-identities) for more information. - public bool? AllowNetworkPluginKubenet { get; set; } - /// The pod identities to use in the cluster. - public IList UserAssignedIdentities { get; } - /// The pod identity exceptions to allow. - public IList UserAssignedIdentityExceptions { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProvisioningError.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProvisioningError.Serialization.cs deleted file mode 100644 index 8ebb23327b2d3..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProvisioningError.Serialization.cs +++ /dev/null @@ -1,127 +0,0 @@ -// 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; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - internal partial class ManagedClusterPodIdentityProvisioningError : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterPodIdentityProvisioningError)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(ErrorDetail)) - { - writer.WritePropertyName("error"u8); - JsonSerializer.Serialize(writer, ErrorDetail); - } - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterPodIdentityProvisioningError 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(ManagedClusterPodIdentityProvisioningError)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterPodIdentityProvisioningError(document.RootElement, options); - } - - internal static ManagedClusterPodIdentityProvisioningError DeserializeManagedClusterPodIdentityProvisioningError(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional error = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("error"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - error = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterPodIdentityProvisioningError(error.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(ManagedClusterPodIdentityProvisioningError)} does not support '{options.Format}' format."); - } - } - - ManagedClusterPodIdentityProvisioningError 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); - return DeserializeManagedClusterPodIdentityProvisioningError(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterPodIdentityProvisioningError)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProvisioningError.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProvisioningError.cs deleted file mode 100644 index 03c277248759f..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProvisioningError.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// An error response from the pod identity provisioning. - internal partial class ManagedClusterPodIdentityProvisioningError - { - /// - /// 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 ManagedClusterPodIdentityProvisioningError() - { - } - - /// Initializes a new instance of . - /// Details about the error. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterPodIdentityProvisioningError(ResponseError errorDetail, IDictionary serializedAdditionalRawData) - { - ErrorDetail = errorDetail; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Details about the error. - public ResponseError ErrorDetail { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProvisioningInfo.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProvisioningInfo.Serialization.cs deleted file mode 100644 index eaadbeaea8c3f..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProvisioningInfo.Serialization.cs +++ /dev/null @@ -1,126 +0,0 @@ -// 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.ContainerService.Models -{ - internal partial class ManagedClusterPodIdentityProvisioningInfo : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterPodIdentityProvisioningInfo)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Error)) - { - writer.WritePropertyName("error"u8); - writer.WriteObjectValue(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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterPodIdentityProvisioningInfo 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(ManagedClusterPodIdentityProvisioningInfo)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterPodIdentityProvisioningInfo(document.RootElement, options); - } - - internal static ManagedClusterPodIdentityProvisioningInfo DeserializeManagedClusterPodIdentityProvisioningInfo(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional error = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("error"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - error = ManagedClusterPodIdentityProvisioningError.DeserializeManagedClusterPodIdentityProvisioningError(property.Value); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterPodIdentityProvisioningInfo(error.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(ManagedClusterPodIdentityProvisioningInfo)} does not support '{options.Format}' format."); - } - } - - ManagedClusterPodIdentityProvisioningInfo 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); - return DeserializeManagedClusterPodIdentityProvisioningInfo(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterPodIdentityProvisioningInfo)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProvisioningState.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProvisioningState.cs deleted file mode 100644 index b2149f241d5ee..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProvisioningState.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The current provisioning state of the pod identity. - public readonly partial struct ManagedClusterPodIdentityProvisioningState : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ManagedClusterPodIdentityProvisioningState(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AssignedValue = "Assigned"; - private const string CanceledValue = "Canceled"; - private const string DeletingValue = "Deleting"; - private const string FailedValue = "Failed"; - private const string SucceededValue = "Succeeded"; - private const string UpdatingValue = "Updating"; - - /// Assigned. - public static ManagedClusterPodIdentityProvisioningState Assigned { get; } = new ManagedClusterPodIdentityProvisioningState(AssignedValue); - /// Canceled. - public static ManagedClusterPodIdentityProvisioningState Canceled { get; } = new ManagedClusterPodIdentityProvisioningState(CanceledValue); - /// Deleting. - public static ManagedClusterPodIdentityProvisioningState Deleting { get; } = new ManagedClusterPodIdentityProvisioningState(DeletingValue); - /// Failed. - public static ManagedClusterPodIdentityProvisioningState Failed { get; } = new ManagedClusterPodIdentityProvisioningState(FailedValue); - /// Succeeded. - public static ManagedClusterPodIdentityProvisioningState Succeeded { get; } = new ManagedClusterPodIdentityProvisioningState(SucceededValue); - /// Updating. - public static ManagedClusterPodIdentityProvisioningState Updating { get; } = new ManagedClusterPodIdentityProvisioningState(UpdatingValue); - /// Determines if two values are the same. - public static bool operator ==(ManagedClusterPodIdentityProvisioningState left, ManagedClusterPodIdentityProvisioningState right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ManagedClusterPodIdentityProvisioningState left, ManagedClusterPodIdentityProvisioningState right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ManagedClusterPodIdentityProvisioningState(string value) => new ManagedClusterPodIdentityProvisioningState(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ManagedClusterPodIdentityProvisioningState other && Equals(other); - /// - public bool Equals(ManagedClusterPodIdentityProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPoolUpgradeProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPoolUpgradeProfile.Serialization.cs deleted file mode 100644 index 879bdbf2f33f8..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPoolUpgradeProfile.Serialization.cs +++ /dev/null @@ -1,163 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class ManagedClusterPoolUpgradeProfile : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterPoolUpgradeProfile)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("kubernetesVersion"u8); - writer.WriteStringValue(KubernetesVersion); - if (Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - writer.WritePropertyName("osType"u8); - writer.WriteStringValue(OSType.ToString()); - if (Optional.IsCollectionDefined(Upgrades)) - { - writer.WritePropertyName("upgrades"u8); - writer.WriteStartArray(); - foreach (var item in Upgrades) - { - writer.WriteObjectValue(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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterPoolUpgradeProfile 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(ManagedClusterPoolUpgradeProfile)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterPoolUpgradeProfile(document.RootElement, options); - } - - internal static ManagedClusterPoolUpgradeProfile DeserializeManagedClusterPoolUpgradeProfile(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string kubernetesVersion = default; - Optional name = default; - ContainerServiceOSType osType = default; - Optional> upgrades = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("kubernetesVersion"u8)) - { - kubernetesVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("osType"u8)) - { - osType = new ContainerServiceOSType(property.Value.GetString()); - continue; - } - if (property.NameEquals("upgrades"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ManagedClusterPoolUpgradeProfileUpgradesItem.DeserializeManagedClusterPoolUpgradeProfileUpgradesItem(item)); - } - upgrades = array; - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterPoolUpgradeProfile(kubernetesVersion, name.Value, osType, Optional.ToList(upgrades), 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(ManagedClusterPoolUpgradeProfile)} does not support '{options.Format}' format."); - } - } - - ManagedClusterPoolUpgradeProfile 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); - return DeserializeManagedClusterPoolUpgradeProfile(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterPoolUpgradeProfile)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPoolUpgradeProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPoolUpgradeProfile.cs deleted file mode 100644 index b0f9c0d2721ba..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPoolUpgradeProfile.cs +++ /dev/null @@ -1,91 +0,0 @@ -// 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.ContainerService.Models -{ - /// The list of available upgrade versions. - public partial class ManagedClusterPoolUpgradeProfile - { - /// - /// 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 Kubernetes version (major.minor.patch). - /// The operating system type. The default is Linux. - /// is null. - internal ManagedClusterPoolUpgradeProfile(string kubernetesVersion, ContainerServiceOSType osType) - { - Argument.AssertNotNull(kubernetesVersion, nameof(kubernetesVersion)); - - KubernetesVersion = kubernetesVersion; - OSType = osType; - Upgrades = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// The Kubernetes version (major.minor.patch). - /// The Agent Pool name. - /// The operating system type. The default is Linux. - /// List of orchestrator types and versions available for upgrade. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterPoolUpgradeProfile(string kubernetesVersion, string name, ContainerServiceOSType osType, IReadOnlyList upgrades, IDictionary serializedAdditionalRawData) - { - KubernetesVersion = kubernetesVersion; - Name = name; - OSType = osType; - Upgrades = upgrades; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ManagedClusterPoolUpgradeProfile() - { - } - - /// The Kubernetes version (major.minor.patch). - public string KubernetesVersion { get; } - /// The Agent Pool name. - public string Name { get; } - /// The operating system type. The default is Linux. - public ContainerServiceOSType OSType { get; } - /// List of orchestrator types and versions available for upgrade. - public IReadOnlyList Upgrades { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPoolUpgradeProfileUpgradesItem.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPoolUpgradeProfileUpgradesItem.Serialization.cs deleted file mode 100644 index d7a6d677f899e..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPoolUpgradeProfileUpgradesItem.Serialization.cs +++ /dev/null @@ -1,137 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class ManagedClusterPoolUpgradeProfileUpgradesItem : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterPoolUpgradeProfileUpgradesItem)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(KubernetesVersion)) - { - writer.WritePropertyName("kubernetesVersion"u8); - writer.WriteStringValue(KubernetesVersion); - } - if (Optional.IsDefined(IsPreview)) - { - writer.WritePropertyName("isPreview"u8); - writer.WriteBooleanValue(IsPreview.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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterPoolUpgradeProfileUpgradesItem 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(ManagedClusterPoolUpgradeProfileUpgradesItem)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterPoolUpgradeProfileUpgradesItem(document.RootElement, options); - } - - internal static ManagedClusterPoolUpgradeProfileUpgradesItem DeserializeManagedClusterPoolUpgradeProfileUpgradesItem(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional kubernetesVersion = default; - Optional isPreview = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("kubernetesVersion"u8)) - { - kubernetesVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("isPreview"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - isPreview = property.Value.GetBoolean(); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterPoolUpgradeProfileUpgradesItem(kubernetesVersion.Value, Optional.ToNullable(isPreview), 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(ManagedClusterPoolUpgradeProfileUpgradesItem)} does not support '{options.Format}' format."); - } - } - - ManagedClusterPoolUpgradeProfileUpgradesItem 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); - return DeserializeManagedClusterPoolUpgradeProfileUpgradesItem(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterPoolUpgradeProfileUpgradesItem)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterRunCommandContent.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterRunCommandContent.Serialization.cs deleted file mode 100644 index fa8eaa53959f8..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterRunCommandContent.Serialization.cs +++ /dev/null @@ -1,141 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class ManagedClusterRunCommandContent : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterRunCommandContent)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("command"u8); - writer.WriteStringValue(Command); - if (Optional.IsDefined(Context)) - { - writer.WritePropertyName("context"u8); - writer.WriteStringValue(Context); - } - if (Optional.IsDefined(ClusterToken)) - { - writer.WritePropertyName("clusterToken"u8); - writer.WriteStringValue(ClusterToken); - } - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterRunCommandContent 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(ManagedClusterRunCommandContent)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterRunCommandContent(document.RootElement, options); - } - - internal static ManagedClusterRunCommandContent DeserializeManagedClusterRunCommandContent(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string command = default; - Optional context = default; - Optional clusterToken = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("command"u8)) - { - command = property.Value.GetString(); - continue; - } - if (property.NameEquals("context"u8)) - { - context = property.Value.GetString(); - continue; - } - if (property.NameEquals("clusterToken"u8)) - { - clusterToken = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterRunCommandContent(command, context.Value, clusterToken.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(ManagedClusterRunCommandContent)} does not support '{options.Format}' format."); - } - } - - ManagedClusterRunCommandContent 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); - return DeserializeManagedClusterRunCommandContent(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterRunCommandContent)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterRunCommandResult.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterRunCommandResult.Serialization.cs deleted file mode 100644 index 0e2cd9fe8bd58..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterRunCommandResult.Serialization.cs +++ /dev/null @@ -1,215 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class ManagedClusterRunCommandResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterRunCommandResult)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(Id)) - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState); - } - if (options.Format != "W" && Optional.IsDefined(ExitCode)) - { - writer.WritePropertyName("exitCode"u8); - writer.WriteNumberValue(ExitCode.Value); - } - if (options.Format != "W" && Optional.IsDefined(StartedOn)) - { - writer.WritePropertyName("startedAt"u8); - writer.WriteStringValue(StartedOn.Value, "O"); - } - if (options.Format != "W" && Optional.IsDefined(FinishedOn)) - { - writer.WritePropertyName("finishedAt"u8); - writer.WriteStringValue(FinishedOn.Value, "O"); - } - if (options.Format != "W" && Optional.IsDefined(Logs)) - { - writer.WritePropertyName("logs"u8); - writer.WriteStringValue(Logs); - } - if (options.Format != "W" && Optional.IsDefined(Reason)) - { - writer.WritePropertyName("reason"u8); - writer.WriteStringValue(Reason); - } - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterRunCommandResult 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(ManagedClusterRunCommandResult)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterRunCommandResult(document.RootElement, options); - } - - internal static ManagedClusterRunCommandResult DeserializeManagedClusterRunCommandResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional id = default; - Optional provisioningState = default; - Optional exitCode = default; - Optional startedAt = default; - Optional finishedAt = default; - Optional logs = default; - Optional reason = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = property.Value.GetString(); - 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)) - { - provisioningState = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("exitCode"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - exitCode = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("startedAt"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - startedAt = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("finishedAt"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - finishedAt = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("logs"u8)) - { - logs = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("reason"u8)) - { - reason = property0.Value.GetString(); - continue; - } - } - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterRunCommandResult(id.Value, provisioningState.Value, Optional.ToNullable(exitCode), Optional.ToNullable(startedAt), Optional.ToNullable(finishedAt), logs.Value, reason.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(ManagedClusterRunCommandResult)} does not support '{options.Format}' format."); - } - } - - ManagedClusterRunCommandResult 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); - return DeserializeManagedClusterRunCommandResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterRunCommandResult)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterRunCommandResult.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterRunCommandResult.cs deleted file mode 100644 index c2e31dd5fc5a4..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterRunCommandResult.cs +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// run command result. - public partial class ManagedClusterRunCommandResult - { - /// - /// 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 ManagedClusterRunCommandResult() - { - } - - /// Initializes a new instance of . - /// The command id. - /// provisioning State. - /// The exit code of the command. - /// The time when the command started. - /// The time when the command finished. - /// The command output. - /// An explanation of why provisioningState is set to failed (if so). - /// Keeps track of any properties unknown to the library. - internal ManagedClusterRunCommandResult(string id, string provisioningState, int? exitCode, DateTimeOffset? startedOn, DateTimeOffset? finishedOn, string logs, string reason, IDictionary serializedAdditionalRawData) - { - Id = id; - ProvisioningState = provisioningState; - ExitCode = exitCode; - StartedOn = startedOn; - FinishedOn = finishedOn; - Logs = logs; - Reason = reason; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The command id. - public string Id { get; } - /// provisioning State. - public string ProvisioningState { get; } - /// The exit code of the command. - public int? ExitCode { get; } - /// The time when the command started. - public DateTimeOffset? StartedOn { get; } - /// The time when the command finished. - public DateTimeOffset? FinishedOn { get; } - /// The command output. - public string Logs { get; } - /// An explanation of why provisioningState is set to failed (if so). - public string Reason { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfile.Serialization.cs deleted file mode 100644 index e740f935a07fc..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfile.Serialization.cs +++ /dev/null @@ -1,171 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class ManagedClusterSecurityProfile : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterSecurityProfile)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Defender)) - { - writer.WritePropertyName("defender"u8); - writer.WriteObjectValue(Defender); - } - if (Optional.IsDefined(AzureKeyVaultKms)) - { - writer.WritePropertyName("azureKeyVaultKms"u8); - writer.WriteObjectValue(AzureKeyVaultKms); - } - if (Optional.IsDefined(WorkloadIdentity)) - { - writer.WritePropertyName("workloadIdentity"u8); - writer.WriteObjectValue(WorkloadIdentity); - } - if (Optional.IsDefined(ImageCleaner)) - { - writer.WritePropertyName("imageCleaner"u8); - writer.WriteObjectValue(ImageCleaner); - } - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterSecurityProfile 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(ManagedClusterSecurityProfile)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterSecurityProfile(document.RootElement, options); - } - - internal static ManagedClusterSecurityProfile DeserializeManagedClusterSecurityProfile(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional defender = default; - Optional azureKeyVaultKms = default; - Optional workloadIdentity = default; - Optional imageCleaner = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("defender"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - defender = ManagedClusterSecurityProfileDefender.DeserializeManagedClusterSecurityProfileDefender(property.Value); - continue; - } - if (property.NameEquals("azureKeyVaultKms"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - azureKeyVaultKms = ManagedClusterSecurityProfileKeyVaultKms.DeserializeManagedClusterSecurityProfileKeyVaultKms(property.Value); - continue; - } - if (property.NameEquals("workloadIdentity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - workloadIdentity = ManagedClusterSecurityProfileWorkloadIdentity.DeserializeManagedClusterSecurityProfileWorkloadIdentity(property.Value); - continue; - } - if (property.NameEquals("imageCleaner"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - imageCleaner = ManagedClusterSecurityProfileImageCleaner.DeserializeManagedClusterSecurityProfileImageCleaner(property.Value); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterSecurityProfile(defender.Value, azureKeyVaultKms.Value, workloadIdentity.Value, imageCleaner.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(ManagedClusterSecurityProfile)} does not support '{options.Format}' format."); - } - } - - ManagedClusterSecurityProfile 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); - return DeserializeManagedClusterSecurityProfile(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterSecurityProfile)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfile.cs deleted file mode 100644 index 73e5366552164..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfile.cs +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Security profile for the container service cluster. - public partial class ManagedClusterSecurityProfile - { - /// - /// 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 ManagedClusterSecurityProfile() - { - } - - /// Initializes a new instance of . - /// Microsoft Defender settings for the security profile. - /// Azure Key Vault [key management service](https://kubernetes.io/docs/tasks/administer-cluster/kms-provider/) settings for the security profile. - /// Workload identity settings for the security profile. Workload identity enables Kubernetes applications to access Azure cloud resources securely with Azure AD. See https://aka.ms/aks/wi for more details. - /// Image Cleaner settings for the security profile. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterSecurityProfile(ManagedClusterSecurityProfileDefender defender, ManagedClusterSecurityProfileKeyVaultKms azureKeyVaultKms, ManagedClusterSecurityProfileWorkloadIdentity workloadIdentity, ManagedClusterSecurityProfileImageCleaner imageCleaner, IDictionary serializedAdditionalRawData) - { - Defender = defender; - AzureKeyVaultKms = azureKeyVaultKms; - WorkloadIdentity = workloadIdentity; - ImageCleaner = imageCleaner; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Microsoft Defender settings for the security profile. - public ManagedClusterSecurityProfileDefender Defender { get; set; } - /// Azure Key Vault [key management service](https://kubernetes.io/docs/tasks/administer-cluster/kms-provider/) settings for the security profile. - public ManagedClusterSecurityProfileKeyVaultKms AzureKeyVaultKms { get; set; } - /// Workload identity settings for the security profile. Workload identity enables Kubernetes applications to access Azure cloud resources securely with Azure AD. See https://aka.ms/aks/wi for more details. - internal ManagedClusterSecurityProfileWorkloadIdentity WorkloadIdentity { get; set; } - /// Whether to enable workload identity. - public bool? IsWorkloadIdentityEnabled - { - get => WorkloadIdentity is null ? default : WorkloadIdentity.IsWorkloadIdentityEnabled; - set - { - if (WorkloadIdentity is null) - WorkloadIdentity = new ManagedClusterSecurityProfileWorkloadIdentity(); - WorkloadIdentity.IsWorkloadIdentityEnabled = value; - } - } - - /// Image Cleaner settings for the security profile. - public ManagedClusterSecurityProfileImageCleaner ImageCleaner { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileDefender.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileDefender.Serialization.cs deleted file mode 100644 index cd6c997ef4259..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileDefender.Serialization.cs +++ /dev/null @@ -1,141 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class ManagedClusterSecurityProfileDefender : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterSecurityProfileDefender)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(LogAnalyticsWorkspaceResourceId)) - { - writer.WritePropertyName("logAnalyticsWorkspaceResourceId"u8); - writer.WriteStringValue(LogAnalyticsWorkspaceResourceId); - } - if (Optional.IsDefined(SecurityMonitoring)) - { - writer.WritePropertyName("securityMonitoring"u8); - writer.WriteObjectValue(SecurityMonitoring); - } - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterSecurityProfileDefender 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(ManagedClusterSecurityProfileDefender)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterSecurityProfileDefender(document.RootElement, options); - } - - internal static ManagedClusterSecurityProfileDefender DeserializeManagedClusterSecurityProfileDefender(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional logAnalyticsWorkspaceResourceId = default; - Optional securityMonitoring = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("logAnalyticsWorkspaceResourceId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - logAnalyticsWorkspaceResourceId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("securityMonitoring"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - securityMonitoring = ManagedClusterSecurityProfileDefenderSecurityMonitoring.DeserializeManagedClusterSecurityProfileDefenderSecurityMonitoring(property.Value); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterSecurityProfileDefender(logAnalyticsWorkspaceResourceId.Value, securityMonitoring.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(ManagedClusterSecurityProfileDefender)} does not support '{options.Format}' format."); - } - } - - ManagedClusterSecurityProfileDefender 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); - return DeserializeManagedClusterSecurityProfileDefender(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterSecurityProfileDefender)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileDefender.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileDefender.cs deleted file mode 100644 index 6b2454c4db3ff..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileDefender.cs +++ /dev/null @@ -1,81 +0,0 @@ -// 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.ContainerService.Models -{ - /// Microsoft Defender settings for the security profile. - public partial class ManagedClusterSecurityProfileDefender - { - /// - /// 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 ManagedClusterSecurityProfileDefender() - { - } - - /// Initializes a new instance of . - /// Resource ID of the Log Analytics workspace to be associated with Microsoft Defender. When Microsoft Defender is enabled, this field is required and must be a valid workspace resource ID. When Microsoft Defender is disabled, leave the field empty. - /// Microsoft Defender threat detection for Cloud settings for the security profile. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterSecurityProfileDefender(ResourceIdentifier logAnalyticsWorkspaceResourceId, ManagedClusterSecurityProfileDefenderSecurityMonitoring securityMonitoring, IDictionary serializedAdditionalRawData) - { - LogAnalyticsWorkspaceResourceId = logAnalyticsWorkspaceResourceId; - SecurityMonitoring = securityMonitoring; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Resource ID of the Log Analytics workspace to be associated with Microsoft Defender. When Microsoft Defender is enabled, this field is required and must be a valid workspace resource ID. When Microsoft Defender is disabled, leave the field empty. - public ResourceIdentifier LogAnalyticsWorkspaceResourceId { get; set; } - /// Microsoft Defender threat detection for Cloud settings for the security profile. - internal ManagedClusterSecurityProfileDefenderSecurityMonitoring SecurityMonitoring { get; set; } - /// Whether to enable Defender threat detection. - public bool? IsSecurityMonitoringEnabled - { - get => SecurityMonitoring is null ? default : SecurityMonitoring.IsSecurityMonitoringEnabled; - set - { - if (SecurityMonitoring is null) - SecurityMonitoring = new ManagedClusterSecurityProfileDefenderSecurityMonitoring(); - SecurityMonitoring.IsSecurityMonitoringEnabled = value; - } - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileDefenderSecurityMonitoring.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileDefenderSecurityMonitoring.Serialization.cs deleted file mode 100644 index adf566ba6c95e..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileDefenderSecurityMonitoring.Serialization.cs +++ /dev/null @@ -1,126 +0,0 @@ -// 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.ContainerService.Models -{ - internal partial class ManagedClusterSecurityProfileDefenderSecurityMonitoring : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterSecurityProfileDefenderSecurityMonitoring)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(IsSecurityMonitoringEnabled)) - { - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(IsSecurityMonitoringEnabled.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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterSecurityProfileDefenderSecurityMonitoring 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(ManagedClusterSecurityProfileDefenderSecurityMonitoring)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterSecurityProfileDefenderSecurityMonitoring(document.RootElement, options); - } - - internal static ManagedClusterSecurityProfileDefenderSecurityMonitoring DeserializeManagedClusterSecurityProfileDefenderSecurityMonitoring(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional enabled = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("enabled"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enabled = property.Value.GetBoolean(); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterSecurityProfileDefenderSecurityMonitoring(Optional.ToNullable(enabled), 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(ManagedClusterSecurityProfileDefenderSecurityMonitoring)} does not support '{options.Format}' format."); - } - } - - ManagedClusterSecurityProfileDefenderSecurityMonitoring 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); - return DeserializeManagedClusterSecurityProfileDefenderSecurityMonitoring(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterSecurityProfileDefenderSecurityMonitoring)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileDefenderSecurityMonitoring.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileDefenderSecurityMonitoring.cs deleted file mode 100644 index 92d7c396a332b..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileDefenderSecurityMonitoring.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Microsoft Defender settings for the security profile threat detection. - internal partial class ManagedClusterSecurityProfileDefenderSecurityMonitoring - { - /// - /// 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 ManagedClusterSecurityProfileDefenderSecurityMonitoring() - { - } - - /// Initializes a new instance of . - /// Whether to enable Defender threat detection. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterSecurityProfileDefenderSecurityMonitoring(bool? isSecurityMonitoringEnabled, IDictionary serializedAdditionalRawData) - { - IsSecurityMonitoringEnabled = isSecurityMonitoringEnabled; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Whether to enable Defender threat detection. - public bool? IsSecurityMonitoringEnabled { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileImageCleaner.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileImageCleaner.Serialization.cs deleted file mode 100644 index 967b3fbf95c66..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileImageCleaner.Serialization.cs +++ /dev/null @@ -1,141 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class ManagedClusterSecurityProfileImageCleaner : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterSecurityProfileImageCleaner)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(IsEnabled)) - { - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(IsEnabled.Value); - } - if (Optional.IsDefined(IntervalHours)) - { - writer.WritePropertyName("intervalHours"u8); - writer.WriteNumberValue(IntervalHours.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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterSecurityProfileImageCleaner 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(ManagedClusterSecurityProfileImageCleaner)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterSecurityProfileImageCleaner(document.RootElement, options); - } - - internal static ManagedClusterSecurityProfileImageCleaner DeserializeManagedClusterSecurityProfileImageCleaner(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional enabled = default; - Optional intervalHours = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("enabled"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("intervalHours"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - intervalHours = property.Value.GetInt32(); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterSecurityProfileImageCleaner(Optional.ToNullable(enabled), Optional.ToNullable(intervalHours), 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(ManagedClusterSecurityProfileImageCleaner)} does not support '{options.Format}' format."); - } - } - - ManagedClusterSecurityProfileImageCleaner 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); - return DeserializeManagedClusterSecurityProfileImageCleaner(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterSecurityProfileImageCleaner)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileImageCleaner.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileImageCleaner.cs deleted file mode 100644 index 6289f9223f670..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileImageCleaner.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Image Cleaner removes unused images from nodes, freeing up disk space and helping to reduce attack surface area. Here are settings for the security profile. - public partial class ManagedClusterSecurityProfileImageCleaner - { - /// - /// 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 ManagedClusterSecurityProfileImageCleaner() - { - } - - /// Initializes a new instance of . - /// Whether to enable Image Cleaner on AKS cluster. - /// Image Cleaner scanning interval in hours. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterSecurityProfileImageCleaner(bool? isEnabled, int? intervalHours, IDictionary serializedAdditionalRawData) - { - IsEnabled = isEnabled; - IntervalHours = intervalHours; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Whether to enable Image Cleaner on AKS cluster. - public bool? IsEnabled { get; set; } - /// Image Cleaner scanning interval in hours. - public int? IntervalHours { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileKeyVaultKms.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileKeyVaultKms.Serialization.cs deleted file mode 100644 index 53cd3ca4a621b..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileKeyVaultKms.Serialization.cs +++ /dev/null @@ -1,167 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class ManagedClusterSecurityProfileKeyVaultKms : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterSecurityProfileKeyVaultKms)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(IsEnabled)) - { - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(IsEnabled.Value); - } - if (Optional.IsDefined(KeyId)) - { - writer.WritePropertyName("keyId"u8); - writer.WriteStringValue(KeyId); - } - if (Optional.IsDefined(KeyVaultNetworkAccess)) - { - writer.WritePropertyName("keyVaultNetworkAccess"u8); - writer.WriteStringValue(KeyVaultNetworkAccess.Value.ToString()); - } - if (Optional.IsDefined(KeyVaultResourceId)) - { - writer.WritePropertyName("keyVaultResourceId"u8); - writer.WriteStringValue(KeyVaultResourceId); - } - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterSecurityProfileKeyVaultKms 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(ManagedClusterSecurityProfileKeyVaultKms)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterSecurityProfileKeyVaultKms(document.RootElement, options); - } - - internal static ManagedClusterSecurityProfileKeyVaultKms DeserializeManagedClusterSecurityProfileKeyVaultKms(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional enabled = default; - Optional keyId = default; - Optional keyVaultNetworkAccess = default; - Optional keyVaultResourceId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("enabled"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("keyId"u8)) - { - keyId = property.Value.GetString(); - continue; - } - if (property.NameEquals("keyVaultNetworkAccess"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - keyVaultNetworkAccess = new ManagedClusterKeyVaultNetworkAccessType(property.Value.GetString()); - continue; - } - if (property.NameEquals("keyVaultResourceId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - keyVaultResourceId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterSecurityProfileKeyVaultKms(Optional.ToNullable(enabled), keyId.Value, Optional.ToNullable(keyVaultNetworkAccess), keyVaultResourceId.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(ManagedClusterSecurityProfileKeyVaultKms)} does not support '{options.Format}' format."); - } - } - - ManagedClusterSecurityProfileKeyVaultKms 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); - return DeserializeManagedClusterSecurityProfileKeyVaultKms(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterSecurityProfileKeyVaultKms)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileKeyVaultKms.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileKeyVaultKms.cs deleted file mode 100644 index adfa9e0437ddd..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileKeyVaultKms.cs +++ /dev/null @@ -1,78 +0,0 @@ -// 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.ContainerService.Models -{ - /// Azure Key Vault key management service settings for the security profile. - public partial class ManagedClusterSecurityProfileKeyVaultKms - { - /// - /// 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 ManagedClusterSecurityProfileKeyVaultKms() - { - } - - /// Initializes a new instance of . - /// Whether to enable Azure Key Vault key management service. The default is false. - /// Identifier of Azure Key Vault key. See [key identifier format](https://docs.microsoft.com/en-us/azure/key-vault/general/about-keys-secrets-certificates#vault-name-and-object-name) for more details. When Azure Key Vault key management service is enabled, this field is required and must be a valid key identifier. When Azure Key Vault key management service is disabled, leave the field empty. - /// Network access of key vault. The possible values are `Public` and `Private`. `Public` means the key vault allows public access from all networks. `Private` means the key vault disables public access and enables private link. The default value is `Public`. - /// Resource ID of key vault. When keyVaultNetworkAccess is `Private`, this field is required and must be a valid resource ID. When keyVaultNetworkAccess is `Public`, leave the field empty. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterSecurityProfileKeyVaultKms(bool? isEnabled, string keyId, ManagedClusterKeyVaultNetworkAccessType? keyVaultNetworkAccess, ResourceIdentifier keyVaultResourceId, IDictionary serializedAdditionalRawData) - { - IsEnabled = isEnabled; - KeyId = keyId; - KeyVaultNetworkAccess = keyVaultNetworkAccess; - KeyVaultResourceId = keyVaultResourceId; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Whether to enable Azure Key Vault key management service. The default is false. - public bool? IsEnabled { get; set; } - /// Identifier of Azure Key Vault key. See [key identifier format](https://docs.microsoft.com/en-us/azure/key-vault/general/about-keys-secrets-certificates#vault-name-and-object-name) for more details. When Azure Key Vault key management service is enabled, this field is required and must be a valid key identifier. When Azure Key Vault key management service is disabled, leave the field empty. - public string KeyId { get; set; } - /// Network access of key vault. The possible values are `Public` and `Private`. `Public` means the key vault allows public access from all networks. `Private` means the key vault disables public access and enables private link. The default value is `Public`. - public ManagedClusterKeyVaultNetworkAccessType? KeyVaultNetworkAccess { get; set; } - /// Resource ID of key vault. When keyVaultNetworkAccess is `Private`, this field is required and must be a valid resource ID. When keyVaultNetworkAccess is `Public`, leave the field empty. - public ResourceIdentifier KeyVaultResourceId { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileWorkloadIdentity.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileWorkloadIdentity.Serialization.cs deleted file mode 100644 index d0382ee19286f..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileWorkloadIdentity.Serialization.cs +++ /dev/null @@ -1,126 +0,0 @@ -// 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.ContainerService.Models -{ - internal partial class ManagedClusterSecurityProfileWorkloadIdentity : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterSecurityProfileWorkloadIdentity)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(IsWorkloadIdentityEnabled)) - { - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(IsWorkloadIdentityEnabled.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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterSecurityProfileWorkloadIdentity 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(ManagedClusterSecurityProfileWorkloadIdentity)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterSecurityProfileWorkloadIdentity(document.RootElement, options); - } - - internal static ManagedClusterSecurityProfileWorkloadIdentity DeserializeManagedClusterSecurityProfileWorkloadIdentity(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional enabled = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("enabled"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enabled = property.Value.GetBoolean(); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterSecurityProfileWorkloadIdentity(Optional.ToNullable(enabled), 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(ManagedClusterSecurityProfileWorkloadIdentity)} does not support '{options.Format}' format."); - } - } - - ManagedClusterSecurityProfileWorkloadIdentity 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); - return DeserializeManagedClusterSecurityProfileWorkloadIdentity(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterSecurityProfileWorkloadIdentity)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileWorkloadIdentity.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileWorkloadIdentity.cs deleted file mode 100644 index 7a0420c72506f..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileWorkloadIdentity.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Workload identity settings for the security profile. - internal partial class ManagedClusterSecurityProfileWorkloadIdentity - { - /// - /// 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 ManagedClusterSecurityProfileWorkloadIdentity() - { - } - - /// Initializes a new instance of . - /// Whether to enable workload identity. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterSecurityProfileWorkloadIdentity(bool? isWorkloadIdentityEnabled, IDictionary serializedAdditionalRawData) - { - IsWorkloadIdentityEnabled = isWorkloadIdentityEnabled; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Whether to enable workload identity. - public bool? IsWorkloadIdentityEnabled { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterServicePrincipalProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterServicePrincipalProfile.Serialization.cs deleted file mode 100644 index 350c3b556de02..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterServicePrincipalProfile.Serialization.cs +++ /dev/null @@ -1,130 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class ManagedClusterServicePrincipalProfile : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterServicePrincipalProfile)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("clientId"u8); - writer.WriteStringValue(ClientId); - if (Optional.IsDefined(Secret)) - { - writer.WritePropertyName("secret"u8); - writer.WriteStringValue(Secret); - } - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterServicePrincipalProfile 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(ManagedClusterServicePrincipalProfile)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterServicePrincipalProfile(document.RootElement, options); - } - - internal static ManagedClusterServicePrincipalProfile DeserializeManagedClusterServicePrincipalProfile(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string clientId = default; - Optional secret = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("clientId"u8)) - { - clientId = property.Value.GetString(); - continue; - } - if (property.NameEquals("secret"u8)) - { - secret = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterServicePrincipalProfile(clientId, secret.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(ManagedClusterServicePrincipalProfile)} does not support '{options.Format}' format."); - } - } - - ManagedClusterServicePrincipalProfile 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); - return DeserializeManagedClusterServicePrincipalProfile(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterServicePrincipalProfile)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSkuName.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSkuName.cs deleted file mode 100644 index f0e5b9dacea9d..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSkuName.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The name of a managed cluster SKU. - public readonly partial struct ManagedClusterSkuName : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ManagedClusterSkuName(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string BaseValue = "Base"; - - /// Base option for the AKS control plane. - public static ManagedClusterSkuName Base { get; } = new ManagedClusterSkuName(BaseValue); - /// Determines if two values are the same. - public static bool operator ==(ManagedClusterSkuName left, ManagedClusterSkuName right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ManagedClusterSkuName left, ManagedClusterSkuName right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ManagedClusterSkuName(string value) => new ManagedClusterSkuName(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ManagedClusterSkuName other && Equals(other); - /// - public bool Equals(ManagedClusterSkuName other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSkuTier.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSkuTier.cs deleted file mode 100644 index cc27797a8f75b..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSkuTier.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// If not specified, the default is 'Free'. See [AKS Pricing Tier](https://learn.microsoft.com/azure/aks/free-standard-pricing-tiers) for more details. - public readonly partial struct ManagedClusterSkuTier : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ManagedClusterSkuTier(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string PremiumValue = "Premium"; - private const string StandardValue = "Standard"; - private const string FreeValue = "Free"; - - /// Cluster has premium capabilities in addition to all of the capabilities included in 'Standard'. Premium enables selection of LongTermSupport (aka.ms/aks/lts) for certain Kubernetes versions. - public static ManagedClusterSkuTier Premium { get; } = new ManagedClusterSkuTier(PremiumValue); - /// Recommended for mission-critical and production workloads. Includes Kubernetes control plane autoscaling, workload-intensive testing, and up to 5,000 nodes per cluster. Guarantees 99.95% availability of the Kubernetes API server endpoint for clusters that use Availability Zones and 99.9% of availability for clusters that don't use Availability Zones. - public static ManagedClusterSkuTier Standard { get; } = new ManagedClusterSkuTier(StandardValue); - /// The cluster management is free, but charged for VM, storage, and networking usage. Best for experimenting, learning, simple testing, or workloads with fewer than 10 nodes. Not recommended for production use cases. - public static ManagedClusterSkuTier Free { get; } = new ManagedClusterSkuTier(FreeValue); - /// Determines if two values are the same. - public static bool operator ==(ManagedClusterSkuTier left, ManagedClusterSkuTier right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ManagedClusterSkuTier left, ManagedClusterSkuTier right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ManagedClusterSkuTier(string value) => new ManagedClusterSkuTier(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ManagedClusterSkuTier other && Equals(other); - /// - public bool Equals(ManagedClusterSkuTier other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfile.Serialization.cs deleted file mode 100644 index 123ec3741864f..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfile.Serialization.cs +++ /dev/null @@ -1,171 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class ManagedClusterStorageProfile : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterStorageProfile)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(DiskCsiDriver)) - { - writer.WritePropertyName("diskCSIDriver"u8); - writer.WriteObjectValue(DiskCsiDriver); - } - if (Optional.IsDefined(FileCsiDriver)) - { - writer.WritePropertyName("fileCSIDriver"u8); - writer.WriteObjectValue(FileCsiDriver); - } - if (Optional.IsDefined(SnapshotController)) - { - writer.WritePropertyName("snapshotController"u8); - writer.WriteObjectValue(SnapshotController); - } - if (Optional.IsDefined(BlobCsiDriver)) - { - writer.WritePropertyName("blobCSIDriver"u8); - writer.WriteObjectValue(BlobCsiDriver); - } - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterStorageProfile 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(ManagedClusterStorageProfile)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterStorageProfile(document.RootElement, options); - } - - internal static ManagedClusterStorageProfile DeserializeManagedClusterStorageProfile(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional diskCsiDriver = default; - Optional fileCsiDriver = default; - Optional snapshotController = default; - Optional blobCsiDriver = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("diskCSIDriver"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - diskCsiDriver = ManagedClusterStorageProfileDiskCsiDriver.DeserializeManagedClusterStorageProfileDiskCsiDriver(property.Value); - continue; - } - if (property.NameEquals("fileCSIDriver"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - fileCsiDriver = ManagedClusterStorageProfileFileCsiDriver.DeserializeManagedClusterStorageProfileFileCsiDriver(property.Value); - continue; - } - if (property.NameEquals("snapshotController"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - snapshotController = ManagedClusterStorageProfileSnapshotController.DeserializeManagedClusterStorageProfileSnapshotController(property.Value); - continue; - } - if (property.NameEquals("blobCSIDriver"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - blobCsiDriver = ManagedClusterStorageProfileBlobCsiDriver.DeserializeManagedClusterStorageProfileBlobCsiDriver(property.Value); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterStorageProfile(diskCsiDriver.Value, fileCsiDriver.Value, snapshotController.Value, blobCsiDriver.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(ManagedClusterStorageProfile)} does not support '{options.Format}' format."); - } - } - - ManagedClusterStorageProfile 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); - return DeserializeManagedClusterStorageProfile(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterStorageProfile)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfile.cs deleted file mode 100644 index ea5c58a098853..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfile.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Storage profile for the container service cluster. - public partial class ManagedClusterStorageProfile - { - /// - /// 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 ManagedClusterStorageProfile() - { - } - - /// Initializes a new instance of . - /// AzureDisk CSI Driver settings for the storage profile. - /// AzureFile CSI Driver settings for the storage profile. - /// Snapshot Controller settings for the storage profile. - /// AzureBlob CSI Driver settings for the storage profile. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterStorageProfile(ManagedClusterStorageProfileDiskCsiDriver diskCsiDriver, ManagedClusterStorageProfileFileCsiDriver fileCsiDriver, ManagedClusterStorageProfileSnapshotController snapshotController, ManagedClusterStorageProfileBlobCsiDriver blobCsiDriver, IDictionary serializedAdditionalRawData) - { - DiskCsiDriver = diskCsiDriver; - FileCsiDriver = fileCsiDriver; - SnapshotController = snapshotController; - BlobCsiDriver = blobCsiDriver; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// AzureDisk CSI Driver settings for the storage profile. - internal ManagedClusterStorageProfileDiskCsiDriver DiskCsiDriver { get; set; } - - /// AzureFile CSI Driver settings for the storage profile. - internal ManagedClusterStorageProfileFileCsiDriver FileCsiDriver { get; set; } - - /// Snapshot Controller settings for the storage profile. - internal ManagedClusterStorageProfileSnapshotController SnapshotController { get; set; } - - /// AzureBlob CSI Driver settings for the storage profile. - internal ManagedClusterStorageProfileBlobCsiDriver BlobCsiDriver { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileBlobCsiDriver.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileBlobCsiDriver.Serialization.cs deleted file mode 100644 index e2b5f1a291fa9..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileBlobCsiDriver.Serialization.cs +++ /dev/null @@ -1,126 +0,0 @@ -// 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.ContainerService.Models -{ - internal partial class ManagedClusterStorageProfileBlobCsiDriver : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterStorageProfileBlobCsiDriver)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(IsEnabled)) - { - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(IsEnabled.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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterStorageProfileBlobCsiDriver 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(ManagedClusterStorageProfileBlobCsiDriver)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterStorageProfileBlobCsiDriver(document.RootElement, options); - } - - internal static ManagedClusterStorageProfileBlobCsiDriver DeserializeManagedClusterStorageProfileBlobCsiDriver(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional enabled = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("enabled"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enabled = property.Value.GetBoolean(); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterStorageProfileBlobCsiDriver(Optional.ToNullable(enabled), 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(ManagedClusterStorageProfileBlobCsiDriver)} does not support '{options.Format}' format."); - } - } - - ManagedClusterStorageProfileBlobCsiDriver 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); - return DeserializeManagedClusterStorageProfileBlobCsiDriver(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterStorageProfileBlobCsiDriver)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileBlobCsiDriver.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileBlobCsiDriver.cs deleted file mode 100644 index 32fecc32abdca..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileBlobCsiDriver.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// AzureBlob CSI Driver settings for the storage profile. - internal partial class ManagedClusterStorageProfileBlobCsiDriver - { - /// - /// 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 ManagedClusterStorageProfileBlobCsiDriver() - { - } - - /// Initializes a new instance of . - /// Whether to enable AzureBlob CSI Driver. The default value is false. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterStorageProfileBlobCsiDriver(bool? isEnabled, IDictionary serializedAdditionalRawData) - { - IsEnabled = isEnabled; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Whether to enable AzureBlob CSI Driver. The default value is false. - public bool? IsEnabled { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileDiskCsiDriver.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileDiskCsiDriver.Serialization.cs deleted file mode 100644 index 3f0f7ecf1ea76..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileDiskCsiDriver.Serialization.cs +++ /dev/null @@ -1,126 +0,0 @@ -// 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.ContainerService.Models -{ - internal partial class ManagedClusterStorageProfileDiskCsiDriver : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterStorageProfileDiskCsiDriver)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(IsEnabled)) - { - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(IsEnabled.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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterStorageProfileDiskCsiDriver 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(ManagedClusterStorageProfileDiskCsiDriver)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterStorageProfileDiskCsiDriver(document.RootElement, options); - } - - internal static ManagedClusterStorageProfileDiskCsiDriver DeserializeManagedClusterStorageProfileDiskCsiDriver(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional enabled = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("enabled"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enabled = property.Value.GetBoolean(); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterStorageProfileDiskCsiDriver(Optional.ToNullable(enabled), 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(ManagedClusterStorageProfileDiskCsiDriver)} does not support '{options.Format}' format."); - } - } - - ManagedClusterStorageProfileDiskCsiDriver 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); - return DeserializeManagedClusterStorageProfileDiskCsiDriver(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterStorageProfileDiskCsiDriver)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileDiskCsiDriver.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileDiskCsiDriver.cs deleted file mode 100644 index aa5d5f1db2748..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileDiskCsiDriver.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// AzureDisk CSI Driver settings for the storage profile. - internal partial class ManagedClusterStorageProfileDiskCsiDriver - { - /// - /// 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 ManagedClusterStorageProfileDiskCsiDriver() - { - } - - /// Initializes a new instance of . - /// Whether to enable AzureDisk CSI Driver. The default value is true. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterStorageProfileDiskCsiDriver(bool? isEnabled, IDictionary serializedAdditionalRawData) - { - IsEnabled = isEnabled; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Whether to enable AzureDisk CSI Driver. The default value is true. - public bool? IsEnabled { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileFileCsiDriver.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileFileCsiDriver.Serialization.cs deleted file mode 100644 index 8f5bae8ba6a32..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileFileCsiDriver.Serialization.cs +++ /dev/null @@ -1,126 +0,0 @@ -// 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.ContainerService.Models -{ - internal partial class ManagedClusterStorageProfileFileCsiDriver : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterStorageProfileFileCsiDriver)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(IsEnabled)) - { - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(IsEnabled.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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterStorageProfileFileCsiDriver 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(ManagedClusterStorageProfileFileCsiDriver)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterStorageProfileFileCsiDriver(document.RootElement, options); - } - - internal static ManagedClusterStorageProfileFileCsiDriver DeserializeManagedClusterStorageProfileFileCsiDriver(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional enabled = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("enabled"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enabled = property.Value.GetBoolean(); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterStorageProfileFileCsiDriver(Optional.ToNullable(enabled), 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(ManagedClusterStorageProfileFileCsiDriver)} does not support '{options.Format}' format."); - } - } - - ManagedClusterStorageProfileFileCsiDriver 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); - return DeserializeManagedClusterStorageProfileFileCsiDriver(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterStorageProfileFileCsiDriver)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileFileCsiDriver.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileFileCsiDriver.cs deleted file mode 100644 index a289a4e1957b3..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileFileCsiDriver.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// AzureFile CSI Driver settings for the storage profile. - internal partial class ManagedClusterStorageProfileFileCsiDriver - { - /// - /// 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 ManagedClusterStorageProfileFileCsiDriver() - { - } - - /// Initializes a new instance of . - /// Whether to enable AzureFile CSI Driver. The default value is true. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterStorageProfileFileCsiDriver(bool? isEnabled, IDictionary serializedAdditionalRawData) - { - IsEnabled = isEnabled; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Whether to enable AzureFile CSI Driver. The default value is true. - public bool? IsEnabled { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileSnapshotController.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileSnapshotController.Serialization.cs deleted file mode 100644 index 5bbe8e3b40fa4..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileSnapshotController.Serialization.cs +++ /dev/null @@ -1,126 +0,0 @@ -// 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.ContainerService.Models -{ - internal partial class ManagedClusterStorageProfileSnapshotController : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterStorageProfileSnapshotController)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(IsEnabled)) - { - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(IsEnabled.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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterStorageProfileSnapshotController 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(ManagedClusterStorageProfileSnapshotController)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterStorageProfileSnapshotController(document.RootElement, options); - } - - internal static ManagedClusterStorageProfileSnapshotController DeserializeManagedClusterStorageProfileSnapshotController(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional enabled = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("enabled"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enabled = property.Value.GetBoolean(); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterStorageProfileSnapshotController(Optional.ToNullable(enabled), 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(ManagedClusterStorageProfileSnapshotController)} does not support '{options.Format}' format."); - } - } - - ManagedClusterStorageProfileSnapshotController 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); - return DeserializeManagedClusterStorageProfileSnapshotController(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterStorageProfileSnapshotController)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileSnapshotController.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileSnapshotController.cs deleted file mode 100644 index 87cdd64910781..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileSnapshotController.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Snapshot Controller settings for the storage profile. - internal partial class ManagedClusterStorageProfileSnapshotController - { - /// - /// 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 ManagedClusterStorageProfileSnapshotController() - { - } - - /// Initializes a new instance of . - /// Whether to enable Snapshot Controller. The default value is true. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterStorageProfileSnapshotController(bool? isEnabled, IDictionary serializedAdditionalRawData) - { - IsEnabled = isEnabled; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Whether to enable Snapshot Controller. The default value is true. - public bool? IsEnabled { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAzureMonitorProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterUpdate.Serialization.cs similarity index 55% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAzureMonitorProfile.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterUpdate.Serialization.cs index 04aed7805609b..24263264fb1eb 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAzureMonitorProfile.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterUpdate.Serialization.cs @@ -13,23 +13,25 @@ namespace Azure.ResourceManager.ContainerService.Models { - internal partial class ManagedClusterAzureMonitorProfile : IUtf8JsonSerializable, IJsonModel + public partial class ManagedClusterUpdate : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ManagedClusterAzureMonitorProfile)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(ManagedClusterUpdate)} does not support '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(Metrics)) + writer.WritePropertyName("upgrade"u8); + writer.WriteObjectValue(Upgrade); + if (Optional.IsDefined(NodeImageSelection)) { - writer.WritePropertyName("metrics"u8); - writer.WriteObjectValue(Metrics); + writer.WritePropertyName("nodeImageSelection"u8); + writer.WriteObjectValue(NodeImageSelection); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -49,19 +51,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WriteEndObject(); } - ManagedClusterAzureMonitorProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ManagedClusterUpdate IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ManagedClusterAzureMonitorProfile)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(ManagedClusterUpdate)} does not support '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterAzureMonitorProfile(document.RootElement, options); + return DeserializeManagedClusterUpdate(document.RootElement, options); } - internal static ManagedClusterAzureMonitorProfile DeserializeManagedClusterAzureMonitorProfile(JsonElement element, ModelReaderWriterOptions options = null) + internal static ManagedClusterUpdate DeserializeManagedClusterUpdate(JsonElement element, ModelReaderWriterOptions options = null) { options ??= new ModelReaderWriterOptions("W"); @@ -69,18 +71,24 @@ internal static ManagedClusterAzureMonitorProfile DeserializeManagedClusterAzure { return null; } - Optional metrics = default; + ManagedClusterUpgradeSpec upgrade = default; + Optional nodeImageSelection = default; IDictionary serializedAdditionalRawData = default; Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("metrics"u8)) + if (property.NameEquals("upgrade"u8)) + { + upgrade = ManagedClusterUpgradeSpec.DeserializeManagedClusterUpgradeSpec(property.Value); + continue; + } + if (property.NameEquals("nodeImageSelection"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - metrics = ManagedClusterMonitorProfileMetrics.DeserializeManagedClusterMonitorProfileMetrics(property.Value); + nodeImageSelection = NodeImageSelection.DeserializeNodeImageSelection(property.Value); continue; } if (options.Format != "W") @@ -89,38 +97,38 @@ internal static ManagedClusterAzureMonitorProfile DeserializeManagedClusterAzure } } serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterAzureMonitorProfile(metrics.Value, serializedAdditionalRawData); + return new ManagedClusterUpdate(upgrade, nodeImageSelection.Value, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + 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(ManagedClusterAzureMonitorProfile)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(ManagedClusterUpdate)} does not support '{options.Format}' format."); } } - ManagedClusterAzureMonitorProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ManagedClusterUpdate IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterAzureMonitorProfile(document.RootElement, options); + return DeserializeManagedClusterUpdate(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ManagedClusterAzureMonitorProfile)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(ManagedClusterUpdate)} does not support '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterServicePrincipalProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterUpdate.cs similarity index 55% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterServicePrincipalProfile.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterUpdate.cs index d4107fe4c2bf0..62fcf63972ccb 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterServicePrincipalProfile.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterUpdate.cs @@ -11,8 +11,8 @@ namespace Azure.ResourceManager.ContainerService.Models { - /// Information about a service principal identity for the cluster to use for manipulating Azure APIs. - public partial class ManagedClusterServicePrincipalProfile + /// The update to be applied to the ManagedClusters. + public partial class ManagedClusterUpdate { /// /// Keeps track of any properties unknown to the library. @@ -46,35 +46,44 @@ public partial class ManagedClusterServicePrincipalProfile /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The ID for the service principal. - /// is null. - public ManagedClusterServicePrincipalProfile(string clientId) + /// Initializes a new instance of . + /// The upgrade to apply to the ManagedClusters. + /// is null. + public ManagedClusterUpdate(ManagedClusterUpgradeSpec upgrade) { - Argument.AssertNotNull(clientId, nameof(clientId)); + Argument.AssertNotNull(upgrade, nameof(upgrade)); - ClientId = clientId; + Upgrade = upgrade; } - /// Initializes a new instance of . - /// The ID for the service principal. - /// The secret password associated with the service principal in plain text. + /// 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 ManagedClusterServicePrincipalProfile(string clientId, string secret, IDictionary serializedAdditionalRawData) + internal ManagedClusterUpdate(ManagedClusterUpgradeSpec upgrade, NodeImageSelection nodeImageSelection, IDictionary serializedAdditionalRawData) { - ClientId = clientId; - Secret = secret; + Upgrade = upgrade; + NodeImageSelection = nodeImageSelection; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal ManagedClusterServicePrincipalProfile() + /// Initializes a new instance of for deserialization. + internal ManagedClusterUpdate() { } - /// The ID for the service principal. - public string ClientId { get; set; } - /// The secret password associated with the service principal in plain text. - public string Secret { get; set; } + /// 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. + internal NodeImageSelection NodeImageSelection { get; set; } + /// The node image upgrade type. + public NodeImageSelectionType? SelectionType + { + get => NodeImageSelection is null ? default(NodeImageSelectionType?) : NodeImageSelection.SelectionType; + set + { + NodeImageSelection = value.HasValue ? new NodeImageSelection(value.Value) : null; + } + } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterUpgradeProfileData.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterUpgradeProfileData.Serialization.cs deleted file mode 100644 index 63109322219ff..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterUpgradeProfileData.Serialization.cs +++ /dev/null @@ -1,202 +0,0 @@ -// 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.ContainerService.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.ContainerService -{ - public partial class ManagedClusterUpgradeProfileData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterUpgradeProfileData)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - writer.WritePropertyName("controlPlaneProfile"u8); - writer.WriteObjectValue(ControlPlaneProfile); - writer.WritePropertyName("agentPoolProfiles"u8); - writer.WriteStartArray(); - foreach (var item in AgentPoolProfiles) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterUpgradeProfileData 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(ManagedClusterUpgradeProfileData)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterUpgradeProfileData(document.RootElement, options); - } - - internal static ManagedClusterUpgradeProfileData DeserializeManagedClusterUpgradeProfileData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - ManagedClusterPoolUpgradeProfile controlPlaneProfile = default; - IReadOnlyList agentPoolProfiles = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - 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("controlPlaneProfile"u8)) - { - controlPlaneProfile = ManagedClusterPoolUpgradeProfile.DeserializeManagedClusterPoolUpgradeProfile(property0.Value); - continue; - } - if (property0.NameEquals("agentPoolProfiles"u8)) - { - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(ManagedClusterPoolUpgradeProfile.DeserializeManagedClusterPoolUpgradeProfile(item)); - } - agentPoolProfiles = array; - continue; - } - } - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterUpgradeProfileData(id, name, type, systemData.Value, controlPlaneProfile, agentPoolProfiles, 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(ManagedClusterUpgradeProfileData)} does not support '{options.Format}' format."); - } - } - - ManagedClusterUpgradeProfileData 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); - return DeserializeManagedClusterUpgradeProfileData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterUpgradeProfileData)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterCredentials.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterUpgradeSpec.Serialization.cs similarity index 58% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterCredentials.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterUpgradeSpec.Serialization.cs index 129293990de72..535b1b1c5f435 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterCredentials.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterUpgradeSpec.Serialization.cs @@ -13,28 +13,25 @@ namespace Azure.ResourceManager.ContainerService.Models { - public partial class ManagedClusterCredentials : IUtf8JsonSerializable, IJsonModel + public partial class ManagedClusterUpgradeSpec : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ManagedClusterCredentials)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(ManagedClusterUpgradeSpec)} does not support '{format}' format."); } writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsCollectionDefined(Kubeconfigs)) + writer.WritePropertyName("type"u8); + writer.WriteStringValue(UpgradeType.ToString()); + if (Optional.IsDefined(KubernetesVersion)) { - writer.WritePropertyName("kubeconfigs"u8); - writer.WriteStartArray(); - foreach (var item in Kubeconfigs) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); + writer.WritePropertyName("kubernetesVersion"u8); + writer.WriteStringValue(KubernetesVersion); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -54,19 +51,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea writer.WriteEndObject(); } - ManagedClusterCredentials IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ManagedClusterUpgradeSpec IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ManagedClusterCredentials)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(ManagedClusterUpgradeSpec)} does not support '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterCredentials(document.RootElement, options); + return DeserializeManagedClusterUpgradeSpec(document.RootElement, options); } - internal static ManagedClusterCredentials DeserializeManagedClusterCredentials(JsonElement element, ModelReaderWriterOptions options = null) + internal static ManagedClusterUpgradeSpec DeserializeManagedClusterUpgradeSpec(JsonElement element, ModelReaderWriterOptions options = null) { options ??= new ModelReaderWriterOptions("W"); @@ -74,23 +71,20 @@ internal static ManagedClusterCredentials DeserializeManagedClusterCredentials(J { return null; } - Optional> kubeconfigs = default; + ManagedClusterUpgradeType type = default; + Optional kubernetesVersion = default; IDictionary serializedAdditionalRawData = default; Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("kubeconfigs"u8)) + if (property.NameEquals("type"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ManagedClusterCredential.DeserializeManagedClusterCredential(item)); - } - kubeconfigs = array; + type = new ManagedClusterUpgradeType(property.Value.GetString()); + continue; + } + if (property.NameEquals("kubernetesVersion"u8)) + { + kubernetesVersion = property.Value.GetString(); continue; } if (options.Format != "W") @@ -99,38 +93,38 @@ internal static ManagedClusterCredentials DeserializeManagedClusterCredentials(J } } serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterCredentials(Optional.ToList(kubeconfigs), serializedAdditionalRawData); + return new ManagedClusterUpgradeSpec(type, kubernetesVersion.Value, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + 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(ManagedClusterCredentials)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(ManagedClusterUpgradeSpec)} does not support '{options.Format}' format."); } } - ManagedClusterCredentials IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ManagedClusterUpgradeSpec IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterCredentials(document.RootElement, options); + return DeserializeManagedClusterUpgradeSpec(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ManagedClusterCredentials)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(ManagedClusterUpgradeSpec)} does not support '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPoolUpgradeProfileUpgradesItem.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterUpgradeSpec.cs similarity index 61% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPoolUpgradeProfileUpgradesItem.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterUpgradeSpec.cs index 28aef628adcc8..7243279689bb2 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPoolUpgradeProfileUpgradesItem.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterUpgradeSpec.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.ContainerService.Models { - /// The ManagedClusterPoolUpgradeProfileUpgradesItem. - public partial class ManagedClusterPoolUpgradeProfileUpgradesItem + /// The upgrade to apply to a ManagedCluster. + public partial class ManagedClusterUpgradeSpec { /// /// Keeps track of any properties unknown to the library. @@ -45,25 +45,32 @@ public partial class ManagedClusterPoolUpgradeProfileUpgradesItem /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal ManagedClusterPoolUpgradeProfileUpgradesItem() + /// Initializes a new instance of . + /// ManagedClusterUpgradeType is the type of upgrade to be applied. + public ManagedClusterUpgradeSpec(ManagedClusterUpgradeType upgradeType) { + UpgradeType = upgradeType; } - /// Initializes a new instance of . - /// The Kubernetes version (major.minor.patch). - /// Whether the Kubernetes version is currently in preview. + /// 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 ManagedClusterPoolUpgradeProfileUpgradesItem(string kubernetesVersion, bool? isPreview, IDictionary serializedAdditionalRawData) + internal ManagedClusterUpgradeSpec(ManagedClusterUpgradeType upgradeType, string kubernetesVersion, IDictionary serializedAdditionalRawData) { + UpgradeType = upgradeType; KubernetesVersion = kubernetesVersion; - IsPreview = isPreview; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The Kubernetes version (major.minor.patch). - public string KubernetesVersion { get; } - /// Whether the Kubernetes version is currently in preview. - public bool? IsPreview { get; } + /// Initializes a new instance of for deserialization. + internal ManagedClusterUpgradeSpec() + { + } + + /// ManagedClusterUpgradeType is the type of upgrade to be applied. + public ManagedClusterUpgradeType UpgradeType { get; set; } + /// The Kubernetes version to upgrade the member clusters to. + public string KubernetesVersion { get; set; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterUpgradeType.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterUpgradeType.cs new file mode 100644 index 0000000000000..8b7446b754ffb --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/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.ContainerService.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 string 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?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterVerticalPodAutoscaler.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterVerticalPodAutoscaler.Serialization.cs deleted file mode 100644 index 4bdd2a2dfba34..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterVerticalPodAutoscaler.Serialization.cs +++ /dev/null @@ -1,119 +0,0 @@ -// 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.ContainerService.Models -{ - internal partial class ManagedClusterVerticalPodAutoscaler : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterVerticalPodAutoscaler)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(IsVpaEnabled); - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterVerticalPodAutoscaler 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(ManagedClusterVerticalPodAutoscaler)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterVerticalPodAutoscaler(document.RootElement, options); - } - - internal static ManagedClusterVerticalPodAutoscaler DeserializeManagedClusterVerticalPodAutoscaler(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - bool enabled = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("enabled"u8)) - { - enabled = property.Value.GetBoolean(); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterVerticalPodAutoscaler(enabled, 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(ManagedClusterVerticalPodAutoscaler)} does not support '{options.Format}' format."); - } - } - - ManagedClusterVerticalPodAutoscaler 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); - return DeserializeManagedClusterVerticalPodAutoscaler(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterVerticalPodAutoscaler)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterVerticalPodAutoscaler.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterVerticalPodAutoscaler.cs deleted file mode 100644 index 38b46b181b1e8..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterVerticalPodAutoscaler.cs +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// VPA (Vertical Pod Autoscaler) settings for the workload auto-scaler profile. - internal partial class ManagedClusterVerticalPodAutoscaler - { - /// - /// 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 . - /// Whether to enable VPA. Default value is false. - public ManagedClusterVerticalPodAutoscaler(bool isVpaEnabled) - { - IsVpaEnabled = isVpaEnabled; - } - - /// Initializes a new instance of . - /// Whether to enable VPA. Default value is false. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterVerticalPodAutoscaler(bool isVpaEnabled, IDictionary serializedAdditionalRawData) - { - IsVpaEnabled = isVpaEnabled; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ManagedClusterVerticalPodAutoscaler() - { - } - - /// Whether to enable VPA. Default value is false. - public bool IsVpaEnabled { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterWindowsProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterWindowsProfile.Serialization.cs deleted file mode 100644 index eb31ee479faaa..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterWindowsProfile.Serialization.cs +++ /dev/null @@ -1,175 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class ManagedClusterWindowsProfile : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterWindowsProfile)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("adminUsername"u8); - writer.WriteStringValue(AdminUsername); - if (Optional.IsDefined(AdminPassword)) - { - writer.WritePropertyName("adminPassword"u8); - writer.WriteStringValue(AdminPassword); - } - if (Optional.IsDefined(LicenseType)) - { - writer.WritePropertyName("licenseType"u8); - writer.WriteStringValue(LicenseType.Value.ToString()); - } - if (Optional.IsDefined(IsCsiProxyEnabled)) - { - writer.WritePropertyName("enableCSIProxy"u8); - writer.WriteBooleanValue(IsCsiProxyEnabled.Value); - } - if (Optional.IsDefined(GmsaProfile)) - { - writer.WritePropertyName("gmsaProfile"u8); - writer.WriteObjectValue(GmsaProfile); - } - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterWindowsProfile 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(ManagedClusterWindowsProfile)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterWindowsProfile(document.RootElement, options); - } - - internal static ManagedClusterWindowsProfile DeserializeManagedClusterWindowsProfile(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string adminUsername = default; - Optional adminPassword = default; - Optional licenseType = default; - Optional enableCsiProxy = default; - Optional gmsaProfile = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("adminUsername"u8)) - { - adminUsername = property.Value.GetString(); - continue; - } - if (property.NameEquals("adminPassword"u8)) - { - adminPassword = property.Value.GetString(); - continue; - } - if (property.NameEquals("licenseType"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - licenseType = new WindowsVmLicenseType(property.Value.GetString()); - continue; - } - if (property.NameEquals("enableCSIProxy"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableCsiProxy = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("gmsaProfile"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - gmsaProfile = WindowsGmsaProfile.DeserializeWindowsGmsaProfile(property.Value); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterWindowsProfile(adminUsername, adminPassword.Value, Optional.ToNullable(licenseType), Optional.ToNullable(enableCsiProxy), gmsaProfile.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(ManagedClusterWindowsProfile)} does not support '{options.Format}' format."); - } - } - - ManagedClusterWindowsProfile 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); - return DeserializeManagedClusterWindowsProfile(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterWindowsProfile)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterWindowsProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterWindowsProfile.cs deleted file mode 100644 index ba3e2c309cee1..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterWindowsProfile.cs +++ /dev/null @@ -1,92 +0,0 @@ -// 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.ContainerService.Models -{ - /// Profile for Windows VMs in the managed cluster. - public partial class ManagedClusterWindowsProfile - { - /// - /// 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 . - /// Specifies the name of the administrator account. <br><br> **Restriction:** Cannot end in "." <br><br> **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". <br><br> **Minimum-length:** 1 character <br><br> **Max-length:** 20 characters. - /// is null. - public ManagedClusterWindowsProfile(string adminUsername) - { - Argument.AssertNotNull(adminUsername, nameof(adminUsername)); - - AdminUsername = adminUsername; - } - - /// Initializes a new instance of . - /// Specifies the name of the administrator account. <br><br> **Restriction:** Cannot end in "." <br><br> **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". <br><br> **Minimum-length:** 1 character <br><br> **Max-length:** 20 characters. - /// Specifies the password of the administrator account. <br><br> **Minimum-length:** 8 characters <br><br> **Max-length:** 123 characters <br><br> **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled <br> Has lower characters <br>Has upper characters <br> Has a digit <br> Has a special character (Regex match [\W_]) <br><br> **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - /// The license type to use for Windows VMs. See [Azure Hybrid User Benefits](https://azure.microsoft.com/pricing/hybrid-benefit/faq/) for more details. - /// For more details on CSI proxy, see the [CSI proxy GitHub repo](https://github.com/kubernetes-csi/csi-proxy). - /// The Windows gMSA Profile in the Managed Cluster. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterWindowsProfile(string adminUsername, string adminPassword, WindowsVmLicenseType? licenseType, bool? isCsiProxyEnabled, WindowsGmsaProfile gmsaProfile, IDictionary serializedAdditionalRawData) - { - AdminUsername = adminUsername; - AdminPassword = adminPassword; - LicenseType = licenseType; - IsCsiProxyEnabled = isCsiProxyEnabled; - GmsaProfile = gmsaProfile; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ManagedClusterWindowsProfile() - { - } - - /// Specifies the name of the administrator account. <br><br> **Restriction:** Cannot end in "." <br><br> **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". <br><br> **Minimum-length:** 1 character <br><br> **Max-length:** 20 characters. - public string AdminUsername { get; set; } - /// Specifies the password of the administrator account. <br><br> **Minimum-length:** 8 characters <br><br> **Max-length:** 123 characters <br><br> **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled <br> Has lower characters <br>Has upper characters <br> Has a digit <br> Has a special character (Regex match [\W_]) <br><br> **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - public string AdminPassword { get; set; } - /// The license type to use for Windows VMs. See [Azure Hybrid User Benefits](https://azure.microsoft.com/pricing/hybrid-benefit/faq/) for more details. - public WindowsVmLicenseType? LicenseType { get; set; } - /// For more details on CSI proxy, see the [CSI proxy GitHub repo](https://github.com/kubernetes-csi/csi-proxy). - public bool? IsCsiProxyEnabled { get; set; } - /// The Windows gMSA Profile in the Managed Cluster. - public WindowsGmsaProfile GmsaProfile { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterWorkloadAutoScalerProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterWorkloadAutoScalerProfile.Serialization.cs deleted file mode 100644 index 4df9397ad50d1..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterWorkloadAutoScalerProfile.Serialization.cs +++ /dev/null @@ -1,141 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class ManagedClusterWorkloadAutoScalerProfile : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterWorkloadAutoScalerProfile)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Keda)) - { - writer.WritePropertyName("keda"u8); - writer.WriteObjectValue(Keda); - } - if (Optional.IsDefined(VerticalPodAutoscaler)) - { - writer.WritePropertyName("verticalPodAutoscaler"u8); - writer.WriteObjectValue(VerticalPodAutoscaler); - } - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterWorkloadAutoScalerProfile 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(ManagedClusterWorkloadAutoScalerProfile)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterWorkloadAutoScalerProfile(document.RootElement, options); - } - - internal static ManagedClusterWorkloadAutoScalerProfile DeserializeManagedClusterWorkloadAutoScalerProfile(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional keda = default; - Optional verticalPodAutoscaler = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("keda"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - keda = ManagedClusterWorkloadAutoScalerProfileKeda.DeserializeManagedClusterWorkloadAutoScalerProfileKeda(property.Value); - continue; - } - if (property.NameEquals("verticalPodAutoscaler"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - verticalPodAutoscaler = ManagedClusterVerticalPodAutoscaler.DeserializeManagedClusterVerticalPodAutoscaler(property.Value); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterWorkloadAutoScalerProfile(keda.Value, verticalPodAutoscaler.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(ManagedClusterWorkloadAutoScalerProfile)} does not support '{options.Format}' format."); - } - } - - ManagedClusterWorkloadAutoScalerProfile 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); - return DeserializeManagedClusterWorkloadAutoScalerProfile(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterWorkloadAutoScalerProfile)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterWorkloadAutoScalerProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterWorkloadAutoScalerProfile.cs deleted file mode 100644 index abd845aa4af4c..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterWorkloadAutoScalerProfile.cs +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Workload Auto-scaler profile for the managed cluster. - public partial class ManagedClusterWorkloadAutoScalerProfile - { - /// - /// 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 ManagedClusterWorkloadAutoScalerProfile() - { - } - - /// Initializes a new instance of . - /// KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler profile. - /// VPA (Vertical Pod Autoscaler) settings for the workload auto-scaler profile. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterWorkloadAutoScalerProfile(ManagedClusterWorkloadAutoScalerProfileKeda keda, ManagedClusterVerticalPodAutoscaler verticalPodAutoscaler, IDictionary serializedAdditionalRawData) - { - Keda = keda; - VerticalPodAutoscaler = verticalPodAutoscaler; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler profile. - internal ManagedClusterWorkloadAutoScalerProfileKeda Keda { get; set; } - /// Whether to enable KEDA. - public bool? IsKedaEnabled - { - get => Keda is null ? default(bool?) : Keda.IsKedaEnabled; - set - { - Keda = value.HasValue ? new ManagedClusterWorkloadAutoScalerProfileKeda(value.Value) : null; - } - } - - /// VPA (Vertical Pod Autoscaler) settings for the workload auto-scaler profile. - internal ManagedClusterVerticalPodAutoscaler VerticalPodAutoscaler { get; set; } - /// Whether to enable VPA. Default value is false. - public bool? IsVpaEnabled - { - get => VerticalPodAutoscaler is null ? default(bool?) : VerticalPodAutoscaler.IsVpaEnabled; - set - { - VerticalPodAutoscaler = value.HasValue ? new ManagedClusterVerticalPodAutoscaler(value.Value) : null; - } - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterWorkloadAutoScalerProfileKeda.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterWorkloadAutoScalerProfileKeda.Serialization.cs deleted file mode 100644 index 532d1cb8d303c..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterWorkloadAutoScalerProfileKeda.Serialization.cs +++ /dev/null @@ -1,119 +0,0 @@ -// 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.ContainerService.Models -{ - internal partial class ManagedClusterWorkloadAutoScalerProfileKeda : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterWorkloadAutoScalerProfileKeda)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(IsKedaEnabled); - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterWorkloadAutoScalerProfileKeda 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(ManagedClusterWorkloadAutoScalerProfileKeda)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterWorkloadAutoScalerProfileKeda(document.RootElement, options); - } - - internal static ManagedClusterWorkloadAutoScalerProfileKeda DeserializeManagedClusterWorkloadAutoScalerProfileKeda(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - bool enabled = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("enabled"u8)) - { - enabled = property.Value.GetBoolean(); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterWorkloadAutoScalerProfileKeda(enabled, 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(ManagedClusterWorkloadAutoScalerProfileKeda)} does not support '{options.Format}' format."); - } - } - - ManagedClusterWorkloadAutoScalerProfileKeda 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); - return DeserializeManagedClusterWorkloadAutoScalerProfileKeda(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterWorkloadAutoScalerProfileKeda)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterWorkloadAutoScalerProfileKeda.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterWorkloadAutoScalerProfileKeda.cs deleted file mode 100644 index e4580a03834e1..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterWorkloadAutoScalerProfileKeda.cs +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler profile. - internal partial class ManagedClusterWorkloadAutoScalerProfileKeda - { - /// - /// 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 . - /// Whether to enable KEDA. - public ManagedClusterWorkloadAutoScalerProfileKeda(bool isKedaEnabled) - { - IsKedaEnabled = isKedaEnabled; - } - - /// Initializes a new instance of . - /// Whether to enable KEDA. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterWorkloadAutoScalerProfileKeda(bool isKedaEnabled, IDictionary serializedAdditionalRawData) - { - IsKedaEnabled = isKedaEnabled; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ManagedClusterWorkloadAutoScalerProfileKeda() - { - } - - /// Whether to enable KEDA. - public bool IsKedaEnabled { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterDelegatedIdentity.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedServiceIdentity.Serialization.cs similarity index 51% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterDelegatedIdentity.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedServiceIdentity.Serialization.cs index df0f0c2180e87..aa40ef7773d6c 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterDelegatedIdentity.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedServiceIdentity.Serialization.cs @@ -10,41 +10,45 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.Models; namespace Azure.ResourceManager.ContainerService.Models { - public partial class ManagedClusterDelegatedIdentity : IUtf8JsonSerializable, IJsonModel + internal partial class ManagedServiceIdentity : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ManagedClusterDelegatedIdentity)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(ManagedServiceIdentity)} does not support '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(ResourceId)) + if (options.Format != "W" && Optional.IsDefined(PrincipalId)) { - writer.WritePropertyName("resourceId"u8); - writer.WriteStringValue(ResourceId); + writer.WritePropertyName("principalId"u8); + writer.WriteStringValue(PrincipalId.Value); } - if (Optional.IsDefined(TenantId)) + if (options.Format != "W" && Optional.IsDefined(TenantId)) { writer.WritePropertyName("tenantId"u8); writer.WriteStringValue(TenantId.Value); } - if (Optional.IsDefined(ReferralResource)) + writer.WritePropertyName("type"u8); + writer.WriteStringValue(IdentityType.ToString()); + if (Optional.IsCollectionDefined(UserAssignedIdentities)) { - writer.WritePropertyName("referralResource"u8); - writer.WriteStringValue(ReferralResource); - } - if (Optional.IsDefined(Location)) - { - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location.Value); + 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) { @@ -64,19 +68,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo writer.WriteEndObject(); } - ManagedClusterDelegatedIdentity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ManagedServiceIdentity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ManagedClusterDelegatedIdentity)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(ManagedServiceIdentity)} does not support '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterDelegatedIdentity(document.RootElement, options); + return DeserializeManagedServiceIdentity(document.RootElement, options); } - internal static ManagedClusterDelegatedIdentity DeserializeManagedClusterDelegatedIdentity(JsonElement element, ModelReaderWriterOptions options = null) + internal static ManagedServiceIdentity DeserializeManagedServiceIdentity(JsonElement element, ModelReaderWriterOptions options = null) { options ??= new ModelReaderWriterOptions("W"); @@ -84,21 +88,21 @@ internal static ManagedClusterDelegatedIdentity DeserializeManagedClusterDelegat { return null; } - Optional resourceId = default; + Optional principalId = default; Optional tenantId = default; - Optional referralResource = default; - Optional location = default; + ManagedServiceIdentityType type = default; + Optional> userAssignedIdentities = default; IDictionary serializedAdditionalRawData = default; Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("resourceId"u8)) + if (property.NameEquals("principalId"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - resourceId = new ResourceIdentifier(property.Value.GetString()); + principalId = property.Value.GetGuid(); continue; } if (property.NameEquals("tenantId"u8)) @@ -110,18 +114,23 @@ internal static ManagedClusterDelegatedIdentity DeserializeManagedClusterDelegat tenantId = property.Value.GetGuid(); continue; } - if (property.NameEquals("referralResource"u8)) + if (property.NameEquals("type"u8)) { - referralResource = property.Value.GetString(); + type = new ManagedServiceIdentityType(property.Value.GetString()); continue; } - if (property.NameEquals("location"u8)) + if (property.NameEquals("userAssignedIdentities"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - location = new AzureLocation(property.Value.GetString()); + 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") @@ -130,38 +139,38 @@ internal static ManagedClusterDelegatedIdentity DeserializeManagedClusterDelegat } } serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterDelegatedIdentity(resourceId.Value, Optional.ToNullable(tenantId), referralResource.Value, Optional.ToNullable(location), serializedAdditionalRawData); + return new ManagedServiceIdentity(Optional.ToNullable(principalId), Optional.ToNullable(tenantId), type, Optional.ToDictionary(userAssignedIdentities), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + 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(ManagedClusterDelegatedIdentity)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(ManagedServiceIdentity)} does not support '{options.Format}' format."); } } - ManagedClusterDelegatedIdentity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ManagedServiceIdentity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterDelegatedIdentity(document.RootElement, options); + return DeserializeManagedServiceIdentity(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ManagedClusterDelegatedIdentity)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(ManagedServiceIdentity)} does not support '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedServiceIdentity.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedServiceIdentity.cs new file mode 100644 index 0000000000000..08d5caa8cf224 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedServiceIdentity.cs @@ -0,0 +1,87 @@ +// 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.Models; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// Managed service identity (system assigned and/or user assigned identities). + internal 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 . + /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + public ManagedServiceIdentity(ManagedServiceIdentityType identityType) + { + IdentityType = identityType; + 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. + /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + /// The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests. + /// Keeps track of any properties unknown to the library. + internal ManagedServiceIdentity(Guid? principalId, Guid? tenantId, ManagedServiceIdentityType identityType, IDictionary userAssignedIdentities, IDictionary serializedAdditionalRawData) + { + PrincipalId = principalId; + TenantId = tenantId; + IdentityType = identityType; + 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; } + /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + public ManagedServiceIdentityType IdentityType { get; set; } + /// The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests. + public IDictionary UserAssignedIdentities { get; } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedServiceIdentityType.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedServiceIdentityType.cs new file mode 100644 index 0000000000000..26d374e12d8f2 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/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.ContainerService.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 SystemAssignedUserAssignedValue = "SystemAssigned, UserAssigned"; + + /// None. + public static ManagedServiceIdentityType None { get; } = new ManagedServiceIdentityType(NoneValue); + /// SystemAssigned. + public static ManagedServiceIdentityType SystemAssigned { get; } = new ManagedServiceIdentityType(SystemAssignedValue); + /// UserAssigned. + public static ManagedServiceIdentityType UserAssigned { get; } = new ManagedServiceIdentityType(UserAssignedValue); + /// SystemAssigned, UserAssigned. + public static ManagedServiceIdentityType SystemAssignedUserAssigned { get; } = new ManagedServiceIdentityType(SystemAssignedUserAssignedValue); + /// 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 string 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?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/CompatibleVersions.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MemberUpdateStatus.Serialization.cs similarity index 53% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/CompatibleVersions.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MemberUpdateStatus.Serialization.cs index 82a81f9075ed9..6f16c10862423 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/CompatibleVersions.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MemberUpdateStatus.Serialization.cs @@ -13,33 +13,43 @@ namespace Azure.ResourceManager.ContainerService.Models { - public partial class CompatibleVersions : IUtf8JsonSerializable, IJsonModel + public partial class MemberUpdateStatus : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(CompatibleVersions)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(MemberUpdateStatus)} does not support '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(Name)) + if (options.Format != "W" && Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteObjectValue(Status); + } + if (options.Format != "W" && Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); writer.WriteStringValue(Name); } - if (Optional.IsCollectionDefined(Versions)) + if (options.Format != "W" && Optional.IsDefined(ClusterResourceId)) { - writer.WritePropertyName("versions"u8); - writer.WriteStartArray(); - foreach (var item in Versions) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); + 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) { @@ -59,19 +69,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit writer.WriteEndObject(); } - CompatibleVersions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + MemberUpdateStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(CompatibleVersions)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(MemberUpdateStatus)} does not support '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCompatibleVersions(document.RootElement, options); + return DeserializeMemberUpdateStatus(document.RootElement, options); } - internal static CompatibleVersions DeserializeCompatibleVersions(JsonElement element, ModelReaderWriterOptions options = null) + internal static MemberUpdateStatus DeserializeMemberUpdateStatus(JsonElement element, ModelReaderWriterOptions options = null) { options ??= new ModelReaderWriterOptions("W"); @@ -79,29 +89,46 @@ internal static CompatibleVersions DeserializeCompatibleVersions(JsonElement ele { return null; } + Optional status = default; Optional name = default; - Optional> versions = default; + Optional clusterResourceId = default; + Optional operationId = default; + Optional message = default; IDictionary serializedAdditionalRawData = default; Dictionary additionalPropertiesDictionary = 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); + continue; + } if (property.NameEquals("name"u8)) { name = property.Value.GetString(); continue; } - if (property.NameEquals("versions"u8)) + if (property.NameEquals("clusterResourceId"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - versions = array; + clusterResourceId = new ResourceIdentifier(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") @@ -110,38 +137,38 @@ internal static CompatibleVersions DeserializeCompatibleVersions(JsonElement ele } } serializedAdditionalRawData = additionalPropertiesDictionary; - return new CompatibleVersions(name.Value, Optional.ToList(versions), serializedAdditionalRawData); + return new MemberUpdateStatus(status.Value, name.Value, clusterResourceId.Value, operationId.Value, message.Value, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + 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(CompatibleVersions)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(MemberUpdateStatus)} does not support '{options.Format}' format."); } } - CompatibleVersions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + MemberUpdateStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCompatibleVersions(document.RootElement, options); + return DeserializeMemberUpdateStatus(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(CompatibleVersions)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(MemberUpdateStatus)} does not support '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSku.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MemberUpdateStatus.cs similarity index 53% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSku.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MemberUpdateStatus.cs index 2cc8ba9f28670..578cdd70e2456 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSku.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MemberUpdateStatus.cs @@ -7,11 +7,12 @@ using System; using System.Collections.Generic; +using Azure.Core; namespace Azure.ResourceManager.ContainerService.Models { - /// The SKU of a Managed Cluster. - public partial class ManagedClusterSku + /// The status of a member update operation. + public partial class MemberUpdateStatus { /// /// Keeps track of any properties unknown to the library. @@ -45,25 +46,37 @@ public partial class ManagedClusterSku /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public ManagedClusterSku() + /// Initializes a new instance of . + internal MemberUpdateStatus() { } - /// Initializes a new instance of . - /// The name of a managed cluster SKU. - /// If not specified, the default is 'Free'. See [AKS Pricing Tier](https://learn.microsoft.com/azure/aks/free-standard-pricing-tiers) for more details. + /// 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 ManagedClusterSku(ManagedClusterSkuName? name, ManagedClusterSkuTier? tier, IDictionary serializedAdditionalRawData) + internal MemberUpdateStatus(UpdateStatus status, string name, ResourceIdentifier clusterResourceId, string operationId, string message, IDictionary serializedAdditionalRawData) { + Status = status; Name = name; - Tier = tier; + ClusterResourceId = clusterResourceId; + OperationId = operationId; + Message = message; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The name of a managed cluster SKU. - public ManagedClusterSkuName? Name { get; set; } - /// If not specified, the default is 'Free'. See [AKS Pricing Tier](https://learn.microsoft.com/azure/aks/free-standard-pricing-tiers) for more details. - public ManagedClusterSkuTier? Tier { get; set; } + /// 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 ResourceIdentifier 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/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshRevision.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshRevision.cs deleted file mode 100644 index acff8e404c4f7..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshRevision.cs +++ /dev/null @@ -1,76 +0,0 @@ -// 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.ContainerService.Models -{ - /// Holds information on upgrades and compatibility for given major.minor mesh release. - public partial class MeshRevision - { - /// - /// 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 protected IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public MeshRevision() - { - Upgrades = new ChangeTrackingList(); - CompatibleWith = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// The revision of the mesh release. - /// List of revisions available for upgrade of a specific mesh revision. - /// List of items this revision of service mesh is compatible with, and their associated versions. - /// Keeps track of any properties unknown to the library. - internal MeshRevision(string revision, IList upgrades, IList compatibleWith, IDictionary serializedAdditionalRawData) - { - Revision = revision; - Upgrades = upgrades; - CompatibleWith = compatibleWith; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The revision of the mesh release. - public string Revision { get; set; } - /// List of revisions available for upgrade of a specific mesh revision. - public IList Upgrades { get; } - /// List of items this revision of service mesh is compatible with, and their associated versions. - public IList CompatibleWith { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshRevisionProfileData.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshRevisionProfileData.Serialization.cs deleted file mode 100644 index bf3eb5535cba6..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshRevisionProfileData.Serialization.cs +++ /dev/null @@ -1,176 +0,0 @@ -// 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.ContainerService.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.ContainerService -{ - public partial class MeshRevisionProfileData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MeshRevisionProfileData)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Properties)) - { - writer.WritePropertyName("properties"u8); - writer.WriteObjectValue(Properties); - } - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - MeshRevisionProfileData 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(MeshRevisionProfileData)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMeshRevisionProfileData(document.RootElement, options); - } - - internal static MeshRevisionProfileData DeserializeMeshRevisionProfileData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional properties = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - properties = MeshRevisionProfileProperties.DeserializeMeshRevisionProfileProperties(property.Value); - 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 (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new MeshRevisionProfileData(id, name, type, systemData.Value, properties.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(MeshRevisionProfileData)} does not support '{options.Format}' format."); - } - } - - MeshRevisionProfileData 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); - return DeserializeMeshRevisionProfileData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MeshRevisionProfileData)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshRevisionProfileList.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshRevisionProfileList.cs deleted file mode 100644 index df9b3486a6e1d..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshRevisionProfileList.cs +++ /dev/null @@ -1,72 +0,0 @@ -// 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.ContainerService; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Holds an array of MeshRevisionsProfiles. - internal partial class MeshRevisionProfileList - { - /// - /// 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 MeshRevisionProfileList() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Array of service mesh add-on revision profiles for all supported mesh modes. - /// The URL to get the next set of mesh revision profile. - /// Keeps track of any properties unknown to the library. - internal MeshRevisionProfileList(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) - { - Value = value; - NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Array of service mesh add-on revision profiles for all supported mesh modes. - public IReadOnlyList Value { get; } - /// The URL to get the next set of mesh revision profile. - public string NextLink { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshUpgradeProfileData.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshUpgradeProfileData.Serialization.cs deleted file mode 100644 index 5d626b6cd53e5..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshUpgradeProfileData.Serialization.cs +++ /dev/null @@ -1,176 +0,0 @@ -// 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.ContainerService.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.ContainerService -{ - public partial class MeshUpgradeProfileData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MeshUpgradeProfileData)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Properties)) - { - writer.WritePropertyName("properties"u8); - writer.WriteObjectValue(Properties); - } - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - MeshUpgradeProfileData 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(MeshUpgradeProfileData)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMeshUpgradeProfileData(document.RootElement, options); - } - - internal static MeshUpgradeProfileData DeserializeMeshUpgradeProfileData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional properties = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - properties = MeshUpgradeProfileProperties.DeserializeMeshUpgradeProfileProperties(property.Value); - 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 (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new MeshUpgradeProfileData(id, name, type, systemData.Value, properties.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(MeshUpgradeProfileData)} does not support '{options.Format}' format."); - } - } - - MeshUpgradeProfileData 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); - return DeserializeMeshUpgradeProfileData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MeshUpgradeProfileData)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshUpgradeProfileList.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshUpgradeProfileList.cs deleted file mode 100644 index 94ec42889d5a2..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshUpgradeProfileList.cs +++ /dev/null @@ -1,72 +0,0 @@ -// 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.ContainerService; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Holds an array of MeshUpgradeProfiles. - internal partial class MeshUpgradeProfileList - { - /// - /// 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 MeshUpgradeProfileList() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Array of supported service mesh add-on upgrade profiles. - /// The URL to get the next set of mesh upgrade profile. - /// Keeps track of any properties unknown to the library. - internal MeshUpgradeProfileList(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) - { - Value = value; - NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Array of supported service mesh add-on upgrade profiles. - public IReadOnlyList Value { get; } - /// The URL to get the next set of mesh upgrade profile. - public string NextLink { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshUpgradeProfileProperties.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshUpgradeProfileProperties.Serialization.cs deleted file mode 100644 index 816b733841b98..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshUpgradeProfileProperties.Serialization.cs +++ /dev/null @@ -1,172 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class MeshUpgradeProfileProperties : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MeshUpgradeProfileProperties)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Revision)) - { - writer.WritePropertyName("revision"u8); - writer.WriteStringValue(Revision); - } - if (Optional.IsCollectionDefined(Upgrades)) - { - writer.WritePropertyName("upgrades"u8); - writer.WriteStartArray(); - foreach (var item in Upgrades) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(CompatibleWith)) - { - writer.WritePropertyName("compatibleWith"u8); - writer.WriteStartArray(); - foreach (var item in CompatibleWith) - { - writer.WriteObjectValue(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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - MeshUpgradeProfileProperties 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(MeshUpgradeProfileProperties)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMeshUpgradeProfileProperties(document.RootElement, options); - } - - internal static MeshUpgradeProfileProperties DeserializeMeshUpgradeProfileProperties(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional revision = default; - Optional> upgrades = default; - Optional> compatibleWith = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("revision"u8)) - { - revision = property.Value.GetString(); - continue; - } - if (property.NameEquals("upgrades"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - upgrades = array; - continue; - } - if (property.NameEquals("compatibleWith"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(CompatibleVersions.DeserializeCompatibleVersions(item)); - } - compatibleWith = array; - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new MeshUpgradeProfileProperties(revision.Value, Optional.ToList(upgrades), Optional.ToList(compatibleWith), 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(MeshUpgradeProfileProperties)} does not support '{options.Format}' format."); - } - } - - MeshUpgradeProfileProperties 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); - return DeserializeMeshUpgradeProfileProperties(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MeshUpgradeProfileProperties)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshUpgradeProfileProperties.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshUpgradeProfileProperties.cs deleted file mode 100644 index ad3f86c995ea2..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshUpgradeProfileProperties.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Mesh upgrade profile properties for a major.minor release. - public partial class MeshUpgradeProfileProperties : MeshRevision - { - /// Initializes a new instance of . - public MeshUpgradeProfileProperties() - { - } - - /// Initializes a new instance of . - /// The revision of the mesh release. - /// List of revisions available for upgrade of a specific mesh revision. - /// List of items this revision of service mesh is compatible with, and their associated versions. - /// Keeps track of any properties unknown to the library. - internal MeshUpgradeProfileProperties(string revision, IList upgrades, IList compatibleWith, IDictionary serializedAdditionalRawData) : base(revision, upgrades, compatibleWith, serializedAdditionalRawData) - { - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NetworkDataplane.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NetworkDataplane.cs deleted file mode 100644 index 8affba99c24a4..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NetworkDataplane.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Network dataplane used in the Kubernetes cluster. - public readonly partial struct NetworkDataplane : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public NetworkDataplane(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AzureValue = "azure"; - private const string CiliumValue = "cilium"; - - /// Use Azure network dataplane. - public static NetworkDataplane Azure { get; } = new NetworkDataplane(AzureValue); - /// Use Cilium network dataplane. See [Azure CNI Powered by Cilium](https://learn.microsoft.com/azure/aks/azure-cni-powered-by-cilium) for more information. - public static NetworkDataplane Cilium { get; } = new NetworkDataplane(CiliumValue); - /// Determines if two values are the same. - public static bool operator ==(NetworkDataplane left, NetworkDataplane right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(NetworkDataplane left, NetworkDataplane right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator NetworkDataplane(string value) => new NetworkDataplane(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is NetworkDataplane other && Equals(other); - /// - public bool Equals(NetworkDataplane other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ServiceMeshProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NodeImageSelection.Serialization.cs similarity index 58% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ServiceMeshProfile.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NodeImageSelection.Serialization.cs index 92b751ad3a9a1..ce5f29fc31049 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ServiceMeshProfile.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NodeImageSelection.Serialization.cs @@ -13,26 +13,21 @@ namespace Azure.ResourceManager.ContainerService.Models { - public partial class ServiceMeshProfile : IUtf8JsonSerializable, IJsonModel + internal partial class NodeImageSelection : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ServiceMeshProfile)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(NodeImageSelection)} does not support '{format}' format."); } writer.WriteStartObject(); - writer.WritePropertyName("mode"u8); - writer.WriteStringValue(Mode.ToString()); - if (Optional.IsDefined(Istio)) - { - writer.WritePropertyName("istio"u8); - writer.WriteObjectValue(Istio); - } + writer.WritePropertyName("type"u8); + writer.WriteStringValue(SelectionType.ToString()); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -51,19 +46,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit writer.WriteEndObject(); } - ServiceMeshProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NodeImageSelection IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ServiceMeshProfile)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(NodeImageSelection)} does not support '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeServiceMeshProfile(document.RootElement, options); + return DeserializeNodeImageSelection(document.RootElement, options); } - internal static ServiceMeshProfile DeserializeServiceMeshProfile(JsonElement element, ModelReaderWriterOptions options = null) + internal static NodeImageSelection DeserializeNodeImageSelection(JsonElement element, ModelReaderWriterOptions options = null) { options ??= new ModelReaderWriterOptions("W"); @@ -71,24 +66,14 @@ internal static ServiceMeshProfile DeserializeServiceMeshProfile(JsonElement ele { return null; } - ServiceMeshMode mode = default; - Optional istio = default; + NodeImageSelectionType type = default; IDictionary serializedAdditionalRawData = default; Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("mode"u8)) + if (property.NameEquals("type"u8)) { - mode = new ServiceMeshMode(property.Value.GetString()); - continue; - } - if (property.NameEquals("istio"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - istio = IstioServiceMesh.DeserializeIstioServiceMesh(property.Value); + type = new NodeImageSelectionType(property.Value.GetString()); continue; } if (options.Format != "W") @@ -97,38 +82,38 @@ internal static ServiceMeshProfile DeserializeServiceMeshProfile(JsonElement ele } } serializedAdditionalRawData = additionalPropertiesDictionary; - return new ServiceMeshProfile(mode, istio.Value, serializedAdditionalRawData); + return new NodeImageSelection(type, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + 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(ServiceMeshProfile)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(NodeImageSelection)} does not support '{options.Format}' format."); } } - ServiceMeshProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NodeImageSelection IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeServiceMeshProfile(document.RootElement, options); + return DeserializeNodeImageSelection(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ServiceMeshProfile)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(NodeImageSelection)} does not support '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/DailySchedule.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NodeImageSelection.cs similarity index 63% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/DailySchedule.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NodeImageSelection.cs index 42010667cb2ec..85e29432ba888 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/DailySchedule.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NodeImageSelection.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.ContainerService.Models { - /// For schedules like: 'recur every day' or 'recur every 3 days'. - internal partial class DailySchedule + /// The node image upgrade to be applied to the target nodes in update run. + internal partial class NodeImageSelection { /// /// Keeps track of any properties unknown to the library. @@ -45,28 +45,28 @@ internal partial class DailySchedule /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// Specifies the number of days between each set of occurrences. - public DailySchedule(int intervalDays) + /// Initializes a new instance of . + /// The node image upgrade type. + public NodeImageSelection(NodeImageSelectionType selectionType) { - IntervalDays = intervalDays; + SelectionType = selectionType; } - /// Initializes a new instance of . - /// Specifies the number of days between each set of occurrences. + /// Initializes a new instance of . + /// The node image upgrade type. /// Keeps track of any properties unknown to the library. - internal DailySchedule(int intervalDays, IDictionary serializedAdditionalRawData) + internal NodeImageSelection(NodeImageSelectionType selectionType, IDictionary serializedAdditionalRawData) { - IntervalDays = intervalDays; + SelectionType = selectionType; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal DailySchedule() + /// Initializes a new instance of for deserialization. + internal NodeImageSelection() { } - /// Specifies the number of days between each set of occurrences. - public int IntervalDays { get; set; } + /// The node image upgrade type. + public NodeImageSelectionType SelectionType { get; set; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTimeSpan.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NodeImageSelectionStatus.Serialization.cs similarity index 58% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTimeSpan.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NodeImageSelectionStatus.Serialization.cs index 32171435d1978..d8cf8824dca59 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTimeSpan.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NodeImageSelectionStatus.Serialization.cs @@ -13,28 +13,28 @@ namespace Azure.ResourceManager.ContainerService.Models { - public partial class ContainerServiceTimeSpan : IUtf8JsonSerializable, IJsonModel + internal partial class NodeImageSelectionStatus : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServiceTimeSpan)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(NodeImageSelectionStatus)} does not support '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(StartOn)) + if (options.Format != "W" && Optional.IsCollectionDefined(SelectedNodeImageVersions)) { - writer.WritePropertyName("start"u8); - writer.WriteStringValue(StartOn.Value, "O"); - } - if (Optional.IsDefined(EndOn)) - { - writer.WritePropertyName("end"u8); - writer.WriteStringValue(EndOn.Value, "O"); + writer.WritePropertyName("selectedNodeImageVersions"u8); + writer.WriteStartArray(); + foreach (var item in SelectedNodeImageVersions) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -54,19 +54,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead writer.WriteEndObject(); } - ContainerServiceTimeSpan IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NodeImageSelectionStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServiceTimeSpan)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(NodeImageSelectionStatus)} does not support '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceTimeSpan(document.RootElement, options); + return DeserializeNodeImageSelectionStatus(document.RootElement, options); } - internal static ContainerServiceTimeSpan DeserializeContainerServiceTimeSpan(JsonElement element, ModelReaderWriterOptions options = null) + internal static NodeImageSelectionStatus DeserializeNodeImageSelectionStatus(JsonElement element, ModelReaderWriterOptions options = null) { options ??= new ModelReaderWriterOptions("W"); @@ -74,28 +74,23 @@ internal static ContainerServiceTimeSpan DeserializeContainerServiceTimeSpan(Jso { return null; } - Optional start = default; - Optional end = default; + Optional> selectedNodeImageVersions = default; IDictionary serializedAdditionalRawData = default; Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("start"u8)) + if (property.NameEquals("selectedNodeImageVersions"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - start = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("end"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) { - continue; + array.Add(NodeImageVersion.DeserializeNodeImageVersion(item)); } - end = property.Value.GetDateTimeOffset("O"); + selectedNodeImageVersions = array; continue; } if (options.Format != "W") @@ -104,38 +99,38 @@ internal static ContainerServiceTimeSpan DeserializeContainerServiceTimeSpan(Jso } } serializedAdditionalRawData = additionalPropertiesDictionary; - return new ContainerServiceTimeSpan(Optional.ToNullable(start), Optional.ToNullable(end), serializedAdditionalRawData); + return new NodeImageSelectionStatus(Optional.ToList(selectedNodeImageVersions), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + 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(ContainerServiceTimeSpan)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(NodeImageSelectionStatus)} does not support '{options.Format}' format."); } } - ContainerServiceTimeSpan IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NodeImageSelectionStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContainerServiceTimeSpan(document.RootElement, options); + return DeserializeNodeImageSelectionStatus(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ContainerServiceTimeSpan)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(NodeImageSelectionStatus)} does not support '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersionListResult.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NodeImageSelectionStatus.cs similarity index 66% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersionListResult.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NodeImageSelectionStatus.cs index a69d9162bd204..dba20f93ea7ab 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersionListResult.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NodeImageSelectionStatus.cs @@ -11,8 +11,8 @@ namespace Azure.ResourceManager.ContainerService.Models { - /// Hold values properties, which is array of KubernetesVersion. - public partial class KubernetesVersionListResult + /// The node image upgrade specs for the update run. + internal partial class NodeImageSelectionStatus { /// /// Keeps track of any properties unknown to the library. @@ -46,22 +46,22 @@ public partial class KubernetesVersionListResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal KubernetesVersionListResult() + /// Initializes a new instance of . + internal NodeImageSelectionStatus() { - Values = new ChangeTrackingList(); + SelectedNodeImageVersions = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// Array of AKS supported Kubernetes versions. + /// Initializes a new instance of . + /// The image versions to upgrade the nodes to. /// Keeps track of any properties unknown to the library. - internal KubernetesVersionListResult(IReadOnlyList values, IDictionary serializedAdditionalRawData) + internal NodeImageSelectionStatus(IReadOnlyList selectedNodeImageVersions, IDictionary serializedAdditionalRawData) { - Values = values; + SelectedNodeImageVersions = selectedNodeImageVersions; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Array of AKS supported Kubernetes versions. - public IReadOnlyList Values { get; } + /// The image versions to upgrade the nodes to. + public IReadOnlyList SelectedNodeImageVersions { get; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NodeImageSelectionType.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NodeImageSelectionType.cs new file mode 100644 index 0000000000000..0acc448e6a9ad --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NodeImageSelectionType.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.ContainerService.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"; + + /// 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); + /// 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 string 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?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceSshPublicKey.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NodeImageVersion.Serialization.cs similarity index 56% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceSshPublicKey.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NodeImageVersion.Serialization.cs index 23b36e995c61e..0ba9dc2fa3eac 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceSshPublicKey.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NodeImageVersion.Serialization.cs @@ -13,21 +13,24 @@ namespace Azure.ResourceManager.ContainerService.Models { - public partial class ContainerServiceSshPublicKey : IUtf8JsonSerializable, IJsonModel + public partial class NodeImageVersion : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServiceSshPublicKey)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(NodeImageVersion)} does not support '{format}' format."); } writer.WriteStartObject(); - writer.WritePropertyName("keyData"u8); - writer.WriteStringValue(KeyData); + 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) @@ -46,19 +49,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model writer.WriteEndObject(); } - ContainerServiceSshPublicKey IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NodeImageVersion IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServiceSshPublicKey)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(NodeImageVersion)} does not support '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceSshPublicKey(document.RootElement, options); + return DeserializeNodeImageVersion(document.RootElement, options); } - internal static ContainerServiceSshPublicKey DeserializeContainerServiceSshPublicKey(JsonElement element, ModelReaderWriterOptions options = null) + internal static NodeImageVersion DeserializeNodeImageVersion(JsonElement element, ModelReaderWriterOptions options = null) { options ??= new ModelReaderWriterOptions("W"); @@ -66,14 +69,14 @@ internal static ContainerServiceSshPublicKey DeserializeContainerServiceSshPubli { return null; } - string keyData = default; + Optional version = default; IDictionary serializedAdditionalRawData = default; Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("keyData"u8)) + if (property.NameEquals("version"u8)) { - keyData = property.Value.GetString(); + version = property.Value.GetString(); continue; } if (options.Format != "W") @@ -82,38 +85,38 @@ internal static ContainerServiceSshPublicKey DeserializeContainerServiceSshPubli } } serializedAdditionalRawData = additionalPropertiesDictionary; - return new ContainerServiceSshPublicKey(keyData, serializedAdditionalRawData); + return new NodeImageVersion(version.Value, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + 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(ContainerServiceSshPublicKey)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(NodeImageVersion)} does not support '{options.Format}' format."); } } - ContainerServiceSshPublicKey IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NodeImageVersion IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContainerServiceSshPublicKey(document.RootElement, options); + return DeserializeNodeImageVersion(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ContainerServiceSshPublicKey)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(NodeImageVersion)} does not support '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePowerState.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NodeImageVersion.cs similarity index 70% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePowerState.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NodeImageVersion.cs index c2330fe6effd1..e005209fba380 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePowerState.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NodeImageVersion.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.ContainerService.Models { - /// Describes the Power State of the cluster. - internal partial class ContainerServicePowerState + /// The node upgrade image version. + public partial class NodeImageVersion { /// /// Keeps track of any properties unknown to the library. @@ -45,21 +45,21 @@ internal partial class ContainerServicePowerState /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public ContainerServicePowerState() + /// Initializes a new instance of . + internal NodeImageVersion() { } - /// Initializes a new instance of . - /// Tells whether the cluster is Running or Stopped. + /// 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 ContainerServicePowerState(ContainerServiceStateCode? code, IDictionary serializedAdditionalRawData) + internal NodeImageVersion(string version, IDictionary serializedAdditionalRawData) { - Code = code; + Version = version; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Tells whether the cluster is Running or Stopped. - public ContainerServiceStateCode? Code { get; set; } + /// The image version to upgrade the nodes to (e.g., 'AKSUbuntu-1804gen2containerd-2022.12.13'). + public string Version { get; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/OSOptionProfileData.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/OSOptionProfileData.Serialization.cs deleted file mode 100644 index 70f29ebc5916e..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/OSOptionProfileData.Serialization.cs +++ /dev/null @@ -1,194 +0,0 @@ -// 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.ContainerService.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.ContainerService -{ - public partial class OSOptionProfileData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(OSOptionProfileData)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - writer.WritePropertyName("osOptionPropertyList"u8); - writer.WriteStartArray(); - foreach (var item in OSOptionPropertyList) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - OSOptionProfileData 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(OSOptionProfileData)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeOSOptionProfileData(document.RootElement, options); - } - - internal static OSOptionProfileData DeserializeOSOptionProfileData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - IReadOnlyList osOptionPropertyList = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - 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("osOptionPropertyList"u8)) - { - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(ContainerServiceOSOptionProperty.DeserializeContainerServiceOSOptionProperty(item)); - } - osOptionPropertyList = array; - continue; - } - } - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new OSOptionProfileData(id, name, type, systemData.Value, osOptionPropertyList, 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(OSOptionProfileData)} does not support '{options.Format}' format."); - } - } - - OSOptionProfileData 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); - return DeserializeOSOptionProfileData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(OSOptionProfileData)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/OutboundEnvironmentEndpointListResult.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/OutboundEnvironmentEndpointListResult.Serialization.cs deleted file mode 100644 index abaa805489be5..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/OutboundEnvironmentEndpointListResult.Serialization.cs +++ /dev/null @@ -1,140 +0,0 @@ -// 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.ContainerService.Models -{ - internal partial class OutboundEnvironmentEndpointListResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(OutboundEnvironmentEndpointListResult)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - if (options.Format != "W" && Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); - } - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - OutboundEnvironmentEndpointListResult 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(OutboundEnvironmentEndpointListResult)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeOutboundEnvironmentEndpointListResult(document.RootElement, options); - } - - internal static OutboundEnvironmentEndpointListResult DeserializeOutboundEnvironmentEndpointListResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - Optional nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = 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(ContainerServiceOutboundEnvironmentEndpoint.DeserializeContainerServiceOutboundEnvironmentEndpoint(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new OutboundEnvironmentEndpointListResult(value, nextLink.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(OutboundEnvironmentEndpointListResult)} does not support '{options.Format}' format."); - } - } - - OutboundEnvironmentEndpointListResult 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); - return DeserializeOutboundEnvironmentEndpointListResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(OutboundEnvironmentEndpointListResult)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ScaleDownMode.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ScaleDownMode.cs deleted file mode 100644 index 6c1674508c4ac..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ScaleDownMode.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Describes how VMs are added to or removed from Agent Pools. See [billing states](https://docs.microsoft.com/azure/virtual-machines/states-billing). - public readonly partial struct ScaleDownMode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ScaleDownMode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string DeleteValue = "Delete"; - private const string DeallocateValue = "Deallocate"; - - /// Create new instances during scale up and remove instances during scale down. - public static ScaleDownMode Delete { get; } = new ScaleDownMode(DeleteValue); - /// Attempt to start deallocated instances (if they exist) during scale up and deallocate instances during scale down. - public static ScaleDownMode Deallocate { get; } = new ScaleDownMode(DeallocateValue); - /// Determines if two values are the same. - public static bool operator ==(ScaleDownMode left, ScaleDownMode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ScaleDownMode left, ScaleDownMode right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ScaleDownMode(string value) => new ScaleDownMode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ScaleDownMode other && Equals(other); - /// - public bool Equals(ScaleDownMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ScaleSetEvictionPolicy.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ScaleSetEvictionPolicy.cs deleted file mode 100644 index 65b423fbf3340..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ScaleSetEvictionPolicy.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The eviction policy specifies what to do with the VM when it is evicted. The default is Delete. For more information about eviction see [spot VMs](https://docs.microsoft.com/azure/virtual-machines/spot-vms). - public readonly partial struct ScaleSetEvictionPolicy : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ScaleSetEvictionPolicy(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string DeleteValue = "Delete"; - private const string DeallocateValue = "Deallocate"; - - /// Nodes in the underlying Scale Set of the node pool are deleted when they're evicted. - public static ScaleSetEvictionPolicy Delete { get; } = new ScaleSetEvictionPolicy(DeleteValue); - /// Nodes in the underlying Scale Set of the node pool are set to the stopped-deallocated state upon eviction. Nodes in the stopped-deallocated state count against your compute quota and can cause issues with cluster scaling or upgrading. - public static ScaleSetEvictionPolicy Deallocate { get; } = new ScaleSetEvictionPolicy(DeallocateValue); - /// Determines if two values are the same. - public static bool operator ==(ScaleSetEvictionPolicy left, ScaleSetEvictionPolicy right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ScaleSetEvictionPolicy left, ScaleSetEvictionPolicy right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ScaleSetEvictionPolicy(string value) => new ScaleSetEvictionPolicy(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ScaleSetEvictionPolicy other && Equals(other); - /// - public bool Equals(ScaleSetEvictionPolicy other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ScaleSetPriority.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ScaleSetPriority.cs deleted file mode 100644 index 1de0897b2575c..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ScaleSetPriority.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The Virtual Machine Scale Set priority. - public readonly partial struct ScaleSetPriority : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ScaleSetPriority(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string SpotValue = "Spot"; - private const string RegularValue = "Regular"; - - /// Spot priority VMs will be used. There is no SLA for spot nodes. See [spot on AKS](https://docs.microsoft.com/azure/aks/spot-node-pool) for more information. - public static ScaleSetPriority Spot { get; } = new ScaleSetPriority(SpotValue); - /// Regular VMs will be used. - public static ScaleSetPriority Regular { get; } = new ScaleSetPriority(RegularValue); - /// Determines if two values are the same. - public static bool operator ==(ScaleSetPriority left, ScaleSetPriority right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ScaleSetPriority left, ScaleSetPriority right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ScaleSetPriority(string value) => new ScaleSetPriority(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ScaleSetPriority other && Equals(other); - /// - public bool Equals(ScaleSetPriority other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ServiceMeshMode.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ServiceMeshMode.cs deleted file mode 100644 index 44e89e7a570c5..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ServiceMeshMode.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Mode of the service mesh. - public readonly partial struct ServiceMeshMode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ServiceMeshMode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string IstioValue = "Istio"; - private const string DisabledValue = "Disabled"; - - /// Istio deployed as an AKS addon. - public static ServiceMeshMode Istio { get; } = new ServiceMeshMode(IstioValue); - /// Mesh is disabled. - public static ServiceMeshMode Disabled { get; } = new ServiceMeshMode(DisabledValue); - /// Determines if two values are the same. - public static bool operator ==(ServiceMeshMode left, ServiceMeshMode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ServiceMeshMode left, ServiceMeshMode right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ServiceMeshMode(string value) => new ServiceMeshMode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ServiceMeshMode other && Equals(other); - /// - public bool Equals(ServiceMeshMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePowerState.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SkipProperties.Serialization.cs similarity index 54% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePowerState.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SkipProperties.Serialization.cs index 20f0aaed47923..21b0e234923ff 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePowerState.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SkipProperties.Serialization.cs @@ -13,24 +13,26 @@ namespace Azure.ResourceManager.ContainerService.Models { - internal partial class ContainerServicePowerState : IUtf8JsonSerializable, IJsonModel + public partial class SkipProperties : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServicePowerState)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(SkipProperties)} does not support '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(Code)) + writer.WritePropertyName("targets"u8); + writer.WriteStartArray(); + foreach (var item in Targets) { - writer.WritePropertyName("code"u8); - writer.WriteStringValue(Code.Value.ToString()); + writer.WriteObjectValue(item); } + writer.WriteEndArray(); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -49,19 +51,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe writer.WriteEndObject(); } - ContainerServicePowerState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + SkipProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServicePowerState)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(SkipProperties)} does not support '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServicePowerState(document.RootElement, options); + return DeserializeSkipProperties(document.RootElement, options); } - internal static ContainerServicePowerState DeserializeContainerServicePowerState(JsonElement element, ModelReaderWriterOptions options = null) + internal static SkipProperties DeserializeSkipProperties(JsonElement element, ModelReaderWriterOptions options = null) { options ??= new ModelReaderWriterOptions("W"); @@ -69,18 +71,19 @@ internal static ContainerServicePowerState DeserializeContainerServicePowerState { return null; } - Optional code = default; + IList targets = default; IDictionary serializedAdditionalRawData = default; Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("code"u8)) + if (property.NameEquals("targets"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) { - continue; + array.Add(SkipTarget.DeserializeSkipTarget(item)); } - code = new ContainerServiceStateCode(property.Value.GetString()); + targets = array; continue; } if (options.Format != "W") @@ -89,38 +92,38 @@ internal static ContainerServicePowerState DeserializeContainerServicePowerState } } serializedAdditionalRawData = additionalPropertiesDictionary; - return new ContainerServicePowerState(Optional.ToNullable(code), serializedAdditionalRawData); + return new SkipProperties(targets, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + 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(ContainerServicePowerState)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(SkipProperties)} does not support '{options.Format}' format."); } } - ContainerServicePowerState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + SkipProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContainerServicePowerState(document.RootElement, options); + return DeserializeSkipProperties(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ContainerServicePowerState)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(SkipProperties)} does not support '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ServiceMeshProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SkipProperties.cs similarity index 67% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ServiceMeshProfile.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SkipProperties.cs index da84bda223c68..508979e00ae75 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ServiceMeshProfile.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SkipProperties.cs @@ -7,11 +7,13 @@ using System; using System.Collections.Generic; +using System.Linq; +using Azure.Core; namespace Azure.ResourceManager.ContainerService.Models { - /// Service mesh profile for a managed cluster. - public partial class ServiceMeshProfile + /// The properties of a skip operation containing multiple skip requests. + public partial class SkipProperties { /// /// Keeps track of any properties unknown to the library. @@ -45,32 +47,31 @@ public partial class ServiceMeshProfile /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// Mode of the service mesh. - public ServiceMeshProfile(ServiceMeshMode mode) + /// Initializes a new instance of . + /// The targets to skip. + /// is null. + public SkipProperties(IEnumerable targets) { - Mode = mode; + Argument.AssertNotNull(targets, nameof(targets)); + + Targets = targets.ToList(); } - /// Initializes a new instance of . - /// Mode of the service mesh. - /// Istio service mesh configuration. + /// Initializes a new instance of . + /// The targets to skip. /// Keeps track of any properties unknown to the library. - internal ServiceMeshProfile(ServiceMeshMode mode, IstioServiceMesh istio, IDictionary serializedAdditionalRawData) + internal SkipProperties(IList targets, IDictionary serializedAdditionalRawData) { - Mode = mode; - Istio = istio; + Targets = targets; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal ServiceMeshProfile() + /// Initializes a new instance of for deserialization. + internal SkipProperties() { } - /// Mode of the service mesh. - public ServiceMeshMode Mode { get; set; } - /// Istio service mesh configuration. - public IstioServiceMesh Istio { get; set; } + /// The targets to skip. + public IList Targets { get; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioIngressGateway.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SkipTarget.Serialization.cs similarity index 55% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioIngressGateway.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SkipTarget.Serialization.cs index bb36296d32d62..1110e61ca2274 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioIngressGateway.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SkipTarget.Serialization.cs @@ -13,23 +13,23 @@ namespace Azure.ResourceManager.ContainerService.Models { - public partial class IstioIngressGateway : IUtf8JsonSerializable, IJsonModel + public partial class SkipTarget : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(IstioIngressGateway)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(SkipTarget)} does not support '{format}' format."); } writer.WriteStartObject(); - writer.WritePropertyName("mode"u8); - writer.WriteStringValue(Mode.ToString()); - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(IsEnabled); + writer.WritePropertyName("type"u8); + writer.WriteStringValue(TargetType.ToString()); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -48,19 +48,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri writer.WriteEndObject(); } - IstioIngressGateway IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + SkipTarget IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(IstioIngressGateway)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(SkipTarget)} does not support '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeIstioIngressGateway(document.RootElement, options); + return DeserializeSkipTarget(document.RootElement, options); } - internal static IstioIngressGateway DeserializeIstioIngressGateway(JsonElement element, ModelReaderWriterOptions options = null) + internal static SkipTarget DeserializeSkipTarget(JsonElement element, ModelReaderWriterOptions options = null) { options ??= new ModelReaderWriterOptions("W"); @@ -68,20 +68,20 @@ internal static IstioIngressGateway DeserializeIstioIngressGateway(JsonElement e { return null; } - IstioIngressGatewayMode mode = default; - bool enabled = default; + TargetType type = default; + string name = default; IDictionary serializedAdditionalRawData = default; Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("mode"u8)) + if (property.NameEquals("type"u8)) { - mode = new IstioIngressGatewayMode(property.Value.GetString()); + type = new TargetType(property.Value.GetString()); continue; } - if (property.NameEquals("enabled"u8)) + if (property.NameEquals("name"u8)) { - enabled = property.Value.GetBoolean(); + name = property.Value.GetString(); continue; } if (options.Format != "W") @@ -90,38 +90,38 @@ internal static IstioIngressGateway DeserializeIstioIngressGateway(JsonElement e } } serializedAdditionalRawData = additionalPropertiesDictionary; - return new IstioIngressGateway(mode, enabled, serializedAdditionalRawData); + return new SkipTarget(type, name, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + 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(IstioIngressGateway)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(SkipTarget)} does not support '{options.Format}' format."); } } - IstioIngressGateway IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + SkipTarget IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeIstioIngressGateway(document.RootElement, options); + return DeserializeSkipTarget(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(IstioIngressGateway)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(SkipTarget)} does not support '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterRunCommandContent.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SkipTarget.cs similarity index 52% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterRunCommandContent.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SkipTarget.cs index fb73ddb2e4db0..4a6aa29a15003 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterRunCommandContent.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SkipTarget.cs @@ -11,8 +11,8 @@ namespace Azure.ResourceManager.ContainerService.Models { - /// A run command request. - public partial class ManagedClusterRunCommandContent + /// The definition of a single skip request. + public partial class SkipTarget { /// /// Keeps track of any properties unknown to the library. @@ -46,39 +46,49 @@ public partial class ManagedClusterRunCommandContent /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The command to run. - /// is null. - public ManagedClusterRunCommandContent(string command) + /// 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 targetType, string name) { - Argument.AssertNotNull(command, nameof(command)); + Argument.AssertNotNull(name, nameof(name)); - Command = command; + TargetType = targetType; + Name = name; } - /// Initializes a new instance of . - /// The command to run. - /// A base64 encoded zip file containing the files required by the command. - /// AuthToken issued for AKS AAD Server App. + /// 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 ManagedClusterRunCommandContent(string command, string context, string clusterToken, IDictionary serializedAdditionalRawData) + internal SkipTarget(TargetType targetType, string name, IDictionary serializedAdditionalRawData) { - Command = command; - Context = context; - ClusterToken = clusterToken; + TargetType = targetType; + Name = name; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal ManagedClusterRunCommandContent() + /// Initializes a new instance of for deserialization. + internal SkipTarget() { } - /// The command to run. - public string Command { get; } - /// A base64 encoded zip file containing the files required by the command. - public string Context { get; set; } - /// AuthToken issued for AKS AAD Server App. - public string ClusterToken { get; set; } + /// The skip target type. + public TargetType TargetType { 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/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SnapshotType.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SnapshotType.cs deleted file mode 100644 index 84b6a9a273951..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SnapshotType.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The type of a snapshot. The default is NodePool. - public readonly partial struct SnapshotType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public SnapshotType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string NodePoolValue = "NodePool"; - - /// The snapshot is a snapshot of a node pool. - public static SnapshotType NodePool { get; } = new SnapshotType(NodePoolValue); - /// Determines if two values are the same. - public static bool operator ==(SnapshotType left, SnapshotType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SnapshotType left, SnapshotType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator SnapshotType(string value) => new SnapshotType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SnapshotType other && Equals(other); - /// - public bool Equals(SnapshotType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SysctlConfig.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SysctlConfig.Serialization.cs deleted file mode 100644 index fecdae7443877..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SysctlConfig.Serialization.cs +++ /dev/null @@ -1,527 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class SysctlConfig : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(SysctlConfig)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(NetCoreSomaxconn)) - { - writer.WritePropertyName("netCoreSomaxconn"u8); - writer.WriteNumberValue(NetCoreSomaxconn.Value); - } - if (Optional.IsDefined(NetCoreNetdevMaxBacklog)) - { - writer.WritePropertyName("netCoreNetdevMaxBacklog"u8); - writer.WriteNumberValue(NetCoreNetdevMaxBacklog.Value); - } - if (Optional.IsDefined(NetCoreRmemDefault)) - { - writer.WritePropertyName("netCoreRmemDefault"u8); - writer.WriteNumberValue(NetCoreRmemDefault.Value); - } - if (Optional.IsDefined(NetCoreRmemMax)) - { - writer.WritePropertyName("netCoreRmemMax"u8); - writer.WriteNumberValue(NetCoreRmemMax.Value); - } - if (Optional.IsDefined(NetCoreWmemDefault)) - { - writer.WritePropertyName("netCoreWmemDefault"u8); - writer.WriteNumberValue(NetCoreWmemDefault.Value); - } - if (Optional.IsDefined(NetCoreWmemMax)) - { - writer.WritePropertyName("netCoreWmemMax"u8); - writer.WriteNumberValue(NetCoreWmemMax.Value); - } - if (Optional.IsDefined(NetCoreOptmemMax)) - { - writer.WritePropertyName("netCoreOptmemMax"u8); - writer.WriteNumberValue(NetCoreOptmemMax.Value); - } - if (Optional.IsDefined(NetIPv4TcpMaxSynBacklog)) - { - writer.WritePropertyName("netIpv4TcpMaxSynBacklog"u8); - writer.WriteNumberValue(NetIPv4TcpMaxSynBacklog.Value); - } - if (Optional.IsDefined(NetIPv4TcpMaxTwBuckets)) - { - writer.WritePropertyName("netIpv4TcpMaxTwBuckets"u8); - writer.WriteNumberValue(NetIPv4TcpMaxTwBuckets.Value); - } - if (Optional.IsDefined(NetIPv4TcpFinTimeout)) - { - writer.WritePropertyName("netIpv4TcpFinTimeout"u8); - writer.WriteNumberValue(NetIPv4TcpFinTimeout.Value); - } - if (Optional.IsDefined(NetIPv4TcpKeepaliveTime)) - { - writer.WritePropertyName("netIpv4TcpKeepaliveTime"u8); - writer.WriteNumberValue(NetIPv4TcpKeepaliveTime.Value); - } - if (Optional.IsDefined(NetIPv4TcpKeepaliveProbes)) - { - writer.WritePropertyName("netIpv4TcpKeepaliveProbes"u8); - writer.WriteNumberValue(NetIPv4TcpKeepaliveProbes.Value); - } - if (Optional.IsDefined(NetIPv4TcpKeepaliveIntvl)) - { - writer.WritePropertyName("netIpv4TcpkeepaliveIntvl"u8); - writer.WriteNumberValue(NetIPv4TcpKeepaliveIntvl.Value); - } - if (Optional.IsDefined(NetIPv4TcpTwReuse)) - { - writer.WritePropertyName("netIpv4TcpTwReuse"u8); - writer.WriteBooleanValue(NetIPv4TcpTwReuse.Value); - } - if (Optional.IsDefined(NetIPv4IPLocalPortRange)) - { - writer.WritePropertyName("netIpv4IpLocalPortRange"u8); - writer.WriteStringValue(NetIPv4IPLocalPortRange); - } - if (Optional.IsDefined(NetIPv4NeighDefaultGcThresh1)) - { - writer.WritePropertyName("netIpv4NeighDefaultGcThresh1"u8); - writer.WriteNumberValue(NetIPv4NeighDefaultGcThresh1.Value); - } - if (Optional.IsDefined(NetIPv4NeighDefaultGcThresh2)) - { - writer.WritePropertyName("netIpv4NeighDefaultGcThresh2"u8); - writer.WriteNumberValue(NetIPv4NeighDefaultGcThresh2.Value); - } - if (Optional.IsDefined(NetIPv4NeighDefaultGcThresh3)) - { - writer.WritePropertyName("netIpv4NeighDefaultGcThresh3"u8); - writer.WriteNumberValue(NetIPv4NeighDefaultGcThresh3.Value); - } - if (Optional.IsDefined(NetNetfilterNfConntrackMax)) - { - writer.WritePropertyName("netNetfilterNfConntrackMax"u8); - writer.WriteNumberValue(NetNetfilterNfConntrackMax.Value); - } - if (Optional.IsDefined(NetNetfilterNfConntrackBuckets)) - { - writer.WritePropertyName("netNetfilterNfConntrackBuckets"u8); - writer.WriteNumberValue(NetNetfilterNfConntrackBuckets.Value); - } - if (Optional.IsDefined(FsInotifyMaxUserWatches)) - { - writer.WritePropertyName("fsInotifyMaxUserWatches"u8); - writer.WriteNumberValue(FsInotifyMaxUserWatches.Value); - } - if (Optional.IsDefined(FsFileMax)) - { - writer.WritePropertyName("fsFileMax"u8); - writer.WriteNumberValue(FsFileMax.Value); - } - if (Optional.IsDefined(FsAioMaxNr)) - { - writer.WritePropertyName("fsAioMaxNr"u8); - writer.WriteNumberValue(FsAioMaxNr.Value); - } - if (Optional.IsDefined(FsNrOpen)) - { - writer.WritePropertyName("fsNrOpen"u8); - writer.WriteNumberValue(FsNrOpen.Value); - } - if (Optional.IsDefined(KernelThreadsMax)) - { - writer.WritePropertyName("kernelThreadsMax"u8); - writer.WriteNumberValue(KernelThreadsMax.Value); - } - if (Optional.IsDefined(VmMaxMapCount)) - { - writer.WritePropertyName("vmMaxMapCount"u8); - writer.WriteNumberValue(VmMaxMapCount.Value); - } - if (Optional.IsDefined(VmSwappiness)) - { - writer.WritePropertyName("vmSwappiness"u8); - writer.WriteNumberValue(VmSwappiness.Value); - } - if (Optional.IsDefined(VmVfsCachePressure)) - { - writer.WritePropertyName("vmVfsCachePressure"u8); - writer.WriteNumberValue(VmVfsCachePressure.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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - SysctlConfig 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(SysctlConfig)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeSysctlConfig(document.RootElement, options); - } - - internal static SysctlConfig DeserializeSysctlConfig(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional netCoreSomaxconn = default; - Optional netCoreNetdevMaxBacklog = default; - Optional netCoreRmemDefault = default; - Optional netCoreRmemMax = default; - Optional netCoreWmemDefault = default; - Optional netCoreWmemMax = default; - Optional netCoreOptmemMax = default; - Optional netIPv4TcpMaxSynBacklog = default; - Optional netIPv4TcpMaxTwBuckets = default; - Optional netIPv4TcpFinTimeout = default; - Optional netIPv4TcpKeepaliveTime = default; - Optional netIPv4TcpKeepaliveProbes = default; - Optional netIPv4TcpKeepaliveIntvl = default; - Optional netIPv4TcpTwReuse = default; - Optional netIPv4IPLocalPortRange = default; - Optional netIPv4NeighDefaultGcThresh1 = default; - Optional netIPv4NeighDefaultGcThresh2 = default; - Optional netIPv4NeighDefaultGcThresh3 = default; - Optional netNetfilterNfConntrackMax = default; - Optional netNetfilterNfConntrackBuckets = default; - Optional fsInotifyMaxUserWatches = default; - Optional fsFileMax = default; - Optional fsAioMaxNr = default; - Optional fsNrOpen = default; - Optional kernelThreadsMax = default; - Optional vmMaxMapCount = default; - Optional vmSwappiness = default; - Optional vmVfsCachePressure = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("netCoreSomaxconn"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - netCoreSomaxconn = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("netCoreNetdevMaxBacklog"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - netCoreNetdevMaxBacklog = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("netCoreRmemDefault"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - netCoreRmemDefault = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("netCoreRmemMax"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - netCoreRmemMax = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("netCoreWmemDefault"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - netCoreWmemDefault = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("netCoreWmemMax"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - netCoreWmemMax = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("netCoreOptmemMax"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - netCoreOptmemMax = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("netIpv4TcpMaxSynBacklog"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - netIPv4TcpMaxSynBacklog = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("netIpv4TcpMaxTwBuckets"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - netIPv4TcpMaxTwBuckets = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("netIpv4TcpFinTimeout"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - netIPv4TcpFinTimeout = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("netIpv4TcpKeepaliveTime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - netIPv4TcpKeepaliveTime = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("netIpv4TcpKeepaliveProbes"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - netIPv4TcpKeepaliveProbes = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("netIpv4TcpkeepaliveIntvl"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - netIPv4TcpKeepaliveIntvl = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("netIpv4TcpTwReuse"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - netIPv4TcpTwReuse = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("netIpv4IpLocalPortRange"u8)) - { - netIPv4IPLocalPortRange = property.Value.GetString(); - continue; - } - if (property.NameEquals("netIpv4NeighDefaultGcThresh1"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - netIPv4NeighDefaultGcThresh1 = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("netIpv4NeighDefaultGcThresh2"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - netIPv4NeighDefaultGcThresh2 = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("netIpv4NeighDefaultGcThresh3"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - netIPv4NeighDefaultGcThresh3 = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("netNetfilterNfConntrackMax"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - netNetfilterNfConntrackMax = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("netNetfilterNfConntrackBuckets"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - netNetfilterNfConntrackBuckets = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("fsInotifyMaxUserWatches"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - fsInotifyMaxUserWatches = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("fsFileMax"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - fsFileMax = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("fsAioMaxNr"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - fsAioMaxNr = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("fsNrOpen"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - fsNrOpen = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("kernelThreadsMax"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - kernelThreadsMax = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("vmMaxMapCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - vmMaxMapCount = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("vmSwappiness"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - vmSwappiness = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("vmVfsCachePressure"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - vmVfsCachePressure = property.Value.GetInt32(); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new SysctlConfig(Optional.ToNullable(netCoreSomaxconn), Optional.ToNullable(netCoreNetdevMaxBacklog), Optional.ToNullable(netCoreRmemDefault), Optional.ToNullable(netCoreRmemMax), Optional.ToNullable(netCoreWmemDefault), Optional.ToNullable(netCoreWmemMax), Optional.ToNullable(netCoreOptmemMax), Optional.ToNullable(netIPv4TcpMaxSynBacklog), Optional.ToNullable(netIPv4TcpMaxTwBuckets), Optional.ToNullable(netIPv4TcpFinTimeout), Optional.ToNullable(netIPv4TcpKeepaliveTime), Optional.ToNullable(netIPv4TcpKeepaliveProbes), Optional.ToNullable(netIPv4TcpKeepaliveIntvl), Optional.ToNullable(netIPv4TcpTwReuse), netIPv4IPLocalPortRange.Value, Optional.ToNullable(netIPv4NeighDefaultGcThresh1), Optional.ToNullable(netIPv4NeighDefaultGcThresh2), Optional.ToNullable(netIPv4NeighDefaultGcThresh3), Optional.ToNullable(netNetfilterNfConntrackMax), Optional.ToNullable(netNetfilterNfConntrackBuckets), Optional.ToNullable(fsInotifyMaxUserWatches), Optional.ToNullable(fsFileMax), Optional.ToNullable(fsAioMaxNr), Optional.ToNullable(fsNrOpen), Optional.ToNullable(kernelThreadsMax), Optional.ToNullable(vmMaxMapCount), Optional.ToNullable(vmSwappiness), Optional.ToNullable(vmVfsCachePressure), 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(SysctlConfig)} does not support '{options.Format}' format."); - } - } - - SysctlConfig 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); - return DeserializeSysctlConfig(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(SysctlConfig)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SysctlConfig.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SysctlConfig.cs deleted file mode 100644 index 6301dd66813ba..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SysctlConfig.cs +++ /dev/null @@ -1,173 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Sysctl settings for Linux agent nodes. - public partial class SysctlConfig - { - /// - /// 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 SysctlConfig() - { - } - - /// Initializes a new instance of . - /// Sysctl setting net.core.somaxconn. - /// Sysctl setting net.core.netdev_max_backlog. - /// Sysctl setting net.core.rmem_default. - /// Sysctl setting net.core.rmem_max. - /// Sysctl setting net.core.wmem_default. - /// Sysctl setting net.core.wmem_max. - /// Sysctl setting net.core.optmem_max. - /// Sysctl setting net.ipv4.tcp_max_syn_backlog. - /// Sysctl setting net.ipv4.tcp_max_tw_buckets. - /// Sysctl setting net.ipv4.tcp_fin_timeout. - /// Sysctl setting net.ipv4.tcp_keepalive_time. - /// Sysctl setting net.ipv4.tcp_keepalive_probes. - /// Sysctl setting net.ipv4.tcp_keepalive_intvl. - /// Sysctl setting net.ipv4.tcp_tw_reuse. - /// Sysctl setting net.ipv4.ip_local_port_range. - /// Sysctl setting net.ipv4.neigh.default.gc_thresh1. - /// Sysctl setting net.ipv4.neigh.default.gc_thresh2. - /// Sysctl setting net.ipv4.neigh.default.gc_thresh3. - /// Sysctl setting net.netfilter.nf_conntrack_max. - /// Sysctl setting net.netfilter.nf_conntrack_buckets. - /// Sysctl setting fs.inotify.max_user_watches. - /// Sysctl setting fs.file-max. - /// Sysctl setting fs.aio-max-nr. - /// Sysctl setting fs.nr_open. - /// Sysctl setting kernel.threads-max. - /// Sysctl setting vm.max_map_count. - /// Sysctl setting vm.swappiness. - /// Sysctl setting vm.vfs_cache_pressure. - /// Keeps track of any properties unknown to the library. - internal SysctlConfig(int? netCoreSomaxconn, int? netCoreNetdevMaxBacklog, int? netCoreRmemDefault, int? netCoreRmemMax, int? netCoreWmemDefault, int? netCoreWmemMax, int? netCoreOptmemMax, int? netIPv4TcpMaxSynBacklog, int? netIPv4TcpMaxTwBuckets, int? netIPv4TcpFinTimeout, int? netIPv4TcpKeepaliveTime, int? netIPv4TcpKeepaliveProbes, int? netIPv4TcpKeepaliveIntvl, bool? netIPv4TcpTwReuse, string netIPv4IPLocalPortRange, int? netIPv4NeighDefaultGcThresh1, int? netIPv4NeighDefaultGcThresh2, int? netIPv4NeighDefaultGcThresh3, int? netNetfilterNfConntrackMax, int? netNetfilterNfConntrackBuckets, int? fsInotifyMaxUserWatches, int? fsFileMax, int? fsAioMaxNr, int? fsNrOpen, int? kernelThreadsMax, int? vmMaxMapCount, int? vmSwappiness, int? vmVfsCachePressure, IDictionary serializedAdditionalRawData) - { - NetCoreSomaxconn = netCoreSomaxconn; - NetCoreNetdevMaxBacklog = netCoreNetdevMaxBacklog; - NetCoreRmemDefault = netCoreRmemDefault; - NetCoreRmemMax = netCoreRmemMax; - NetCoreWmemDefault = netCoreWmemDefault; - NetCoreWmemMax = netCoreWmemMax; - NetCoreOptmemMax = netCoreOptmemMax; - NetIPv4TcpMaxSynBacklog = netIPv4TcpMaxSynBacklog; - NetIPv4TcpMaxTwBuckets = netIPv4TcpMaxTwBuckets; - NetIPv4TcpFinTimeout = netIPv4TcpFinTimeout; - NetIPv4TcpKeepaliveTime = netIPv4TcpKeepaliveTime; - NetIPv4TcpKeepaliveProbes = netIPv4TcpKeepaliveProbes; - NetIPv4TcpKeepaliveIntvl = netIPv4TcpKeepaliveIntvl; - NetIPv4TcpTwReuse = netIPv4TcpTwReuse; - NetIPv4IPLocalPortRange = netIPv4IPLocalPortRange; - NetIPv4NeighDefaultGcThresh1 = netIPv4NeighDefaultGcThresh1; - NetIPv4NeighDefaultGcThresh2 = netIPv4NeighDefaultGcThresh2; - NetIPv4NeighDefaultGcThresh3 = netIPv4NeighDefaultGcThresh3; - NetNetfilterNfConntrackMax = netNetfilterNfConntrackMax; - NetNetfilterNfConntrackBuckets = netNetfilterNfConntrackBuckets; - FsInotifyMaxUserWatches = fsInotifyMaxUserWatches; - FsFileMax = fsFileMax; - FsAioMaxNr = fsAioMaxNr; - FsNrOpen = fsNrOpen; - KernelThreadsMax = kernelThreadsMax; - VmMaxMapCount = vmMaxMapCount; - VmSwappiness = vmSwappiness; - VmVfsCachePressure = vmVfsCachePressure; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Sysctl setting net.core.somaxconn. - public int? NetCoreSomaxconn { get; set; } - /// Sysctl setting net.core.netdev_max_backlog. - public int? NetCoreNetdevMaxBacklog { get; set; } - /// Sysctl setting net.core.rmem_default. - public int? NetCoreRmemDefault { get; set; } - /// Sysctl setting net.core.rmem_max. - public int? NetCoreRmemMax { get; set; } - /// Sysctl setting net.core.wmem_default. - public int? NetCoreWmemDefault { get; set; } - /// Sysctl setting net.core.wmem_max. - public int? NetCoreWmemMax { get; set; } - /// Sysctl setting net.core.optmem_max. - public int? NetCoreOptmemMax { get; set; } - /// Sysctl setting net.ipv4.tcp_max_syn_backlog. - public int? NetIPv4TcpMaxSynBacklog { get; set; } - /// Sysctl setting net.ipv4.tcp_max_tw_buckets. - public int? NetIPv4TcpMaxTwBuckets { get; set; } - /// Sysctl setting net.ipv4.tcp_fin_timeout. - public int? NetIPv4TcpFinTimeout { get; set; } - /// Sysctl setting net.ipv4.tcp_keepalive_time. - public int? NetIPv4TcpKeepaliveTime { get; set; } - /// Sysctl setting net.ipv4.tcp_keepalive_probes. - public int? NetIPv4TcpKeepaliveProbes { get; set; } - /// Sysctl setting net.ipv4.tcp_keepalive_intvl. - public int? NetIPv4TcpKeepaliveIntvl { get; set; } - /// Sysctl setting net.ipv4.tcp_tw_reuse. - public bool? NetIPv4TcpTwReuse { get; set; } - /// Sysctl setting net.ipv4.ip_local_port_range. - public string NetIPv4IPLocalPortRange { get; set; } - /// Sysctl setting net.ipv4.neigh.default.gc_thresh1. - public int? NetIPv4NeighDefaultGcThresh1 { get; set; } - /// Sysctl setting net.ipv4.neigh.default.gc_thresh2. - public int? NetIPv4NeighDefaultGcThresh2 { get; set; } - /// Sysctl setting net.ipv4.neigh.default.gc_thresh3. - public int? NetIPv4NeighDefaultGcThresh3 { get; set; } - /// Sysctl setting net.netfilter.nf_conntrack_max. - public int? NetNetfilterNfConntrackMax { get; set; } - /// Sysctl setting net.netfilter.nf_conntrack_buckets. - public int? NetNetfilterNfConntrackBuckets { get; set; } - /// Sysctl setting fs.inotify.max_user_watches. - public int? FsInotifyMaxUserWatches { get; set; } - /// Sysctl setting fs.file-max. - public int? FsFileMax { get; set; } - /// Sysctl setting fs.aio-max-nr. - public int? FsAioMaxNr { get; set; } - /// Sysctl setting fs.nr_open. - public int? FsNrOpen { get; set; } - /// Sysctl setting kernel.threads-max. - public int? KernelThreadsMax { get; set; } - /// Sysctl setting vm.max_map_count. - public int? VmMaxMapCount { get; set; } - /// Sysctl setting vm.swappiness. - public int? VmSwappiness { get; set; } - /// Sysctl setting vm.vfs_cache_pressure. - public int? VmVfsCachePressure { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/TargetType.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/TargetType.cs new file mode 100644 index 0000000000000..8e8d0eed9399f --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/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.ContainerService.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 string 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?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/TrustedAccessRoleBindingListResult.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/TrustedAccessRoleBindingListResult.Serialization.cs deleted file mode 100644 index ad921208a8b93..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/TrustedAccessRoleBindingListResult.Serialization.cs +++ /dev/null @@ -1,148 +0,0 @@ -// 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.ContainerService; - -namespace Azure.ResourceManager.ContainerService.Models -{ - internal partial class TrustedAccessRoleBindingListResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(TrustedAccessRoleBindingListResult)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); - } - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - TrustedAccessRoleBindingListResult 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(TrustedAccessRoleBindingListResult)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeTrustedAccessRoleBindingListResult(document.RootElement, options); - } - - internal static TrustedAccessRoleBindingListResult DeserializeTrustedAccessRoleBindingListResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - Optional nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ContainerServiceTrustedAccessRoleBindingData.DeserializeContainerServiceTrustedAccessRoleBindingData(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new TrustedAccessRoleBindingListResult(Optional.ToList(value), nextLink.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(TrustedAccessRoleBindingListResult)} does not support '{options.Format}' format."); - } - } - - TrustedAccessRoleBindingListResult 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); - return DeserializeTrustedAccessRoleBindingListResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(TrustedAccessRoleBindingListResult)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/TrustedAccessRoleListResult.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/TrustedAccessRoleListResult.Serialization.cs deleted file mode 100644 index 51e1b11f3a105..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/TrustedAccessRoleListResult.Serialization.cs +++ /dev/null @@ -1,147 +0,0 @@ -// 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.ContainerService.Models -{ - internal partial class TrustedAccessRoleListResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(TrustedAccessRoleListResult)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsCollectionDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); - } - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - TrustedAccessRoleListResult 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(TrustedAccessRoleListResult)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeTrustedAccessRoleListResult(document.RootElement, options); - } - - internal static TrustedAccessRoleListResult DeserializeTrustedAccessRoleListResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - Optional nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ContainerServiceTrustedAccessRole.DeserializeContainerServiceTrustedAccessRole(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new TrustedAccessRoleListResult(Optional.ToList(value), nextLink.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(TrustedAccessRoleListResult)} does not support '{options.Format}' format."); - } - } - - TrustedAccessRoleListResult 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); - return DeserializeTrustedAccessRoleListResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(TrustedAccessRoleListResult)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/TrustedAccessRoleListResult.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/TrustedAccessRoleListResult.cs deleted file mode 100644 index cf211fc18f474..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/TrustedAccessRoleListResult.cs +++ /dev/null @@ -1,71 +0,0 @@ -// 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.ContainerService.Models -{ - /// List of trusted access roles. - internal partial class TrustedAccessRoleListResult - { - /// - /// 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 TrustedAccessRoleListResult() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Role list. - /// Link to next page of resources. - /// Keeps track of any properties unknown to the library. - internal TrustedAccessRoleListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) - { - Value = value; - NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Role list. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/DailySchedule.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateGroup.Serialization.cs similarity index 59% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/DailySchedule.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateGroup.Serialization.cs index 7bc8fcdf49ce7..3ebbc9bd1368e 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/DailySchedule.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateGroup.Serialization.cs @@ -13,21 +13,21 @@ namespace Azure.ResourceManager.ContainerService.Models { - internal partial class DailySchedule : IUtf8JsonSerializable, IJsonModel + public partial class UpdateGroup : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DailySchedule)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(UpdateGroup)} does not support '{format}' format."); } writer.WriteStartObject(); - writer.WritePropertyName("intervalDays"u8); - writer.WriteNumberValue(IntervalDays); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -46,19 +46,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpt writer.WriteEndObject(); } - DailySchedule IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + UpdateGroup IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DailySchedule)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(UpdateGroup)} does not support '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDailySchedule(document.RootElement, options); + return DeserializeUpdateGroup(document.RootElement, options); } - internal static DailySchedule DeserializeDailySchedule(JsonElement element, ModelReaderWriterOptions options = null) + internal static UpdateGroup DeserializeUpdateGroup(JsonElement element, ModelReaderWriterOptions options = null) { options ??= new ModelReaderWriterOptions("W"); @@ -66,14 +66,14 @@ internal static DailySchedule DeserializeDailySchedule(JsonElement element, Mode { return null; } - int intervalDays = default; + string name = default; IDictionary serializedAdditionalRawData = default; Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("intervalDays"u8)) + if (property.NameEquals("name"u8)) { - intervalDays = property.Value.GetInt32(); + name = property.Value.GetString(); continue; } if (options.Format != "W") @@ -82,38 +82,38 @@ internal static DailySchedule DeserializeDailySchedule(JsonElement element, Mode } } serializedAdditionalRawData = additionalPropertiesDictionary; - return new DailySchedule(intervalDays, serializedAdditionalRawData); + return new UpdateGroup(name, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + 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(DailySchedule)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(UpdateGroup)} does not support '{options.Format}' format."); } } - DailySchedule IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + UpdateGroup IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDailySchedule(document.RootElement, options); + return DeserializeUpdateGroup(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DailySchedule)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(UpdateGroup)} does not support '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/CompatibleVersions.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateGroup.cs similarity index 61% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/CompatibleVersions.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateGroup.cs index fdeb5fd6a1fbd..25aded21366c7 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/CompatibleVersions.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateGroup.cs @@ -11,8 +11,8 @@ namespace Azure.ResourceManager.ContainerService.Models { - /// Version information about a product/service that is compatible with a service mesh revision. - public partial class CompatibleVersions + /// A group to be updated. + public partial class UpdateGroup { /// /// Keeps track of any properties unknown to the library. @@ -46,26 +46,40 @@ public partial class CompatibleVersions /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public CompatibleVersions() + /// 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) { - Versions = new ChangeTrackingList(); + Argument.AssertNotNull(name, nameof(name)); + + Name = name; } - /// Initializes a new instance of . - /// The product/service name. - /// Product/service versions compatible with a service mesh add-on revision. + /// 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 CompatibleVersions(string name, IList versions, IDictionary serializedAdditionalRawData) + internal UpdateGroup(string name, IDictionary serializedAdditionalRawData) { Name = name; - Versions = versions; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The product/service name. + /// 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; } - /// Product/service versions compatible with a service mesh add-on revision. - public IList Versions { get; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTrustedAccessRole.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateGroupStatus.Serialization.cs similarity index 55% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTrustedAccessRole.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateGroupStatus.Serialization.cs index 202f16479cf0c..055130a21bf59 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTrustedAccessRole.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateGroupStatus.Serialization.cs @@ -13,34 +13,34 @@ namespace Azure.ResourceManager.ContainerService.Models { - public partial class ContainerServiceTrustedAccessRole : IUtf8JsonSerializable, IJsonModel + public partial class UpdateGroupStatus : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServiceTrustedAccessRole)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(UpdateGroupStatus)} does not support '{format}' format."); } writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(SourceResourceType)) + if (options.Format != "W" && Optional.IsDefined(Status)) { - writer.WritePropertyName("sourceResourceType"u8); - writer.WriteStringValue(SourceResourceType); + writer.WritePropertyName("status"u8); + writer.WriteObjectValue(Status); } if (options.Format != "W" && Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); writer.WriteStringValue(Name); } - if (options.Format != "W" && Optional.IsCollectionDefined(Rules)) + if (options.Format != "W" && Optional.IsCollectionDefined(Members)) { - writer.WritePropertyName("rules"u8); + writer.WritePropertyName("members"u8); writer.WriteStartArray(); - foreach (var item in Rules) + foreach (var item in Members) { writer.WriteObjectValue(item); } @@ -64,19 +64,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WriteEndObject(); } - ContainerServiceTrustedAccessRole IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + UpdateGroupStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServiceTrustedAccessRole)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(UpdateGroupStatus)} does not support '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceTrustedAccessRole(document.RootElement, options); + return DeserializeUpdateGroupStatus(document.RootElement, options); } - internal static ContainerServiceTrustedAccessRole DeserializeContainerServiceTrustedAccessRole(JsonElement element, ModelReaderWriterOptions options = null) + internal static UpdateGroupStatus DeserializeUpdateGroupStatus(JsonElement element, ModelReaderWriterOptions options = null) { options ??= new ModelReaderWriterOptions("W"); @@ -84,16 +84,20 @@ internal static ContainerServiceTrustedAccessRole DeserializeContainerServiceTru { return null; } - Optional sourceResourceType = default; + Optional status = default; Optional name = default; - Optional> rules = default; + Optional> members = default; IDictionary serializedAdditionalRawData = default; Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("sourceResourceType"u8)) + if (property.NameEquals("status"u8)) { - sourceResourceType = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = UpdateStatus.DeserializeUpdateStatus(property.Value); continue; } if (property.NameEquals("name"u8)) @@ -101,18 +105,18 @@ internal static ContainerServiceTrustedAccessRole DeserializeContainerServiceTru name = property.Value.GetString(); continue; } - if (property.NameEquals("rules"u8)) + if (property.NameEquals("members"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(ContainerServiceTrustedAccessRoleRule.DeserializeContainerServiceTrustedAccessRoleRule(item)); + array.Add(MemberUpdateStatus.DeserializeMemberUpdateStatus(item)); } - rules = array; + members = array; continue; } if (options.Format != "W") @@ -121,38 +125,38 @@ internal static ContainerServiceTrustedAccessRole DeserializeContainerServiceTru } } serializedAdditionalRawData = additionalPropertiesDictionary; - return new ContainerServiceTrustedAccessRole(sourceResourceType.Value, name.Value, Optional.ToList(rules), serializedAdditionalRawData); + return new UpdateGroupStatus(status.Value, name.Value, Optional.ToList(members), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + 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(ContainerServiceTrustedAccessRole)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(UpdateGroupStatus)} does not support '{options.Format}' format."); } } - ContainerServiceTrustedAccessRole IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + UpdateGroupStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContainerServiceTrustedAccessRole(document.RootElement, options); + return DeserializeUpdateGroupStatus(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ContainerServiceTrustedAccessRole)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(UpdateGroupStatus)} does not support '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkServiceConnectionState.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateGroupStatus.cs similarity index 60% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkServiceConnectionState.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateGroupStatus.cs index 649ef5f065742..b21fd532c1963 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkServiceConnectionState.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateGroupStatus.cs @@ -7,11 +7,12 @@ using System; using System.Collections.Generic; +using Azure.Core; namespace Azure.ResourceManager.ContainerService.Models { - /// The state of a private link service connection. - public partial class ContainerServicePrivateLinkServiceConnectionState + /// The status of a UpdateGroup. + public partial class UpdateGroupStatus { /// /// Keeps track of any properties unknown to the library. @@ -45,25 +46,30 @@ public partial class ContainerServicePrivateLinkServiceConnectionState /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public ContainerServicePrivateLinkServiceConnectionState() + /// Initializes a new instance of . + internal UpdateGroupStatus() { + Members = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// The private link service connection status. - /// The private link service connection description. + /// 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 ContainerServicePrivateLinkServiceConnectionState(ContainerServicePrivateLinkServiceConnectionStatus? status, string description, IDictionary serializedAdditionalRawData) + internal UpdateGroupStatus(UpdateStatus status, string name, IReadOnlyList members, IDictionary serializedAdditionalRawData) { Status = status; - Description = description; + Name = name; + Members = members; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The private link service connection status. - public ContainerServicePrivateLinkServiceConnectionStatus? Status { get; set; } - /// The private link service connection description. - public string Description { get; set; } + /// 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/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceConfigurationData.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateRunData.Serialization.cs similarity index 55% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceConfigurationData.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateRunData.Serialization.cs index 48fceb9f51554..68fcf566c40cd 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceConfigurationData.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateRunData.Serialization.cs @@ -9,25 +9,31 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure; using Azure.Core; using Azure.ResourceManager.ContainerService.Models; using Azure.ResourceManager.Models; namespace Azure.ResourceManager.ContainerService { - public partial class ContainerServiceMaintenanceConfigurationData : IUtf8JsonSerializable, IJsonModel + public partial class UpdateRunData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServiceMaintenanceConfigurationData)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(UpdateRunData)} does not support '{format}' format."); } writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(ETag)) + { + writer.WritePropertyName("eTag"u8); + writer.WriteStringValue(ETag.Value.ToString()); + } if (options.Format != "W") { writer.WritePropertyName("id"u8); @@ -50,30 +56,30 @@ void IJsonModel.Write(Utf8JsonWrit } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); - if (Optional.IsCollectionDefined(TimesInWeek)) + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) { - writer.WritePropertyName("timeInWeek"u8); - writer.WriteStartArray(); - foreach (var item in TimesInWeek) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); } - if (Optional.IsCollectionDefined(NotAllowedTimes)) + if (Optional.IsDefined(UpdateStrategyId)) { - writer.WritePropertyName("notAllowedTime"u8); - writer.WriteStartArray(); - foreach (var item in NotAllowedTimes) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); + writer.WritePropertyName("updateStrategyId"u8); + writer.WriteStringValue(UpdateStrategyId); + } + if (Optional.IsDefined(Strategy)) + { + writer.WritePropertyName("strategy"u8); + writer.WriteObjectValue(Strategy); + } + if (Optional.IsDefined(ManagedClusterUpdate)) + { + writer.WritePropertyName("managedClusterUpdate"u8); + writer.WriteObjectValue(ManagedClusterUpdate); } - if (Optional.IsDefined(MaintenanceWindow)) + if (options.Format != "W" && Optional.IsDefined(Status)) { - writer.WritePropertyName("maintenanceWindow"u8); - writer.WriteObjectValue(MaintenanceWindow); + writer.WritePropertyName("status"u8); + writer.WriteObjectValue(Status); } writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -94,19 +100,19 @@ void IJsonModel.Write(Utf8JsonWrit writer.WriteEndObject(); } - ContainerServiceMaintenanceConfigurationData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + UpdateRunData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServiceMaintenanceConfigurationData)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(UpdateRunData)} does not support '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceMaintenanceConfigurationData(document.RootElement, options); + return DeserializeUpdateRunData(document.RootElement, options); } - internal static ContainerServiceMaintenanceConfigurationData DeserializeContainerServiceMaintenanceConfigurationData(JsonElement element, ModelReaderWriterOptions options = null) + internal static UpdateRunData DeserializeUpdateRunData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= new ModelReaderWriterOptions("W"); @@ -114,17 +120,29 @@ internal static ContainerServiceMaintenanceConfigurationData DeserializeContaine { return null; } + Optional eTag = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; Optional systemData = default; - Optional> timeInWeek = default; - Optional> notAllowedTime = default; - Optional maintenanceWindow = default; + Optional provisioningState = default; + Optional updateStrategyId = default; + Optional strategy = default; + Optional managedClusterUpdate = default; + Optional status = default; IDictionary serializedAdditionalRawData = default; Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("eTag"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + eTag = new ETag(property.Value.GetString()); + continue; + } if (property.NameEquals("id"u8)) { id = new ResourceIdentifier(property.Value.GetString()); @@ -158,41 +176,49 @@ internal static ContainerServiceMaintenanceConfigurationData DeserializeContaine } foreach (var property0 in property.Value.EnumerateObject()) { - if (property0.NameEquals("timeInWeek"u8)) + if (property0.NameEquals("provisioningState"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) + provisioningState = new UpdateRunProvisioningState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("updateStrategyId"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) { - array.Add(ContainerServiceTimeInWeek.DeserializeContainerServiceTimeInWeek(item)); + continue; } - timeInWeek = array; + updateStrategyId = new ResourceIdentifier(property0.Value.GetString()); continue; } - if (property0.NameEquals("notAllowedTime"u8)) + if (property0.NameEquals("strategy"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) + strategy = UpdateRunStrategy.DeserializeUpdateRunStrategy(property0.Value); + continue; + } + if (property0.NameEquals("managedClusterUpdate"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) { - array.Add(ContainerServiceTimeSpan.DeserializeContainerServiceTimeSpan(item)); + continue; } - notAllowedTime = array; + managedClusterUpdate = ManagedClusterUpdate.DeserializeManagedClusterUpdate(property0.Value); continue; } - if (property0.NameEquals("maintenanceWindow"u8)) + if (property0.NameEquals("status"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } - maintenanceWindow = ContainerServiceMaintenanceWindow.DeserializeContainerServiceMaintenanceWindow(property0.Value); + status = UpdateRunStatus.DeserializeUpdateRunStatus(property0.Value); continue; } } @@ -204,38 +230,38 @@ internal static ContainerServiceMaintenanceConfigurationData DeserializeContaine } } serializedAdditionalRawData = additionalPropertiesDictionary; - return new ContainerServiceMaintenanceConfigurationData(id, name, type, systemData.Value, Optional.ToList(timeInWeek), Optional.ToList(notAllowedTime), maintenanceWindow.Value, serializedAdditionalRawData); + return new UpdateRunData(id, name, type, systemData.Value, Optional.ToNullable(eTag), Optional.ToNullable(provisioningState), updateStrategyId.Value, strategy.Value, managedClusterUpdate.Value, status.Value, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + 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(ContainerServiceMaintenanceConfigurationData)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(UpdateRunData)} does not support '{options.Format}' format."); } } - ContainerServiceMaintenanceConfigurationData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + UpdateRunData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContainerServiceMaintenanceConfigurationData(document.RootElement, options); + return DeserializeUpdateRunData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ContainerServiceMaintenanceConfigurationData)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(UpdateRunData)} does not support '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshRevisionProfileList.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateRunListResult.Serialization.cs similarity index 55% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshRevisionProfileList.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateRunListResult.Serialization.cs index 9d7063d02333f..3ad2ffe251146 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshRevisionProfileList.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateRunListResult.Serialization.cs @@ -14,33 +14,30 @@ namespace Azure.ResourceManager.ContainerService.Models { - internal partial class MeshRevisionProfileList : IUtf8JsonSerializable, IJsonModel + internal partial class UpdateRunListResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MeshRevisionProfileList)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(UpdateRunListResult)} does not support '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item); } - if (options.Format != "W" && Optional.IsDefined(NextLink)) + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -60,19 +57,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade writer.WriteEndObject(); } - MeshRevisionProfileList IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + UpdateRunListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MeshRevisionProfileList)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(UpdateRunListResult)} does not support '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMeshRevisionProfileList(document.RootElement, options); + return DeserializeUpdateRunListResult(document.RootElement, options); } - internal static MeshRevisionProfileList DeserializeMeshRevisionProfileList(JsonElement element, ModelReaderWriterOptions options = null) + internal static UpdateRunListResult DeserializeUpdateRunListResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= new ModelReaderWriterOptions("W"); @@ -80,29 +77,29 @@ internal static MeshRevisionProfileList DeserializeMeshRevisionProfileList(JsonE { return null; } - Optional> value = default; - Optional nextLink = default; + IReadOnlyList value = default; + Optional nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(MeshRevisionProfileData.DeserializeMeshRevisionProfileData(item)); + array.Add(UpdateRunData.DeserializeUpdateRunData(item)); } value = array; continue; } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -111,38 +108,38 @@ internal static MeshRevisionProfileList DeserializeMeshRevisionProfileList(JsonE } } serializedAdditionalRawData = additionalPropertiesDictionary; - return new MeshRevisionProfileList(Optional.ToList(value), nextLink.Value, serializedAdditionalRawData); + return new UpdateRunListResult(value, nextLink.Value, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + 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(MeshRevisionProfileList)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(UpdateRunListResult)} does not support '{options.Format}' format."); } } - MeshRevisionProfileList IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + UpdateRunListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMeshRevisionProfileList(document.RootElement, options); + return DeserializeUpdateRunListResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(MeshRevisionProfileList)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(UpdateRunListResult)} does not support '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceConfigurationListResult.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateRunListResult.cs similarity index 59% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceConfigurationListResult.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateRunListResult.cs index 4fe105359970f..819d235957aed 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceConfigurationListResult.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateRunListResult.cs @@ -7,13 +7,14 @@ using System; using System.Collections.Generic; +using System.Linq; using Azure.Core; using Azure.ResourceManager.ContainerService; namespace Azure.ResourceManager.ContainerService.Models { - /// The response from the List maintenance configurations operation. - internal partial class ContainerServiceMaintenanceConfigurationListResult + /// The response of a UpdateRun list operation. + internal partial class UpdateRunListResult { /// /// Keeps track of any properties unknown to the library. @@ -47,26 +48,35 @@ internal partial class ContainerServiceMaintenanceConfigurationListResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal ContainerServiceMaintenanceConfigurationListResult() + /// Initializes a new instance of . + /// The UpdateRun items on this page. + /// is null. + internal UpdateRunListResult(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } - /// Initializes a new instance of . - /// The list of maintenance configurations. - /// The URL to get the next set of maintenance configuration results. + /// 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 ContainerServiceMaintenanceConfigurationListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal UpdateRunListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The list of maintenance configurations. - public IReadOnlyList Value { get; } - /// The URL to get the next set of maintenance configuration results. - public string NextLink { get; } + /// 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/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateRunProvisioningState.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateRunProvisioningState.cs new file mode 100644 index 0000000000000..42880c010018e --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/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.ContainerService.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 string 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?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioComponents.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateRunStatus.Serialization.cs similarity index 57% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioComponents.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateRunStatus.Serialization.cs index c7d1c6980281b..62168f4258862 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioComponents.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateRunStatus.Serialization.cs @@ -13,39 +13,39 @@ namespace Azure.ResourceManager.ContainerService.Models { - public partial class IstioComponents : IUtf8JsonSerializable, IJsonModel + public partial class UpdateRunStatus : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(IstioComponents)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(UpdateRunStatus)} does not support '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsCollectionDefined(IngressGateways)) + if (options.Format != "W" && Optional.IsDefined(Status)) { - writer.WritePropertyName("ingressGateways"u8); - writer.WriteStartArray(); - foreach (var item in IngressGateways) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); + writer.WritePropertyName("status"u8); + writer.WriteObjectValue(Status); } - if (Optional.IsCollectionDefined(EgressGateways)) + if (options.Format != "W" && Optional.IsCollectionDefined(Stages)) { - writer.WritePropertyName("egressGateways"u8); + writer.WritePropertyName("stages"u8); writer.WriteStartArray(); - foreach (var item in EgressGateways) + foreach (var item in Stages) { writer.WriteObjectValue(item); } writer.WriteEndArray(); } + if (options.Format != "W" && Optional.IsDefined(NodeImageSelection)) + { + writer.WritePropertyName("nodeImageSelection"u8); + writer.WriteObjectValue(NodeImageSelection); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -64,19 +64,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO writer.WriteEndObject(); } - IstioComponents IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + UpdateRunStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(IstioComponents)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(UpdateRunStatus)} does not support '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeIstioComponents(document.RootElement, options); + return DeserializeUpdateRunStatus(document.RootElement, options); } - internal static IstioComponents DeserializeIstioComponents(JsonElement element, ModelReaderWriterOptions options = null) + internal static UpdateRunStatus DeserializeUpdateRunStatus(JsonElement element, ModelReaderWriterOptions options = null) { options ??= new ModelReaderWriterOptions("W"); @@ -84,38 +84,43 @@ internal static IstioComponents DeserializeIstioComponents(JsonElement element, { return null; } - Optional> ingressGateways = default; - Optional> egressGateways = default; + Optional status = default; + Optional> stages = default; + Optional nodeImageSelection = default; IDictionary serializedAdditionalRawData = default; Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("ingressGateways"u8)) + if (property.NameEquals("status"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(IstioIngressGateway.DeserializeIstioIngressGateway(item)); - } - ingressGateways = array; + status = UpdateStatus.DeserializeUpdateStatus(property.Value); continue; } - if (property.NameEquals("egressGateways"u8)) + if (property.NameEquals("stages"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(IstioEgressGateway.DeserializeIstioEgressGateway(item)); + array.Add(UpdateStageStatus.DeserializeUpdateStageStatus(item)); + } + stages = array; + continue; + } + if (property.NameEquals("nodeImageSelection"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; } - egressGateways = array; + nodeImageSelection = NodeImageSelectionStatus.DeserializeNodeImageSelectionStatus(property.Value); continue; } if (options.Format != "W") @@ -124,38 +129,38 @@ internal static IstioComponents DeserializeIstioComponents(JsonElement element, } } serializedAdditionalRawData = additionalPropertiesDictionary; - return new IstioComponents(Optional.ToList(ingressGateways), Optional.ToList(egressGateways), serializedAdditionalRawData); + return new UpdateRunStatus(status.Value, Optional.ToList(stages), nodeImageSelection.Value, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + 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(IstioComponents)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(UpdateRunStatus)} does not support '{options.Format}' format."); } } - IstioComponents IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + UpdateRunStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeIstioComponents(document.RootElement, options); + return DeserializeUpdateRunStatus(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(IstioComponents)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(UpdateRunStatus)} does not support '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateRunStatus.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateRunStatus.cs new file mode 100644 index 0000000000000..c3b1f322867a6 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateRunStatus.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 Azure.Core; + +namespace Azure.ResourceManager.ContainerService.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/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSku.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateRunStrategy.Serialization.cs similarity index 57% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSku.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateRunStrategy.Serialization.cs index fe3d5ef26ea33..d5f14ded7c04b 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSku.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateRunStrategy.Serialization.cs @@ -13,29 +13,26 @@ namespace Azure.ResourceManager.ContainerService.Models { - public partial class ManagedClusterSku : IUtf8JsonSerializable, IJsonModel + internal partial class UpdateRunStrategy : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ManagedClusterSku)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(UpdateRunStrategy)} does not support '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(Name)) + writer.WritePropertyName("stages"u8); + writer.WriteStartArray(); + foreach (var item in Stages) { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name.Value.ToString()); - } - if (Optional.IsDefined(Tier)) - { - writer.WritePropertyName("tier"u8); - writer.WriteStringValue(Tier.Value.ToString()); + writer.WriteObjectValue(item); } + writer.WriteEndArray(); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -54,19 +51,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite writer.WriteEndObject(); } - ManagedClusterSku IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + UpdateRunStrategy IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ManagedClusterSku)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(UpdateRunStrategy)} does not support '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterSku(document.RootElement, options); + return DeserializeUpdateRunStrategy(document.RootElement, options); } - internal static ManagedClusterSku DeserializeManagedClusterSku(JsonElement element, ModelReaderWriterOptions options = null) + internal static UpdateRunStrategy DeserializeUpdateRunStrategy(JsonElement element, ModelReaderWriterOptions options = null) { options ??= new ModelReaderWriterOptions("W"); @@ -74,28 +71,19 @@ internal static ManagedClusterSku DeserializeManagedClusterSku(JsonElement eleme { return null; } - Optional name = default; - Optional tier = default; + IList stages = default; IDictionary serializedAdditionalRawData = default; Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("name"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - name = new ManagedClusterSkuName(property.Value.GetString()); - continue; - } - if (property.NameEquals("tier"u8)) + if (property.NameEquals("stages"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) { - continue; + array.Add(UpdateStage.DeserializeUpdateStage(item)); } - tier = new ManagedClusterSkuTier(property.Value.GetString()); + stages = array; continue; } if (options.Format != "W") @@ -104,38 +92,38 @@ internal static ManagedClusterSku DeserializeManagedClusterSku(JsonElement eleme } } serializedAdditionalRawData = additionalPropertiesDictionary; - return new ManagedClusterSku(Optional.ToNullable(name), Optional.ToNullable(tier), serializedAdditionalRawData); + return new UpdateRunStrategy(stages, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + 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(ManagedClusterSku)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(UpdateRunStrategy)} does not support '{options.Format}' format."); } } - ManagedClusterSku IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + UpdateRunStrategy IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterSku(document.RootElement, options); + return DeserializeUpdateRunStrategy(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ManagedClusterSku)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(UpdateRunStrategy)} does not support '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceSshPublicKey.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateRunStrategy.cs similarity index 57% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceSshPublicKey.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateRunStrategy.cs index 9db873cedded5..49fdd2edaec30 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceSshPublicKey.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateRunStrategy.cs @@ -7,12 +7,21 @@ using System; using System.Collections.Generic; +using System.Linq; using Azure.Core; namespace Azure.ResourceManager.ContainerService.Models { - /// Contains information about SSH certificate public key data. - public partial class ContainerServiceSshPublicKey + /// + /// 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. @@ -46,31 +55,31 @@ public partial class ContainerServiceSshPublicKey /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// Certificate public key used to authenticate with VMs through SSH. The certificate must be in PEM format with or without headers. - /// is null. - public ContainerServiceSshPublicKey(string keyData) + /// 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(keyData, nameof(keyData)); + Argument.AssertNotNull(stages, nameof(stages)); - KeyData = keyData; + Stages = stages.ToList(); } - /// Initializes a new instance of . - /// Certificate public key used to authenticate with VMs through SSH. The certificate must be in PEM format with or without headers. + /// 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 ContainerServiceSshPublicKey(string keyData, IDictionary serializedAdditionalRawData) + internal UpdateRunStrategy(IList stages, IDictionary serializedAdditionalRawData) { - KeyData = keyData; + Stages = stages; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal ContainerServiceSshPublicKey() + /// Initializes a new instance of for deserialization. + internal UpdateRunStrategy() { } - /// Certificate public key used to authenticate with VMs through SSH. The certificate must be in PEM format with or without headers. - public string KeyData { get; set; } + /// The list of stages that compose this update run. Min size: 1. + public IList Stages { get; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTimeInWeek.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateStage.Serialization.cs similarity index 54% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTimeInWeek.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateStage.Serialization.cs index f9d458fa651a3..b4d989c75528f 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTimeInWeek.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateStage.Serialization.cs @@ -13,34 +13,36 @@ namespace Azure.ResourceManager.ContainerService.Models { - public partial class ContainerServiceTimeInWeek : IUtf8JsonSerializable, IJsonModel + public partial class UpdateStage : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServiceTimeInWeek)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(UpdateStage)} does not support '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(Day)) + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (Optional.IsCollectionDefined(Groups)) { - writer.WritePropertyName("day"u8); - writer.WriteStringValue(Day.Value.ToString()); - } - if (Optional.IsCollectionDefined(HourSlots)) - { - writer.WritePropertyName("hourSlots"u8); + writer.WritePropertyName("groups"u8); writer.WriteStartArray(); - foreach (var item in HourSlots) + foreach (var item in Groups) { - writer.WriteNumberValue(item); + writer.WriteObjectValue(item); } 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) @@ -59,19 +61,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe writer.WriteEndObject(); } - ContainerServiceTimeInWeek IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + UpdateStage IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServiceTimeInWeek)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(UpdateStage)} does not support '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceTimeInWeek(document.RootElement, options); + return DeserializeUpdateStage(document.RootElement, options); } - internal static ContainerServiceTimeInWeek DeserializeContainerServiceTimeInWeek(JsonElement element, ModelReaderWriterOptions options = null) + internal static UpdateStage DeserializeUpdateStage(JsonElement element, ModelReaderWriterOptions options = null) { options ??= new ModelReaderWriterOptions("W"); @@ -79,33 +81,39 @@ internal static ContainerServiceTimeInWeek DeserializeContainerServiceTimeInWeek { return null; } - Optional day = default; - Optional> hourSlots = default; + string name = default; + Optional> groups = default; + Optional afterStageWaitInSeconds = default; IDictionary serializedAdditionalRawData = default; Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("day"u8)) + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("groups"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - day = new ContainerServiceWeekDay(property.Value.GetString()); + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(UpdateGroup.DeserializeUpdateGroup(item)); + } + groups = array; continue; } - if (property.NameEquals("hourSlots"u8)) + if (property.NameEquals("afterStageWaitInSeconds"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetInt32()); - } - hourSlots = array; + afterStageWaitInSeconds = property.Value.GetInt32(); continue; } if (options.Format != "W") @@ -114,38 +122,38 @@ internal static ContainerServiceTimeInWeek DeserializeContainerServiceTimeInWeek } } serializedAdditionalRawData = additionalPropertiesDictionary; - return new ContainerServiceTimeInWeek(Optional.ToNullable(day), Optional.ToList(hourSlots), serializedAdditionalRawData); + return new UpdateStage(name, Optional.ToList(groups), Optional.ToNullable(afterStageWaitInSeconds), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + 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(ContainerServiceTimeInWeek)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(UpdateStage)} does not support '{options.Format}' format."); } } - ContainerServiceTimeInWeek IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + UpdateStage IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContainerServiceTimeInWeek(document.RootElement, options); + return DeserializeUpdateStage(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ContainerServiceTimeInWeek)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(UpdateStage)} does not support '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateStage.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateStage.cs new file mode 100644 index 0000000000000..9f6dfb868b5df --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateStage.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; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerService.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/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersion.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateStageStatus.Serialization.cs similarity index 54% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersion.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateStageStatus.Serialization.cs index 62a1721dc6e7f..1e27ffcc43e6e 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersion.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateStageStatus.Serialization.cs @@ -13,44 +13,43 @@ namespace Azure.ResourceManager.ContainerService.Models { - public partial class KubernetesVersion : IUtf8JsonSerializable, IJsonModel + public partial class UpdateStageStatus : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(KubernetesVersion)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(UpdateStageStatus)} does not support '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(Version)) + if (options.Format != "W" && Optional.IsDefined(Status)) { - writer.WritePropertyName("version"u8); - writer.WriteStringValue(Version); + writer.WritePropertyName("status"u8); + writer.WriteObjectValue(Status); } - if (Optional.IsDefined(Capabilities)) + if (options.Format != "W" && Optional.IsDefined(Name)) { - writer.WritePropertyName("capabilities"u8); - writer.WriteObjectValue(Capabilities); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); } - if (Optional.IsDefined(IsPreview)) + if (options.Format != "W" && Optional.IsCollectionDefined(Groups)) { - writer.WritePropertyName("isPreview"u8); - writer.WriteBooleanValue(IsPreview.Value); - } - if (Optional.IsCollectionDefined(PatchVersions)) - { - writer.WritePropertyName("patchVersions"u8); - writer.WriteStartObject(); - foreach (var item in PatchVersions) + writer.WritePropertyName("groups"u8); + writer.WriteStartArray(); + foreach (var item in Groups) { - writer.WritePropertyName(item.Key); - writer.WriteObjectValue(item.Value); + writer.WriteObjectValue(item); } - writer.WriteEndObject(); + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(AfterStageWaitStatus)) + { + writer.WritePropertyName("afterStageWaitStatus"u8); + writer.WriteObjectValue(AfterStageWaitStatus); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -70,19 +69,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite writer.WriteEndObject(); } - KubernetesVersion IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + UpdateStageStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(KubernetesVersion)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(UpdateStageStatus)} does not support '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeKubernetesVersion(document.RootElement, options); + return DeserializeUpdateStageStatus(document.RootElement, options); } - internal static KubernetesVersion DeserializeKubernetesVersion(JsonElement element, ModelReaderWriterOptions options = null) + internal static UpdateStageStatus DeserializeUpdateStageStatus(JsonElement element, ModelReaderWriterOptions options = null) { options ??= new ModelReaderWriterOptions("W"); @@ -90,49 +89,49 @@ internal static KubernetesVersion DeserializeKubernetesVersion(JsonElement eleme { return null; } - Optional version = default; - Optional capabilities = default; - Optional isPreview = default; - Optional> patchVersions = default; + Optional status = default; + Optional name = default; + Optional> groups = default; + Optional afterStageWaitStatus = default; IDictionary serializedAdditionalRawData = default; Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("version"u8)) - { - version = property.Value.GetString(); - continue; - } - if (property.NameEquals("capabilities"u8)) + if (property.NameEquals("status"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - capabilities = KubernetesVersionCapabilities.DeserializeKubernetesVersionCapabilities(property.Value); + status = UpdateStatus.DeserializeUpdateStatus(property.Value); continue; } - if (property.NameEquals("isPreview"u8)) + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("groups"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - isPreview = property.Value.GetBoolean(); + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(UpdateGroupStatus.DeserializeUpdateGroupStatus(item)); + } + groups = array; continue; } - if (property.NameEquals("patchVersions"u8)) + if (property.NameEquals("afterStageWaitStatus"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, KubernetesPatchVersion.DeserializeKubernetesPatchVersion(property0.Value)); - } - patchVersions = dictionary; + afterStageWaitStatus = WaitStatus.DeserializeWaitStatus(property.Value); continue; } if (options.Format != "W") @@ -141,38 +140,38 @@ internal static KubernetesVersion DeserializeKubernetesVersion(JsonElement eleme } } serializedAdditionalRawData = additionalPropertiesDictionary; - return new KubernetesVersion(version.Value, capabilities.Value, Optional.ToNullable(isPreview), Optional.ToDictionary(patchVersions), serializedAdditionalRawData); + return new UpdateStageStatus(status.Value, name.Value, Optional.ToList(groups), afterStageWaitStatus.Value, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + 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(KubernetesVersion)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(UpdateStageStatus)} does not support '{options.Format}' format."); } } - KubernetesVersion IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + UpdateStageStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeKubernetesVersion(document.RootElement, options); + return DeserializeUpdateStageStatus(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(KubernetesVersion)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(UpdateStageStatus)} does not support '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpgradeOverrideSettings.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateStageStatus.cs similarity index 54% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpgradeOverrideSettings.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateStageStatus.cs index d4037c6857242..07c870f74bae0 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpgradeOverrideSettings.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateStageStatus.cs @@ -7,11 +7,12 @@ using System; using System.Collections.Generic; +using Azure.Core; namespace Azure.ResourceManager.ContainerService.Models { - /// Settings for overrides when upgrading a cluster. - public partial class UpgradeOverrideSettings + /// The status of a UpdateStage. + public partial class UpdateStageStatus { /// /// Keeps track of any properties unknown to the library. @@ -45,25 +46,34 @@ public partial class UpgradeOverrideSettings /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public UpgradeOverrideSettings() + /// Initializes a new instance of . + internal UpdateStageStatus() { + Groups = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// Whether to force upgrade the cluster. Note that this option instructs upgrade operation to bypass upgrade protections such as checking for deprecated API usage. Enable this option only with caution. - /// Until when the overrides are effective. Note that this only matches the start time of an upgrade, and the effectiveness won't change once an upgrade starts even if the `until` expires as upgrade proceeds. This field is not set by default. It must be set for the overrides to take effect. + /// 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 UpgradeOverrideSettings(bool? forceUpgrade, DateTimeOffset? until, IDictionary serializedAdditionalRawData) + internal UpdateStageStatus(UpdateStatus status, string name, IReadOnlyList groups, WaitStatus afterStageWaitStatus, IDictionary serializedAdditionalRawData) { - ForceUpgrade = forceUpgrade; - Until = until; + Status = status; + Name = name; + Groups = groups; + AfterStageWaitStatus = afterStageWaitStatus; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Whether to force upgrade the cluster. Note that this option instructs upgrade operation to bypass upgrade protections such as checking for deprecated API usage. Enable this option only with caution. - public bool? ForceUpgrade { get; set; } - /// Until when the overrides are effective. Note that this only matches the start time of an upgrade, and the effectiveness won't change once an upgrade starts even if the `until` expires as upgrade proceeds. This field is not set by default. It must be set for the overrides to take effect. - public DateTimeOffset? Until { get; set; } + /// 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/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateState.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateState.cs new file mode 100644 index 0000000000000..89f5628f493c9 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/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.ContainerService.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 string 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?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshRevision.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateStatus.Serialization.cs similarity index 54% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshRevision.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateStatus.Serialization.cs index 00f3e7b416b27..05c63d63884bb 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshRevision.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateStatus.Serialization.cs @@ -9,47 +9,43 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure; using Azure.Core; namespace Azure.ResourceManager.ContainerService.Models { - public partial class MeshRevision : IUtf8JsonSerializable, IJsonModel + public partial class UpdateStatus : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MeshRevision)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(UpdateStatus)} does not support '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(Revision)) + if (options.Format != "W" && Optional.IsDefined(StartOn)) { - writer.WritePropertyName("revision"u8); - writer.WriteStringValue(Revision); + writer.WritePropertyName("startTime"u8); + writer.WriteStringValue(StartOn.Value, "O"); } - if (Optional.IsCollectionDefined(Upgrades)) + if (options.Format != "W" && Optional.IsDefined(CompletedOn)) { - writer.WritePropertyName("upgrades"u8); - writer.WriteStartArray(); - foreach (var item in Upgrades) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); + writer.WritePropertyName("completedTime"u8); + writer.WriteStringValue(CompletedOn.Value, "O"); } - if (Optional.IsCollectionDefined(CompatibleWith)) + if (options.Format != "W" && Optional.IsDefined(State)) { - writer.WritePropertyName("compatibleWith"u8); - writer.WriteStartArray(); - foreach (var item in CompatibleWith) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); + 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) { @@ -69,19 +65,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpti writer.WriteEndObject(); } - MeshRevision IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + UpdateStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MeshRevision)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(UpdateStatus)} does not support '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMeshRevision(document.RootElement, options); + return DeserializeUpdateStatus(document.RootElement, options); } - internal static MeshRevision DeserializeMeshRevision(JsonElement element, ModelReaderWriterOptions options = null) + internal static UpdateStatus DeserializeUpdateStatus(JsonElement element, ModelReaderWriterOptions options = null) { options ??= new ModelReaderWriterOptions("W"); @@ -89,44 +85,48 @@ internal static MeshRevision DeserializeMeshRevision(JsonElement element, ModelR { return null; } - Optional revision = default; - Optional> upgrades = default; - Optional> compatibleWith = default; + Optional startTime = default; + Optional completedTime = default; + Optional state = default; + Optional error = default; IDictionary serializedAdditionalRawData = default; Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("revision"u8)) + if (property.NameEquals("startTime"u8)) { - revision = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startTime = property.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("upgrades"u8)) + if (property.NameEquals("completedTime"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - upgrades = array; + completedTime = property.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("compatibleWith"u8)) + if (property.NameEquals("state"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + state = new UpdateState(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) { - array.Add(CompatibleVersions.DeserializeCompatibleVersions(item)); + continue; } - compatibleWith = array; + error = JsonSerializer.Deserialize(property.Value.GetRawText()); continue; } if (options.Format != "W") @@ -135,38 +135,38 @@ internal static MeshRevision DeserializeMeshRevision(JsonElement element, ModelR } } serializedAdditionalRawData = additionalPropertiesDictionary; - return new MeshRevision(revision.Value, Optional.ToList(upgrades), Optional.ToList(compatibleWith), serializedAdditionalRawData); + return new UpdateStatus(Optional.ToNullable(startTime), Optional.ToNullable(completedTime), Optional.ToNullable(state), error.Value, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + 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(MeshRevision)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(UpdateStatus)} does not support '{options.Format}' format."); } } - MeshRevision IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + UpdateStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMeshRevision(document.RootElement, options); + return DeserializeUpdateStatus(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(MeshRevision)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(UpdateStatus)} does not support '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProvisioningInfo.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateStatus.cs similarity index 56% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProvisioningInfo.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateStatus.cs index 29db2f152c183..81b57c55dd621 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProvisioningInfo.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateStatus.cs @@ -11,8 +11,8 @@ namespace Azure.ResourceManager.ContainerService.Models { - /// The ManagedClusterPodIdentityProvisioningInfo. - internal partial class ManagedClusterPodIdentityProvisioningInfo + /// The status for an operation or group of operations. + public partial class UpdateStatus { /// /// Keeps track of any properties unknown to the library. @@ -46,26 +46,33 @@ internal partial class ManagedClusterPodIdentityProvisioningInfo /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal ManagedClusterPodIdentityProvisioningInfo() + /// Initializes a new instance of . + internal UpdateStatus() { } - /// Initializes a new instance of . - /// Pod identity assignment error (if any). + /// 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 ManagedClusterPodIdentityProvisioningInfo(ManagedClusterPodIdentityProvisioningError error, IDictionary serializedAdditionalRawData) + internal UpdateStatus(DateTimeOffset? startOn, DateTimeOffset? completedOn, UpdateState? state, ResponseError error, IDictionary serializedAdditionalRawData) { + StartOn = startOn; + CompletedOn = completedOn; + State = state; Error = error; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Pod identity assignment error (if any). - internal ManagedClusterPodIdentityProvisioningError Error { get; } - /// Details about the error. - public ResponseError ErrorDetail - { - get => Error?.ErrorDetail; - } + /// 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/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpgradeChannel.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpgradeChannel.cs deleted file mode 100644 index 05c1acfd44e40..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpgradeChannel.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// For more information see [setting the AKS cluster auto-upgrade channel](https://docs.microsoft.com/azure/aks/upgrade-cluster#set-auto-upgrade-channel). - 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 RapidValue = "rapid"; - private const string StableValue = "stable"; - private const string PatchValue = "patch"; - private const string NodeImageValue = "node-image"; - private const string NoneValue = "none"; - - /// Automatically upgrade the cluster to the latest supported patch release on the latest supported minor version. In cases where the cluster is at a version of Kubernetes that is at an N-2 minor version where N is the latest supported minor version, the cluster first upgrades to the latest supported patch version on N-1 minor version. For example, if a cluster is running version 1.17.7 and versions 1.17.9, 1.18.4, 1.18.6, and 1.19.1 are available, your cluster first is upgraded to 1.18.6, then is upgraded to 1.19.1. - public static UpgradeChannel Rapid { get; } = new UpgradeChannel(RapidValue); - /// Automatically upgrade the cluster to the latest supported patch release on minor version N-1, where N is the latest supported minor version. For example, if a cluster is running version 1.17.7 and versions 1.17.9, 1.18.4, 1.18.6, and 1.19.1 are available, your cluster is upgraded to 1.18.6. - public static UpgradeChannel Stable { get; } = new UpgradeChannel(StableValue); - /// Automatically upgrade the cluster to the latest supported patch version when it becomes available while keeping the minor version the same. For example, if a cluster is running version 1.17.7 and versions 1.17.9, 1.18.4, 1.18.6, and 1.19.1 are available, your cluster is upgraded to 1.17.9. - public static UpgradeChannel Patch { get; } = new UpgradeChannel(PatchValue); - /// Automatically upgrade the node image to the latest version available. Consider using nodeOSUpgradeChannel instead as that allows you to configure node OS patching separate from Kubernetes version patching. - public static UpgradeChannel NodeImage { get; } = new UpgradeChannel(NodeImageValue); - /// Disables auto-upgrades and keeps the cluster at its current version of Kubernetes. - public static UpgradeChannel None { get; } = new UpgradeChannel(NoneValue); - /// 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 string 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?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpgradeOverrideSettings.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/WaitStatus.Serialization.cs similarity index 55% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpgradeOverrideSettings.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/WaitStatus.Serialization.cs index ab2e26b150656..92390a8a51f93 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpgradeOverrideSettings.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/WaitStatus.Serialization.cs @@ -13,28 +13,28 @@ namespace Azure.ResourceManager.ContainerService.Models { - public partial class UpgradeOverrideSettings : IUtf8JsonSerializable, IJsonModel + public partial class WaitStatus : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(UpgradeOverrideSettings)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(WaitStatus)} does not support '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(ForceUpgrade)) + if (options.Format != "W" && Optional.IsDefined(Status)) { - writer.WritePropertyName("forceUpgrade"u8); - writer.WriteBooleanValue(ForceUpgrade.Value); + writer.WritePropertyName("status"u8); + writer.WriteObjectValue(Status); } - if (Optional.IsDefined(Until)) + if (options.Format != "W" && Optional.IsDefined(WaitDurationInSeconds)) { - writer.WritePropertyName("until"u8); - writer.WriteStringValue(Until.Value, "O"); + writer.WritePropertyName("waitDurationInSeconds"u8); + writer.WriteNumberValue(WaitDurationInSeconds.Value); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -54,19 +54,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade writer.WriteEndObject(); } - UpgradeOverrideSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + WaitStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(UpgradeOverrideSettings)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(WaitStatus)} does not support '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeUpgradeOverrideSettings(document.RootElement, options); + return DeserializeWaitStatus(document.RootElement, options); } - internal static UpgradeOverrideSettings DeserializeUpgradeOverrideSettings(JsonElement element, ModelReaderWriterOptions options = null) + internal static WaitStatus DeserializeWaitStatus(JsonElement element, ModelReaderWriterOptions options = null) { options ??= new ModelReaderWriterOptions("W"); @@ -74,28 +74,28 @@ internal static UpgradeOverrideSettings DeserializeUpgradeOverrideSettings(JsonE { return null; } - Optional forceUpgrade = default; - Optional until = default; + Optional status = default; + Optional waitDurationInSeconds = default; IDictionary serializedAdditionalRawData = default; Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("forceUpgrade"u8)) + if (property.NameEquals("status"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - forceUpgrade = property.Value.GetBoolean(); + status = UpdateStatus.DeserializeUpdateStatus(property.Value); continue; } - if (property.NameEquals("until"u8)) + if (property.NameEquals("waitDurationInSeconds"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - until = property.Value.GetDateTimeOffset("O"); + waitDurationInSeconds = property.Value.GetInt32(); continue; } if (options.Format != "W") @@ -104,38 +104,38 @@ internal static UpgradeOverrideSettings DeserializeUpgradeOverrideSettings(JsonE } } serializedAdditionalRawData = additionalPropertiesDictionary; - return new UpgradeOverrideSettings(Optional.ToNullable(forceUpgrade), Optional.ToNullable(until), serializedAdditionalRawData); + return new WaitStatus(status.Value, Optional.ToNullable(waitDurationInSeconds), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + 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(UpgradeOverrideSettings)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(WaitStatus)} does not support '{options.Format}' format."); } } - UpgradeOverrideSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + WaitStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeUpgradeOverrideSettings(document.RootElement, options); + return DeserializeWaitStatus(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(UpgradeOverrideSettings)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(WaitStatus)} does not support '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshRevisionProfileProperties.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/WaitStatus.cs similarity index 66% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshRevisionProfileProperties.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/WaitStatus.cs index 36dcb33146c4d..b03e4153a30af 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshRevisionProfileProperties.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/WaitStatus.cs @@ -7,12 +7,11 @@ using System; using System.Collections.Generic; -using Azure.Core; namespace Azure.ResourceManager.ContainerService.Models { - /// Mesh revision profile properties for a mesh. - internal partial class MeshRevisionProfileProperties + /// The status of the wait duration. + public partial class WaitStatus { /// /// Keeps track of any properties unknown to the library. @@ -46,22 +45,25 @@ internal partial class MeshRevisionProfileProperties /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public MeshRevisionProfileProperties() + /// Initializes a new instance of . + internal WaitStatus() { - MeshRevisions = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// + /// 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 MeshRevisionProfileProperties(IList meshRevisions, IDictionary serializedAdditionalRawData) + internal WaitStatus(UpdateStatus status, int? waitDurationInSeconds, IDictionary serializedAdditionalRawData) { - MeshRevisions = meshRevisions; + Status = status; + WaitDurationInSeconds = waitDurationInSeconds; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Gets the mesh revisions. - public IList MeshRevisions { get; } + /// The status of the wait duration. + public UpdateStatus Status { get; } + /// The wait duration configured in seconds. + public int? WaitDurationInSeconds { get; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/WindowsGmsaProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/WindowsGmsaProfile.Serialization.cs deleted file mode 100644 index a20706493e647..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/WindowsGmsaProfile.Serialization.cs +++ /dev/null @@ -1,148 +0,0 @@ -// 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.ContainerService.Models -{ - public partial class WindowsGmsaProfile : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(WindowsGmsaProfile)} does not support '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(IsEnabled)) - { - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(IsEnabled.Value); - } - if (Optional.IsDefined(DnsServer)) - { - writer.WritePropertyName("dnsServer"u8); - writer.WriteStringValue(DnsServer); - } - if (Optional.IsDefined(RootDomainName)) - { - writer.WritePropertyName("rootDomainName"u8); - writer.WriteStringValue(RootDomainName); - } - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - WindowsGmsaProfile 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(WindowsGmsaProfile)} does not support '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeWindowsGmsaProfile(document.RootElement, options); - } - - internal static WindowsGmsaProfile DeserializeWindowsGmsaProfile(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= new ModelReaderWriterOptions("W"); - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional enabled = default; - Optional dnsServer = default; - Optional rootDomainName = default; - IDictionary serializedAdditionalRawData = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("enabled"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("dnsServer"u8)) - { - dnsServer = property.Value.GetString(); - continue; - } - if (property.NameEquals("rootDomainName"u8)) - { - rootDomainName = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = additionalPropertiesDictionary; - return new WindowsGmsaProfile(Optional.ToNullable(enabled), dnsServer.Value, rootDomainName.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(WindowsGmsaProfile)} does not support '{options.Format}' format."); - } - } - - WindowsGmsaProfile 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); - return DeserializeWindowsGmsaProfile(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(WindowsGmsaProfile)} does not support '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/WindowsGmsaProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/WindowsGmsaProfile.cs deleted file mode 100644 index 8b9918756a594..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/WindowsGmsaProfile.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Windows gMSA Profile in the managed cluster. - public partial class WindowsGmsaProfile - { - /// - /// 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 WindowsGmsaProfile() - { - } - - /// Initializes a new instance of . - /// Specifies whether to enable Windows gMSA in the managed cluster. - /// Specifies the DNS server for Windows gMSA. <br><br> Set it to empty if you have configured the DNS server in the vnet which is used to create the managed cluster. - /// Specifies the root domain name for Windows gMSA. <br><br> Set it to empty if you have configured the DNS server in the vnet which is used to create the managed cluster. - /// Keeps track of any properties unknown to the library. - internal WindowsGmsaProfile(bool? isEnabled, string dnsServer, string rootDomainName, IDictionary serializedAdditionalRawData) - { - IsEnabled = isEnabled; - DnsServer = dnsServer; - RootDomainName = rootDomainName; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Specifies whether to enable Windows gMSA in the managed cluster. - public bool? IsEnabled { get; set; } - /// Specifies the DNS server for Windows gMSA. <br><br> Set it to empty if you have configured the DNS server in the vnet which is used to create the managed cluster. - public string DnsServer { get; set; } - /// Specifies the root domain name for Windows gMSA. <br><br> Set it to empty if you have configured the DNS server in the vnet which is used to create the managed cluster. - public string RootDomainName { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/WindowsVmLicenseType.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/WindowsVmLicenseType.cs deleted file mode 100644 index 285ff96ad88da..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/WindowsVmLicenseType.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The license type to use for Windows VMs. See [Azure Hybrid User Benefits](https://azure.microsoft.com/pricing/hybrid-benefit/faq/) for more details. - public readonly partial struct WindowsVmLicenseType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public WindowsVmLicenseType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string NoneValue = "None"; - private const string WindowsServerValue = "Windows_Server"; - - /// No additional licensing is applied. - public static WindowsVmLicenseType None { get; } = new WindowsVmLicenseType(NoneValue); - /// Enables Azure Hybrid User Benefits for Windows VMs. - public static WindowsVmLicenseType WindowsServer { get; } = new WindowsVmLicenseType(WindowsServerValue); - /// Determines if two values are the same. - public static bool operator ==(WindowsVmLicenseType left, WindowsVmLicenseType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(WindowsVmLicenseType left, WindowsVmLicenseType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator WindowsVmLicenseType(string value) => new WindowsVmLicenseType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is WindowsVmLicenseType other && Equals(other); - /// - public bool Equals(WindowsVmLicenseType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/WorkloadRuntime.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/WorkloadRuntime.cs deleted file mode 100644 index ebadd6cd4e20d..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/WorkloadRuntime.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Determines the type of workload a node can run. - public readonly partial struct WorkloadRuntime : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public WorkloadRuntime(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string OciContainerValue = "OCIContainer"; - private const string WasmWasiValue = "WasmWasi"; - - /// Nodes will use Kubelet to run standard OCI container workloads. - public static WorkloadRuntime OciContainer { get; } = new WorkloadRuntime(OciContainerValue); - /// Nodes will use Krustlet to run WASM workloads using the WASI provider (Preview). - public static WorkloadRuntime WasmWasi { get; } = new WorkloadRuntime(WasmWasiValue); - /// Determines if two values are the same. - public static bool operator ==(WorkloadRuntime left, WorkloadRuntime right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(WorkloadRuntime left, WorkloadRuntime right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator WorkloadRuntime(string value) => new WorkloadRuntime(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is WorkloadRuntime other && Equals(other); - /// - public bool Equals(WorkloadRuntime other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/OSOptionProfileData.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/OSOptionProfileData.cs deleted file mode 100644 index 8613a9ee44103..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/OSOptionProfileData.cs +++ /dev/null @@ -1,86 +0,0 @@ -// 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.ContainerService.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// A class representing the OSOptionProfile data model. - /// The OS option profile. - /// - public partial class OSOptionProfileData : 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 . - /// The list of OS options. - /// is null. - internal OSOptionProfileData(IEnumerable osOptionPropertyList) - { - Argument.AssertNotNull(osOptionPropertyList, nameof(osOptionPropertyList)); - - OSOptionPropertyList = osOptionPropertyList.ToList(); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The list of OS options. - /// Keeps track of any properties unknown to the library. - internal OSOptionProfileData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IReadOnlyList osOptionPropertyList, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) - { - OSOptionPropertyList = osOptionPropertyList; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal OSOptionProfileData() - { - } - - /// The list of OS options. - public IReadOnlyList OSOptionPropertyList { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/OSOptionProfileResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/OSOptionProfileResource.cs deleted file mode 100644 index e4af7499f818a..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/OSOptionProfileResource.cs +++ /dev/null @@ -1,174 +0,0 @@ -// 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; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// A Class representing an OSOptionProfile 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 GetOSOptionProfileResource method. - /// Otherwise you can get one from its parent resource using the GetOSOptionProfile method. - /// - public partial class OSOptionProfileResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The location. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, AzureLocation location) - { - var resourceId = $"/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _osOptionProfileManagedClustersClientDiagnostics; - private readonly ManagedClustersRestOperations _osOptionProfileManagedClustersRestClient; - private readonly OSOptionProfileData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.ContainerService/locations/osOptions"; - - /// Initializes a new instance of the class for mocking. - protected OSOptionProfileResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal OSOptionProfileResource(ArmClient client, OSOptionProfileData 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 OSOptionProfileResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _osOptionProfileManagedClustersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string osOptionProfileManagedClustersApiVersion); - _osOptionProfileManagedClustersRestClient = new ManagedClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, osOptionProfileManagedClustersApiVersion); -#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 OSOptionProfileData 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 supported OS options in the specified subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default - /// - /// - /// Operation Id - /// ManagedClusters_GetOSOptions - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The resource type for which the OS options needs to be returned. - /// The cancellation token to use. - public virtual async Task> GetAsync(ResourceType? resourceType = null, CancellationToken cancellationToken = default) - { - using var scope = _osOptionProfileManagedClustersClientDiagnostics.CreateScope("OSOptionProfileResource.Get"); - scope.Start(); - try - { - var response = await _osOptionProfileManagedClustersRestClient.GetOSOptionsAsync(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), resourceType, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new OSOptionProfileResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets supported OS options in the specified subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default - /// - /// - /// Operation Id - /// ManagedClusters_GetOSOptions - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The resource type for which the OS options needs to be returned. - /// The cancellation token to use. - public virtual Response Get(ResourceType? resourceType = null, CancellationToken cancellationToken = default) - { - using var scope = _osOptionProfileManagedClustersClientDiagnostics.CreateScope("OSOptionProfileResource.Get"); - scope.Start(); - try - { - var response = _osOptionProfileManagedClustersRestClient.GetOSOptions(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), resourceType, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new OSOptionProfileResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/FleetMembersRestOperations.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/FleetMembersRestOperations.cs new file mode 100644 index 0000000000000..6666718966684 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/FleetMembersRestOperations.cs @@ -0,0 +1,553 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ContainerService.Models; + +namespace Azure.ResourceManager.ContainerService +{ + 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. + /// server parameter. + /// Api Version. + /// 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 ?? "2024-02-02-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + 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 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, default, 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 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); + value = FleetMemberListResult.DeserializeFleetMemberListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + 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 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, default, 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 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); + 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 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); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a FleetMember. + /// The ID of the target subscription. + /// 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 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 HttpMessage CreateUpdateRequest(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); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update a FleetMember. + /// The ID of the target subscription. + /// 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 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 = CreateUpdateRequest(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 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 Update(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 = CreateUpdateRequest(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 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 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 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 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 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, default, 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 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); + value = FleetMemberListResult.DeserializeFleetMemberListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/TrustedAccessRoleBindingsRestOperations.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/FleetUpdateStrategiesRestOperations.cs similarity index 58% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/TrustedAccessRoleBindingsRestOperations.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/FleetUpdateStrategiesRestOperations.cs index 76af18999406c..743a0515791ae 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/TrustedAccessRoleBindingsRestOperations.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/FleetUpdateStrategiesRestOperations.cs @@ -16,28 +16,28 @@ namespace Azure.ResourceManager.ContainerService { - internal partial class TrustedAccessRoleBindingsRestOperations + 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 TrustedAccessRoleBindingsRestOperations. + /// 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. /// server parameter. /// Api Version. /// or is null. - public TrustedAccessRoleBindingsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + 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 ?? "2023-10-01"; + _apiVersion = apiVersion ?? "2024-02-02-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string resourceName) + internal HttpMessage CreateListByFleetRequest(string subscriptionId, string resourceGroupName, string fleetName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -48,9 +48,9 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/trustedAccessRoleBindings", false); + 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"); @@ -58,28 +58,28 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro return message; } - /// List trusted access role bindings. - /// The ID of the target subscription. The value must be an UUID. + /// List FleetUpdateStrategy resources by Fleet. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. + /// 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> ListAsync(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + /// , 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(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, resourceName); + using var message = CreateListByFleetRequest(subscriptionId, resourceGroupName, fleetName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - TrustedAccessRoleBindingListResult value = default; + FleetUpdateStrategyListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = TrustedAccessRoleBindingListResult.DeserializeTrustedAccessRoleBindingListResult(document.RootElement); + value = FleetUpdateStrategyListResult.DeserializeFleetUpdateStrategyListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -87,28 +87,28 @@ public async Task> ListAsync(string } } - /// List trusted access role bindings. - /// The ID of the target subscription. The value must be an UUID. + /// List FleetUpdateStrategy resources by Fleet. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. + /// 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 List(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + /// , 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(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, resourceName); + using var message = CreateListByFleetRequest(subscriptionId, resourceGroupName, fleetName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - TrustedAccessRoleBindingListResult value = default; + FleetUpdateStrategyListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = TrustedAccessRoleBindingListResult.DeserializeTrustedAccessRoleBindingListResult(document.RootElement); + value = FleetUpdateStrategyListResult.DeserializeFleetUpdateStrategyListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -116,7 +116,7 @@ public Response List(string subscriptionId, } } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string resourceName, string trustedAccessRoleBindingName) + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string fleetName, string updateStrategyName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -127,10 +127,10 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/trustedAccessRoleBindings/", false); - uri.AppendPath(trustedAccessRoleBindingName, 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"); @@ -138,73 +138,73 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou return message; } - /// Get a trusted access role binding. - /// The ID of the target subscription. The value must be an UUID. + /// Get a FleetUpdateStrategy. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The name of trusted access role binding. + /// 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 resourceName, string trustedAccessRoleBindingName, CancellationToken cancellationToken = default) + /// , , 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(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(trustedAccessRoleBindingName, nameof(trustedAccessRoleBindingName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateStrategyName, nameof(updateStrategyName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, trustedAccessRoleBindingName); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, updateStrategyName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - ContainerServiceTrustedAccessRoleBindingData value = default; + FleetUpdateStrategyData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ContainerServiceTrustedAccessRoleBindingData.DeserializeContainerServiceTrustedAccessRoleBindingData(document.RootElement); + value = FleetUpdateStrategyData.DeserializeFleetUpdateStrategyData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((ContainerServiceTrustedAccessRoleBindingData)null, message.Response); + return Response.FromValue((FleetUpdateStrategyData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Get a trusted access role binding. - /// The ID of the target subscription. The value must be an UUID. + /// Get a FleetUpdateStrategy. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The name of trusted access role binding. + /// 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 resourceName, string trustedAccessRoleBindingName, CancellationToken cancellationToken = default) + /// , , 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(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(trustedAccessRoleBindingName, nameof(trustedAccessRoleBindingName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateStrategyName, nameof(updateStrategyName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, trustedAccessRoleBindingName); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, updateStrategyName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - ContainerServiceTrustedAccessRoleBindingData value = default; + FleetUpdateStrategyData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ContainerServiceTrustedAccessRoleBindingData.DeserializeContainerServiceTrustedAccessRoleBindingData(document.RootElement); + value = FleetUpdateStrategyData.DeserializeFleetUpdateStrategyData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((ContainerServiceTrustedAccessRoleBindingData)null, message.Response); + return Response.FromValue((FleetUpdateStrategyData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string resourceName, string trustedAccessRoleBindingName, ContainerServiceTrustedAccessRoleBindingData data) + 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; @@ -215,12 +215,20 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/trustedAccessRoleBindings/", false); - uri.AppendPath(trustedAccessRoleBindingName, 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(); @@ -230,24 +238,26 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r return message; } - /// Create or update a trusted access role binding. - /// The ID of the target subscription. The value must be an UUID. + /// Create a FleetUpdateStrategy. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The name of trusted access role binding. - /// A trusted access role binding. + /// 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 resourceName, string trustedAccessRoleBindingName, ContainerServiceTrustedAccessRoleBindingData data, CancellationToken cancellationToken = default) + /// , , , 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(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(trustedAccessRoleBindingName, nameof(trustedAccessRoleBindingName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateStrategyName, nameof(updateStrategyName)); Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, resourceName, trustedAccessRoleBindingName, data); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, updateStrategyName, data, ifMatch, ifNoneMatch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -259,24 +269,26 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re } } - /// Create or update a trusted access role binding. - /// The ID of the target subscription. The value must be an UUID. + /// Create a FleetUpdateStrategy. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The name of trusted access role binding. - /// A trusted access role binding. + /// 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 resourceName, string trustedAccessRoleBindingName, ContainerServiceTrustedAccessRoleBindingData data, CancellationToken cancellationToken = default) + /// , , , 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(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(trustedAccessRoleBindingName, nameof(trustedAccessRoleBindingName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateStrategyName, nameof(updateStrategyName)); Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, resourceName, trustedAccessRoleBindingName, data); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, updateStrategyName, data, ifMatch, ifNoneMatch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -288,7 +300,7 @@ public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, } } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string resourceName, string trustedAccessRoleBindingName) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string fleetName, string updateStrategyName, string ifMatch) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -299,36 +311,42 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/trustedAccessRoleBindings/", false); - uri.AppendPath(trustedAccessRoleBindingName, 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 trusted access role binding. - /// The ID of the target subscription. The value must be an UUID. + /// Delete a FleetUpdateStrategy. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The name of trusted access role binding. + /// 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 resourceName, string trustedAccessRoleBindingName, CancellationToken cancellationToken = default) + /// , , 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(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(trustedAccessRoleBindingName, nameof(trustedAccessRoleBindingName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateStrategyName, nameof(updateStrategyName)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName, trustedAccessRoleBindingName); + 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; @@ -337,25 +355,27 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } } - /// Delete a trusted access role binding. - /// The ID of the target subscription. The value must be an UUID. + /// Delete a FleetUpdateStrategy. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The name of trusted access role binding. + /// 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 resourceName, string trustedAccessRoleBindingName, CancellationToken cancellationToken = default) + /// , , 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(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(trustedAccessRoleBindingName, nameof(trustedAccessRoleBindingName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateStrategyName, nameof(updateStrategyName)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName, trustedAccessRoleBindingName); + 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; @@ -364,7 +384,7 @@ public Response Delete(string subscriptionId, string resourceGroupName, string r } } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string resourceName) + internal HttpMessage CreateListByFleetNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string fleetName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -378,30 +398,30 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript return message; } - /// List trusted access role bindings. + /// 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 ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. + /// 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> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + /// , , 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(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, resourceName); + using var message = CreateListByFleetNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - TrustedAccessRoleBindingListResult value = default; + FleetUpdateStrategyListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = TrustedAccessRoleBindingListResult.DeserializeTrustedAccessRoleBindingListResult(document.RootElement); + value = FleetUpdateStrategyListResult.DeserializeFleetUpdateStrategyListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -409,30 +429,30 @@ public async Task> ListNextPageAsyn } } - /// List trusted access role bindings. + /// 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 ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. + /// 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 ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + /// , , 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(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, resourceName); + using var message = CreateListByFleetNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - TrustedAccessRoleBindingListResult value = default; + FleetUpdateStrategyListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = TrustedAccessRoleBindingListResult.DeserializeTrustedAccessRoleBindingListResult(document.RootElement); + value = FleetUpdateStrategyListResult.DeserializeFleetUpdateStrategyListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/SnapshotsRestOperations.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/FleetsRestOperations.cs similarity index 62% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/SnapshotsRestOperations.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/FleetsRestOperations.cs index c38aee9795e96..a55ca9dd2e2be 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/SnapshotsRestOperations.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/FleetsRestOperations.cs @@ -16,28 +16,28 @@ namespace Azure.ResourceManager.ContainerService { - internal partial class SnapshotsRestOperations + 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 SnapshotsRestOperations. + /// 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. /// server parameter. /// Api Version. /// or is null. - public SnapshotsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + 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 ?? "2023-10-01"; + _apiVersion = apiVersion ?? "2024-02-02-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal HttpMessage CreateListRequest(string subscriptionId) + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -46,7 +46,7 @@ internal HttpMessage CreateListRequest(string subscriptionId) uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ContainerService/snapshots", false); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -54,24 +54,24 @@ internal HttpMessage CreateListRequest(string subscriptionId) return message; } - /// Gets a list of snapshots in the specified subscription. - /// The ID of the target subscription. The value must be an UUID. + /// Lists fleets in the specified subscription. + /// The ID of the target subscription. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, CancellationToken cancellationToken = default) + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - using var message = CreateListRequest(subscriptionId); + using var message = CreateListBySubscriptionRequest(subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - AgentPoolSnapshotListResult value = default; + FleetListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AgentPoolSnapshotListResult.DeserializeAgentPoolSnapshotListResult(document.RootElement); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -79,24 +79,24 @@ public async Task> ListAsync(string subscr } } - /// Gets a list of snapshots in the specified subscription. - /// The ID of the target subscription. The value must be an UUID. + /// Lists fleets in the specified subscription. + /// The ID of the target subscription. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, CancellationToken cancellationToken = default) + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - using var message = CreateListRequest(subscriptionId); + using var message = CreateListBySubscriptionRequest(subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - AgentPoolSnapshotListResult value = default; + FleetListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AgentPoolSnapshotListResult.DeserializeAgentPoolSnapshotListResult(document.RootElement); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -115,7 +115,7 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/snapshots", false); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -123,13 +123,13 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str return message; } - /// Lists snapshots in the specified subscription and resource group. - /// The ID of the target subscription. The value must be an UUID. + /// Lists fleets in the specified subscription and resource group. + /// The ID of the target subscription. /// 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) + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -140,9 +140,9 @@ public async Task> ListByResourceGroupAsyn { case 200: { - AgentPoolSnapshotListResult value = default; + FleetListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AgentPoolSnapshotListResult.DeserializeAgentPoolSnapshotListResult(document.RootElement); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -150,13 +150,13 @@ public async Task> ListByResourceGroupAsyn } } - /// Lists snapshots in the specified subscription and resource group. - /// The ID of the target subscription. The value must be an UUID. + /// Lists fleets in the specified subscription and resource group. + /// The ID of the target subscription. /// 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) + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -167,9 +167,9 @@ public Response ListByResourceGroup(string subscrip { case 200: { - AgentPoolSnapshotListResult value = default; + FleetListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AgentPoolSnapshotListResult.DeserializeAgentPoolSnapshotListResult(document.RootElement); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -177,7 +177,7 @@ public Response ListByResourceGroup(string subscrip } } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string resourceName) + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string fleetName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -188,8 +188,8 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/snapshots/", false); - uri.AppendPath(resourceName, 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"); @@ -197,69 +197,69 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou return message; } - /// Gets a snapshot. - /// The ID of the target subscription. The value must be an UUID. + /// Gets a Fleet. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. + /// 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 resourceName, CancellationToken cancellationToken = default) + /// , 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(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - AgentPoolSnapshotData value = default; + FleetData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AgentPoolSnapshotData.DeserializeAgentPoolSnapshotData(document.RootElement); + value = FleetData.DeserializeFleetData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((AgentPoolSnapshotData)null, message.Response); + return Response.FromValue((FleetData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Gets a snapshot. - /// The ID of the target subscription. The value must be an UUID. + /// Gets a Fleet. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. + /// 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 resourceName, CancellationToken cancellationToken = default) + /// , 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(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - AgentPoolSnapshotData value = default; + FleetData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AgentPoolSnapshotData.DeserializeAgentPoolSnapshotData(document.RootElement); + value = FleetData.DeserializeFleetData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((AgentPoolSnapshotData)null, message.Response); + return Response.FromValue((FleetData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string resourceName, AgentPoolSnapshotData data) + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string fleetName, FleetData data, string ifMatch, string ifNoneMatch) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -270,10 +270,18 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/snapshots/", false); - uri.AppendPath(resourceName, 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(); @@ -283,71 +291,65 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r return message; } - /// Creates or updates a snapshot. - /// The ID of the target subscription. The value must be an UUID. + /// Creates or updates a Fleet. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The snapshot to create or update. + /// 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> CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string resourceName, AgentPoolSnapshotData data, CancellationToken cancellationToken = default) + /// , , 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, FleetData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, resourceName, data); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, data, ifMatch, ifNoneMatch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: case 201: - { - AgentPoolSnapshotData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AgentPoolSnapshotData.DeserializeAgentPoolSnapshotData(document.RootElement); - return Response.FromValue(value, message.Response); - } + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Creates or updates a snapshot. - /// The ID of the target subscription. The value must be an UUID. + /// Creates or updates a Fleet. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The snapshot to create or update. + /// 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 CreateOrUpdate(string subscriptionId, string resourceGroupName, string resourceName, AgentPoolSnapshotData data, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(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(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, resourceName, data); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, data, ifMatch, ifNoneMatch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: case 201: - { - AgentPoolSnapshotData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AgentPoolSnapshotData.DeserializeAgentPoolSnapshotData(document.RootElement); - return Response.FromValue(value, message.Response); - } + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal HttpMessage CreateUpdateTagsRequest(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceTagsObject containerServiceTagsObject) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string fleetName, FleetPatch patch, string ifMatch) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -358,82 +360,80 @@ internal HttpMessage CreateUpdateTagsRequest(string subscriptionId, string resou uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/snapshots/", false); - uri.AppendPath(resourceName, 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(containerServiceTagsObject); + content.JsonWriter.WriteObjectValue(patch); request.Content = content; _userAgent.Apply(message); return message; } - /// Updates tags on a snapshot. - /// The ID of the target subscription. The value must be an UUID. + /// Update a Fleet. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// Parameters supplied to the Update snapshot Tags operation. + /// 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> UpdateTagsAsync(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceTagsObject containerServiceTagsObject, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task 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(resourceName, nameof(resourceName)); - Argument.AssertNotNull(containerServiceTagsObject, nameof(containerServiceTagsObject)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateTagsRequest(subscriptionId, resourceGroupName, resourceName, containerServiceTagsObject); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, fleetName, patch, ifMatch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - AgentPoolSnapshotData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AgentPoolSnapshotData.DeserializeAgentPoolSnapshotData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Updates tags on a snapshot. - /// The ID of the target subscription. The value must be an UUID. + /// Update a Fleet. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// Parameters supplied to the Update snapshot Tags operation. + /// 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 UpdateTags(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceTagsObject containerServiceTagsObject, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(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(resourceName, nameof(resourceName)); - Argument.AssertNotNull(containerServiceTagsObject, nameof(containerServiceTagsObject)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateTagsRequest(subscriptionId, resourceGroupName, resourceName, containerServiceTagsObject); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, fleetName, patch, ifMatch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - AgentPoolSnapshotData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AgentPoolSnapshotData.DeserializeAgentPoolSnapshotData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string resourceName) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string fleetName, string ifMatch) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -444,33 +444,39 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/snapshots/", false); - uri.AppendPath(resourceName, 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; } - /// Deletes a snapshot. - /// The ID of the target subscription. The value must be an UUID. + /// Delete a Fleet. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. + /// 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 resourceName, CancellationToken cancellationToken = default) + /// , 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(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName); + 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: @@ -478,24 +484,26 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } } - /// Deletes a snapshot. - /// The ID of the target subscription. The value must be an UUID. + /// Delete a Fleet. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. + /// 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 resourceName, CancellationToken cancellationToken = default) + /// , 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(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName); + 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: @@ -503,7 +511,86 @@ public Response Delete(string subscriptionId, string resourceGroupName, string r } } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId) + 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 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, default, 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 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); + value = FleetCredentialResults.DeserializeFleetCredentialResults(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -517,26 +604,26 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript return message; } - /// Gets a list of snapshots in the specified subscription. + /// 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 ID of the target subscription. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - AgentPoolSnapshotListResult value = default; + FleetListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AgentPoolSnapshotListResult.DeserializeAgentPoolSnapshotListResult(document.RootElement); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -544,26 +631,26 @@ public async Task> ListNextPageAsync(strin } } - /// Gets a list of snapshots in the specified subscription. + /// 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 ID of the target subscription. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - AgentPoolSnapshotListResult value = default; + FleetListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AgentPoolSnapshotListResult.DeserializeAgentPoolSnapshotListResult(document.RootElement); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -585,14 +672,14 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s return message; } - /// Lists snapshots in the specified subscription and resource group. + /// 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 ID of the target subscription. /// 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) + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -604,9 +691,9 @@ public async Task> ListByResourceGroupNext { case 200: { - AgentPoolSnapshotListResult value = default; + FleetListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AgentPoolSnapshotListResult.DeserializeAgentPoolSnapshotListResult(document.RootElement); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -614,14 +701,14 @@ public async Task> ListByResourceGroupNext } } - /// Lists snapshots in the specified subscription and resource group. + /// 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 ID of the target subscription. /// 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) + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -633,9 +720,9 @@ public Response ListByResourceGroupNextPage(string { case 200: { - AgentPoolSnapshotListResult value = default; + FleetListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AgentPoolSnapshotListResult.DeserializeAgentPoolSnapshotListResult(document.RootElement); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/MaintenanceConfigurationsRestOperations.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/MaintenanceConfigurationsRestOperations.cs deleted file mode 100644 index 2d63b27756c48..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/MaintenanceConfigurationsRestOperations.cs +++ /dev/null @@ -1,453 +0,0 @@ -// 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; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.ContainerService.Models; - -namespace Azure.ResourceManager.ContainerService -{ - internal partial class MaintenanceConfigurationsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of MaintenanceConfigurationsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public MaintenanceConfigurationsRestOperations(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 ?? "2023-10-01"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListByManagedClusterRequest(string subscriptionId, string resourceGroupName, string resourceName) - { - 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/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/maintenanceConfigurations", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets a list of maintenance configurations in the specified managed cluster. - /// 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 managed cluster resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByManagedClusterAsync(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListByManagedClusterRequest(subscriptionId, resourceGroupName, resourceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ContainerServiceMaintenanceConfigurationListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ContainerServiceMaintenanceConfigurationListResult.DeserializeContainerServiceMaintenanceConfigurationListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets a list of maintenance configurations in the specified managed cluster. - /// 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 managed cluster resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListByManagedCluster(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListByManagedClusterRequest(subscriptionId, resourceGroupName, resourceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ContainerServiceMaintenanceConfigurationListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ContainerServiceMaintenanceConfigurationListResult.DeserializeContainerServiceMaintenanceConfigurationListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string resourceName, string configName) - { - 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/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/maintenanceConfigurations/", false); - uri.AppendPath(configName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets the specified maintenance configuration of a managed cluster. - /// 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 managed cluster resource. - /// The name of the maintenance configuration. - /// 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 resourceName, string configName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(configName, nameof(configName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, configName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ContainerServiceMaintenanceConfigurationData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ContainerServiceMaintenanceConfigurationData.DeserializeContainerServiceMaintenanceConfigurationData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ContainerServiceMaintenanceConfigurationData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets the specified maintenance configuration of a managed cluster. - /// 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 managed cluster resource. - /// The name of the maintenance configuration. - /// 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 resourceName, string configName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(configName, nameof(configName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, configName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ContainerServiceMaintenanceConfigurationData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ContainerServiceMaintenanceConfigurationData.DeserializeContainerServiceMaintenanceConfigurationData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ContainerServiceMaintenanceConfigurationData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string resourceName, string configName, ContainerServiceMaintenanceConfigurationData data) - { - 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/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/maintenanceConfigurations/", false); - uri.AppendPath(configName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Creates or updates a maintenance configuration in the specified managed cluster. - /// 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 managed cluster resource. - /// The name of the maintenance configuration. - /// The maintenance configuration to create or update. - /// 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 resourceName, string configName, ContainerServiceMaintenanceConfigurationData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(configName, nameof(configName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, resourceName, configName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - { - ContainerServiceMaintenanceConfigurationData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ContainerServiceMaintenanceConfigurationData.DeserializeContainerServiceMaintenanceConfigurationData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Creates or updates a maintenance configuration in the specified managed cluster. - /// 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 managed cluster resource. - /// The name of the maintenance configuration. - /// The maintenance configuration to create or update. - /// 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 resourceName, string configName, ContainerServiceMaintenanceConfigurationData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(configName, nameof(configName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, resourceName, configName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - { - ContainerServiceMaintenanceConfigurationData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ContainerServiceMaintenanceConfigurationData.DeserializeContainerServiceMaintenanceConfigurationData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string resourceName, string configName) - { - 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/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/maintenanceConfigurations/", false); - uri.AppendPath(configName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Deletes a maintenance configuration. - /// 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 managed cluster resource. - /// The name of the maintenance configuration. - /// 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 resourceName, string configName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(configName, nameof(configName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName, configName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Deletes a maintenance configuration. - /// 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 managed cluster resource. - /// The name of the maintenance configuration. - /// 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 resourceName, string configName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(configName, nameof(configName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName, configName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByManagedClusterNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string resourceName) - { - 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; - } - - /// Gets a list of maintenance configurations in the specified managed cluster. - /// 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 managed cluster resource. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByManagedClusterNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListByManagedClusterNextPageRequest(nextLink, subscriptionId, resourceGroupName, resourceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ContainerServiceMaintenanceConfigurationListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ContainerServiceMaintenanceConfigurationListResult.DeserializeContainerServiceMaintenanceConfigurationListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets a list of maintenance configurations in the specified managed cluster. - /// 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 managed cluster resource. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListByManagedClusterNextPage(string nextLink, string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListByManagedClusterNextPageRequest(nextLink, subscriptionId, resourceGroupName, resourceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ContainerServiceMaintenanceConfigurationListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ContainerServiceMaintenanceConfigurationListResult.DeserializeContainerServiceMaintenanceConfigurationListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/ManagedClustersRestOperations.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/ManagedClustersRestOperations.cs deleted file mode 100644 index dbe0df9412a3c..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/ManagedClustersRestOperations.cs +++ /dev/null @@ -1,2506 +0,0 @@ -// 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; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.ContainerService.Models; - -namespace Azure.ResourceManager.ContainerService -{ - internal partial class ManagedClustersRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of ManagedClustersRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public ManagedClustersRestOperations(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 ?? "2023-10-01"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateGetOSOptionsRequest(string subscriptionId, AzureLocation location, ResourceType? resourceType) - { - 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/locations/", false); - uri.AppendPath(location, true); - uri.AppendPath("/osOptions/default", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (resourceType != null) - { - uri.AppendQuery("resource-type", resourceType.Value, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets supported OS options in the specified subscription. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the Azure region. - /// The resource type for which the OS options needs to be returned. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> GetOSOptionsAsync(string subscriptionId, AzureLocation location, ResourceType? resourceType = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateGetOSOptionsRequest(subscriptionId, location, resourceType); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - OSOptionProfileData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = OSOptionProfileData.DeserializeOSOptionProfileData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((OSOptionProfileData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets supported OS options in the specified subscription. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the Azure region. - /// The resource type for which the OS options needs to be returned. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response GetOSOptions(string subscriptionId, AzureLocation location, ResourceType? resourceType = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateGetOSOptionsRequest(subscriptionId, location, resourceType); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - OSOptionProfileData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = OSOptionProfileData.DeserializeOSOptionProfileData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((OSOptionProfileData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListKubernetesVersionsRequest(string subscriptionId, AzureLocation location) - { - 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/locations/", false); - uri.AppendPath(location, true); - uri.AppendPath("/kubernetesVersions", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Contains extra metadata on the version, including supported patch versions, capabilities, available upgrades, and details on preview status of the version. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the Azure region. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListKubernetesVersionsAsync(string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListKubernetesVersionsRequest(subscriptionId, location); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - KubernetesVersionListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = KubernetesVersionListResult.DeserializeKubernetesVersionListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Contains extra metadata on the version, including supported patch versions, capabilities, available upgrades, and details on preview status of the version. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the Azure region. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListKubernetesVersions(string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListKubernetesVersionsRequest(subscriptionId, location); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - KubernetesVersionListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = KubernetesVersionListResult.DeserializeKubernetesVersionListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListRequest(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/managedClusters", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets a list of managed clusters 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> ListAsync(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ManagedClusterListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ManagedClusterListResult.DeserializeManagedClusterListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets a list of managed clusters 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 List(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ManagedClusterListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ManagedClusterListResult.DeserializeManagedClusterListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - 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/managedClusters", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists managed clusters 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: - { - ManagedClusterListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ManagedClusterListResult.DeserializeManagedClusterListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists managed clusters 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: - { - ManagedClusterListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ManagedClusterListResult.DeserializeManagedClusterListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetUpgradeProfileRequest(string subscriptionId, string resourceGroupName, string resourceName) - { - 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/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/upgradeProfiles/default", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets the upgrade profile of a managed cluster. - /// 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 managed cluster resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> GetUpgradeProfileAsync(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateGetUpgradeProfileRequest(subscriptionId, resourceGroupName, resourceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ManagedClusterUpgradeProfileData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ManagedClusterUpgradeProfileData.DeserializeManagedClusterUpgradeProfileData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ManagedClusterUpgradeProfileData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets the upgrade profile of a managed cluster. - /// 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 managed cluster resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response GetUpgradeProfile(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateGetUpgradeProfileRequest(subscriptionId, resourceGroupName, resourceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ManagedClusterUpgradeProfileData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ManagedClusterUpgradeProfileData.DeserializeManagedClusterUpgradeProfileData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ManagedClusterUpgradeProfileData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetAccessProfileRequest(string subscriptionId, string resourceGroupName, string resourceName, string roleName) - { - 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/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/accessProfiles/", false); - uri.AppendPath(roleName, true); - uri.AppendPath("/listCredential", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// **WARNING**: This API will be deprecated. Instead use [ListClusterUserCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusterusercredentials) or [ListClusterAdminCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusteradmincredentials) . - /// 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 managed cluster resource. - /// The name of the role for managed cluster accessProfile resource. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAccessProfileAsync(string subscriptionId, string resourceGroupName, string resourceName, string roleName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(roleName, nameof(roleName)); - - using var message = CreateGetAccessProfileRequest(subscriptionId, resourceGroupName, resourceName, roleName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ManagedClusterAccessProfile value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ManagedClusterAccessProfile.DeserializeManagedClusterAccessProfile(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// **WARNING**: This API will be deprecated. Instead use [ListClusterUserCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusterusercredentials) or [ListClusterAdminCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusteradmincredentials) . - /// 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 managed cluster resource. - /// The name of the role for managed cluster accessProfile resource. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response GetAccessProfile(string subscriptionId, string resourceGroupName, string resourceName, string roleName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(roleName, nameof(roleName)); - - using var message = CreateGetAccessProfileRequest(subscriptionId, resourceGroupName, resourceName, roleName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ManagedClusterAccessProfile value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ManagedClusterAccessProfile.DeserializeManagedClusterAccessProfile(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListClusterAdminCredentialsRequest(string subscriptionId, string resourceGroupName, string resourceName, string serverFqdn) - { - 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/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/listClusterAdminCredential", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (serverFqdn != null) - { - uri.AppendQuery("server-fqdn", serverFqdn, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists the admin credentials of a managed cluster. - /// 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 managed cluster resource. - /// server fqdn type for credentials to be returned. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListClusterAdminCredentialsAsync(string subscriptionId, string resourceGroupName, string resourceName, string serverFqdn = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListClusterAdminCredentialsRequest(subscriptionId, resourceGroupName, resourceName, serverFqdn); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ManagedClusterCredentials value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ManagedClusterCredentials.DeserializeManagedClusterCredentials(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists the admin credentials of a managed cluster. - /// 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 managed cluster resource. - /// server fqdn type for credentials to be returned. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListClusterAdminCredentials(string subscriptionId, string resourceGroupName, string resourceName, string serverFqdn = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListClusterAdminCredentialsRequest(subscriptionId, resourceGroupName, resourceName, serverFqdn); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ManagedClusterCredentials value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ManagedClusterCredentials.DeserializeManagedClusterCredentials(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListClusterUserCredentialsRequest(string subscriptionId, string resourceGroupName, string resourceName, string serverFqdn, KubeConfigFormat? format) - { - 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/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/listClusterUserCredential", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (serverFqdn != null) - { - uri.AppendQuery("server-fqdn", serverFqdn, true); - } - if (format != null) - { - uri.AppendQuery("format", format.Value.ToString(), true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists the user credentials of a managed cluster. - /// 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 managed cluster resource. - /// server fqdn type for credentials to be returned. - /// Only apply to AAD clusters, specifies the format of returned kubeconfig. Format 'azure' will return azure auth-provider kubeconfig; format 'exec' will return exec format kubeconfig, which requires kubelogin binary in the path. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListClusterUserCredentialsAsync(string subscriptionId, string resourceGroupName, string resourceName, string serverFqdn = null, KubeConfigFormat? format = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListClusterUserCredentialsRequest(subscriptionId, resourceGroupName, resourceName, serverFqdn, format); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ManagedClusterCredentials value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ManagedClusterCredentials.DeserializeManagedClusterCredentials(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists the user credentials of a managed cluster. - /// 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 managed cluster resource. - /// server fqdn type for credentials to be returned. - /// Only apply to AAD clusters, specifies the format of returned kubeconfig. Format 'azure' will return azure auth-provider kubeconfig; format 'exec' will return exec format kubeconfig, which requires kubelogin binary in the path. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListClusterUserCredentials(string subscriptionId, string resourceGroupName, string resourceName, string serverFqdn = null, KubeConfigFormat? format = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListClusterUserCredentialsRequest(subscriptionId, resourceGroupName, resourceName, serverFqdn, format); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ManagedClusterCredentials value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ManagedClusterCredentials.DeserializeManagedClusterCredentials(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListClusterMonitoringUserCredentialsRequest(string subscriptionId, string resourceGroupName, string resourceName, string serverFqdn) - { - 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/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/listClusterMonitoringUserCredential", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (serverFqdn != null) - { - uri.AppendQuery("server-fqdn", serverFqdn, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists the cluster monitoring user credentials of a managed cluster. - /// 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 managed cluster resource. - /// server fqdn type for credentials to be returned. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListClusterMonitoringUserCredentialsAsync(string subscriptionId, string resourceGroupName, string resourceName, string serverFqdn = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListClusterMonitoringUserCredentialsRequest(subscriptionId, resourceGroupName, resourceName, serverFqdn); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ManagedClusterCredentials value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ManagedClusterCredentials.DeserializeManagedClusterCredentials(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists the cluster monitoring user credentials of a managed cluster. - /// 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 managed cluster resource. - /// server fqdn type for credentials to be returned. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListClusterMonitoringUserCredentials(string subscriptionId, string resourceGroupName, string resourceName, string serverFqdn = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListClusterMonitoringUserCredentialsRequest(subscriptionId, resourceGroupName, resourceName, serverFqdn); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ManagedClusterCredentials value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ManagedClusterCredentials.DeserializeManagedClusterCredentials(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string resourceName) - { - 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/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets a managed cluster. - /// 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 managed cluster 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 resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ContainerServiceManagedClusterData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ContainerServiceManagedClusterData.DeserializeContainerServiceManagedClusterData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ContainerServiceManagedClusterData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets a managed cluster. - /// 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 managed cluster 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 resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ContainerServiceManagedClusterData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ContainerServiceManagedClusterData.DeserializeContainerServiceManagedClusterData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ContainerServiceManagedClusterData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceManagedClusterData data) - { - 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/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Creates or updates a managed cluster. - /// 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 managed cluster resource. - /// The managed cluster to create or update. - /// 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 resourceName, ContainerServiceManagedClusterData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, resourceName, data); - 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 managed cluster. - /// 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 managed cluster resource. - /// The managed cluster to create or update. - /// 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 resourceName, ContainerServiceManagedClusterData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, resourceName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateTagsRequest(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceTagsObject containerServiceTagsObject) - { - 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/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(containerServiceTagsObject); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Updates tags on a managed cluster. - /// 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 managed cluster resource. - /// Parameters supplied to the Update Managed Cluster Tags operation. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task UpdateTagsAsync(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceTagsObject containerServiceTagsObject, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNull(containerServiceTagsObject, nameof(containerServiceTagsObject)); - - using var message = CreateUpdateTagsRequest(subscriptionId, resourceGroupName, resourceName, containerServiceTagsObject); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Updates tags on a managed cluster. - /// 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 managed cluster resource. - /// Parameters supplied to the Update Managed Cluster Tags operation. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response UpdateTags(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceTagsObject containerServiceTagsObject, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNull(containerServiceTagsObject, nameof(containerServiceTagsObject)); - - using var message = CreateUpdateTagsRequest(subscriptionId, resourceGroupName, resourceName, containerServiceTagsObject); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string resourceName) - { - 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/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Deletes a managed cluster. - /// 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 managed cluster resource. - /// 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 resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Deletes a managed cluster. - /// 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 managed cluster resource. - /// 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 resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateResetServicePrincipalProfileRequest(string subscriptionId, string resourceGroupName, string resourceName, ManagedClusterServicePrincipalProfile managedClusterServicePrincipalProfile) - { - 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/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/resetServicePrincipalProfile", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(managedClusterServicePrincipalProfile); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// This action cannot be performed on a cluster that is not using a service principal. - /// 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 managed cluster resource. - /// The service principal profile to set on the managed cluster. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task ResetServicePrincipalProfileAsync(string subscriptionId, string resourceGroupName, string resourceName, ManagedClusterServicePrincipalProfile managedClusterServicePrincipalProfile, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNull(managedClusterServicePrincipalProfile, nameof(managedClusterServicePrincipalProfile)); - - using var message = CreateResetServicePrincipalProfileRequest(subscriptionId, resourceGroupName, resourceName, managedClusterServicePrincipalProfile); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// This action cannot be performed on a cluster that is not using a service principal. - /// 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 managed cluster resource. - /// The service principal profile to set on the managed cluster. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ResetServicePrincipalProfile(string subscriptionId, string resourceGroupName, string resourceName, ManagedClusterServicePrincipalProfile managedClusterServicePrincipalProfile, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNull(managedClusterServicePrincipalProfile, nameof(managedClusterServicePrincipalProfile)); - - using var message = CreateResetServicePrincipalProfileRequest(subscriptionId, resourceGroupName, resourceName, managedClusterServicePrincipalProfile); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateResetAadProfileRequest(string subscriptionId, string resourceGroupName, string resourceName, ManagedClusterAadProfile managedClusterAadProfile) - { - 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/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/resetAADProfile", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(managedClusterAadProfile); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// **WARNING**: This API will be deprecated. Please see [AKS-managed Azure Active Directory integration](https://aka.ms/aks-managed-aad) to update your cluster with AKS-managed Azure AD. - /// 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 managed cluster resource. - /// The AAD profile to set on the Managed Cluster. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task ResetAadProfileAsync(string subscriptionId, string resourceGroupName, string resourceName, ManagedClusterAadProfile managedClusterAadProfile, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNull(managedClusterAadProfile, nameof(managedClusterAadProfile)); - - using var message = CreateResetAadProfileRequest(subscriptionId, resourceGroupName, resourceName, managedClusterAadProfile); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// **WARNING**: This API will be deprecated. Please see [AKS-managed Azure Active Directory integration](https://aka.ms/aks-managed-aad) to update your cluster with AKS-managed Azure AD. - /// 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 managed cluster resource. - /// The AAD profile to set on the Managed Cluster. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ResetAadProfile(string subscriptionId, string resourceGroupName, string resourceName, ManagedClusterAadProfile managedClusterAadProfile, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNull(managedClusterAadProfile, nameof(managedClusterAadProfile)); - - using var message = CreateResetAadProfileRequest(subscriptionId, resourceGroupName, resourceName, managedClusterAadProfile); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateRotateClusterCertificatesRequest(string subscriptionId, string resourceGroupName, string resourceName) - { - 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/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/rotateClusterCertificates", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about rotating managed cluster certificates. - /// 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 managed cluster resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task RotateClusterCertificatesAsync(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateRotateClusterCertificatesRequest(subscriptionId, resourceGroupName, resourceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about rotating managed cluster certificates. - /// 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 managed cluster resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response RotateClusterCertificates(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateRotateClusterCertificatesRequest(subscriptionId, resourceGroupName, resourceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateAbortLatestOperationRequest(string subscriptionId, string resourceGroupName, string resourceName) - { - 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/managedclusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/abort", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Aborts the currently running operation on the managed cluster. The Managed Cluster will be moved to a Canceling state and eventually to a Canceled state when cancellation finishes. If the operation completes before cancellation can take place, a 409 error code is returned. - /// 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 managed cluster resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task AbortLatestOperationAsync(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateAbortLatestOperationRequest(subscriptionId, resourceGroupName, resourceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Aborts the currently running operation on the managed cluster. The Managed Cluster will be moved to a Canceling state and eventually to a Canceled state when cancellation finishes. If the operation completes before cancellation can take place, a 409 error code is returned. - /// 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 managed cluster resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response AbortLatestOperation(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateAbortLatestOperationRequest(subscriptionId, resourceGroupName, resourceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateRotateServiceAccountSigningKeysRequest(string subscriptionId, string resourceGroupName, string resourceName) - { - 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/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/rotateServiceAccountSigningKeys", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Rotates the service account signing keys of a managed cluster. - /// 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 managed cluster resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task RotateServiceAccountSigningKeysAsync(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateRotateServiceAccountSigningKeysRequest(subscriptionId, resourceGroupName, resourceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Rotates the service account signing keys of a managed cluster. - /// 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 managed cluster resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response RotateServiceAccountSigningKeys(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateRotateServiceAccountSigningKeysRequest(subscriptionId, resourceGroupName, resourceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateStopRequest(string subscriptionId, string resourceGroupName, string resourceName) - { - 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/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/stop", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the control plane and agent nodes entirely, while maintaining all object and cluster state. A cluster does not accrue charges while it is stopped. See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about stopping a cluster. - /// 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 managed cluster resource. - /// 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 resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateStopRequest(subscriptionId, resourceGroupName, resourceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the control plane and agent nodes entirely, while maintaining all object and cluster state. A cluster does not accrue charges while it is stopped. See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about stopping a cluster. - /// 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 managed cluster resource. - /// 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 resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateStopRequest(subscriptionId, resourceGroupName, resourceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateStartRequest(string subscriptionId, string resourceGroupName, string resourceName) - { - 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/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/start", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting a cluster. - /// 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 managed cluster resource. - /// 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 resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateStartRequest(subscriptionId, resourceGroupName, resourceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting a cluster. - /// 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 managed cluster resource. - /// 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 resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateStartRequest(subscriptionId, resourceGroupName, resourceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateRunCommandRequest(string subscriptionId, string resourceGroupName, string resourceName, ManagedClusterRunCommandContent content) - { - 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/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/runCommand", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content); - request.Content = content0; - _userAgent.Apply(message); - return message; - } - - /// AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). - /// 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 managed cluster resource. - /// The run command request. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task RunCommandAsync(string subscriptionId, string resourceGroupName, string resourceName, ManagedClusterRunCommandContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateRunCommandRequest(subscriptionId, resourceGroupName, resourceName, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). - /// 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 managed cluster resource. - /// The run command request. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response RunCommand(string subscriptionId, string resourceGroupName, string resourceName, ManagedClusterRunCommandContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateRunCommandRequest(subscriptionId, resourceGroupName, resourceName, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetCommandResultRequest(string subscriptionId, string resourceGroupName, string resourceName, string commandId) - { - 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/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/commandResults/", false); - uri.AppendPath(commandId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets the results of a command which has been run on the Managed Cluster. - /// 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 managed cluster resource. - /// Id of the command. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetCommandResultAsync(string subscriptionId, string resourceGroupName, string resourceName, string commandId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(commandId, nameof(commandId)); - - using var message = CreateGetCommandResultRequest(subscriptionId, resourceGroupName, resourceName, commandId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ManagedClusterRunCommandResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ManagedClusterRunCommandResult.DeserializeManagedClusterRunCommandResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 202: - return Response.FromValue((ManagedClusterRunCommandResult)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets the results of a command which has been run on the Managed Cluster. - /// 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 managed cluster resource. - /// Id of the command. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response GetCommandResult(string subscriptionId, string resourceGroupName, string resourceName, string commandId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(commandId, nameof(commandId)); - - using var message = CreateGetCommandResultRequest(subscriptionId, resourceGroupName, resourceName, commandId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ManagedClusterRunCommandResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ManagedClusterRunCommandResult.DeserializeManagedClusterRunCommandResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 202: - return Response.FromValue((ManagedClusterRunCommandResult)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListOutboundNetworkDependenciesEndpointsRequest(string subscriptionId, string resourceGroupName, string resourceName) - { - 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/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/outboundNetworkDependenciesEndpoints", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. The operation returns properties of each egress endpoint. - /// 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 managed cluster resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListOutboundNetworkDependenciesEndpointsAsync(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListOutboundNetworkDependenciesEndpointsRequest(subscriptionId, resourceGroupName, resourceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - OutboundEnvironmentEndpointListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = OutboundEnvironmentEndpointListResult.DeserializeOutboundEnvironmentEndpointListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. The operation returns properties of each egress endpoint. - /// 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 managed cluster resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListOutboundNetworkDependenciesEndpoints(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListOutboundNetworkDependenciesEndpointsRequest(subscriptionId, resourceGroupName, resourceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - OutboundEnvironmentEndpointListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = OutboundEnvironmentEndpointListResult.DeserializeOutboundEnvironmentEndpointListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListMeshRevisionProfilesRequest(string subscriptionId, AzureLocation location) - { - 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/locations/", false); - uri.AppendPath(location, true); - uri.AppendPath("/meshRevisionProfiles", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Contains extra metadata on each revision, including supported revisions, cluster compatibility and available upgrades. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the Azure region. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListMeshRevisionProfilesAsync(string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListMeshRevisionProfilesRequest(subscriptionId, location); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - MeshRevisionProfileList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = MeshRevisionProfileList.DeserializeMeshRevisionProfileList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Contains extra metadata on each revision, including supported revisions, cluster compatibility and available upgrades. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the Azure region. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListMeshRevisionProfiles(string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListMeshRevisionProfilesRequest(subscriptionId, location); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - MeshRevisionProfileList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = MeshRevisionProfileList.DeserializeMeshRevisionProfileList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetMeshRevisionProfileRequest(string subscriptionId, AzureLocation location, string mode) - { - 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/locations/", false); - uri.AppendPath(location, true); - uri.AppendPath("/meshRevisionProfiles/", false); - uri.AppendPath(mode, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Contains extra metadata on the revision, including supported revisions, cluster compatibility and available upgrades. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the Azure region. - /// The mode of the mesh. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> GetMeshRevisionProfileAsync(string subscriptionId, AzureLocation location, string mode, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(mode, nameof(mode)); - - using var message = CreateGetMeshRevisionProfileRequest(subscriptionId, location, mode); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - MeshRevisionProfileData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = MeshRevisionProfileData.DeserializeMeshRevisionProfileData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((MeshRevisionProfileData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Contains extra metadata on the revision, including supported revisions, cluster compatibility and available upgrades. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the Azure region. - /// The mode of the mesh. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response GetMeshRevisionProfile(string subscriptionId, AzureLocation location, string mode, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(mode, nameof(mode)); - - using var message = CreateGetMeshRevisionProfileRequest(subscriptionId, location, mode); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - MeshRevisionProfileData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = MeshRevisionProfileData.DeserializeMeshRevisionProfileData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((MeshRevisionProfileData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListMeshUpgradeProfilesRequest(string subscriptionId, string resourceGroupName, string resourceName) - { - 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/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/meshUpgradeProfiles", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists available upgrades for all service meshes in a specific cluster. - /// 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 managed cluster resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListMeshUpgradeProfilesAsync(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListMeshUpgradeProfilesRequest(subscriptionId, resourceGroupName, resourceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - MeshUpgradeProfileList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = MeshUpgradeProfileList.DeserializeMeshUpgradeProfileList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists available upgrades for all service meshes in a specific cluster. - /// 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 managed cluster resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListMeshUpgradeProfiles(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListMeshUpgradeProfilesRequest(subscriptionId, resourceGroupName, resourceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - MeshUpgradeProfileList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = MeshUpgradeProfileList.DeserializeMeshUpgradeProfileList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetMeshUpgradeProfileRequest(string subscriptionId, string resourceGroupName, string resourceName, string mode) - { - 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/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/meshUpgradeProfiles/", false); - uri.AppendPath(mode, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets available upgrades for a service mesh in a cluster. - /// 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 managed cluster resource. - /// The mode of the mesh. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetMeshUpgradeProfileAsync(string subscriptionId, string resourceGroupName, string resourceName, string mode, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(mode, nameof(mode)); - - using var message = CreateGetMeshUpgradeProfileRequest(subscriptionId, resourceGroupName, resourceName, mode); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - MeshUpgradeProfileData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = MeshUpgradeProfileData.DeserializeMeshUpgradeProfileData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((MeshUpgradeProfileData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets available upgrades for a service mesh in a cluster. - /// 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 managed cluster resource. - /// The mode of the mesh. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response GetMeshUpgradeProfile(string subscriptionId, string resourceGroupName, string resourceName, string mode, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(mode, nameof(mode)); - - using var message = CreateGetMeshUpgradeProfileRequest(subscriptionId, resourceGroupName, resourceName, mode); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - MeshUpgradeProfileData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = MeshUpgradeProfileData.DeserializeMeshUpgradeProfileData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((MeshUpgradeProfileData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(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; - } - - /// Gets a list of managed clusters 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> ListNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ManagedClusterListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ManagedClusterListResult.DeserializeManagedClusterListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets a list of managed clusters 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 ListNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ManagedClusterListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ManagedClusterListResult.DeserializeManagedClusterListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - 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 managed clusters 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: - { - ManagedClusterListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ManagedClusterListResult.DeserializeManagedClusterListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists managed clusters 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: - { - ManagedClusterListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ManagedClusterListResult.DeserializeManagedClusterListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListOutboundNetworkDependenciesEndpointsNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string resourceName) - { - 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; - } - - /// Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. The operation returns properties of each egress endpoint. - /// 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 managed cluster resource. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListOutboundNetworkDependenciesEndpointsNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListOutboundNetworkDependenciesEndpointsNextPageRequest(nextLink, subscriptionId, resourceGroupName, resourceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - OutboundEnvironmentEndpointListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = OutboundEnvironmentEndpointListResult.DeserializeOutboundEnvironmentEndpointListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. The operation returns properties of each egress endpoint. - /// 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 managed cluster resource. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListOutboundNetworkDependenciesEndpointsNextPage(string nextLink, string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListOutboundNetworkDependenciesEndpointsNextPageRequest(nextLink, subscriptionId, resourceGroupName, resourceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - OutboundEnvironmentEndpointListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = OutboundEnvironmentEndpointListResult.DeserializeOutboundEnvironmentEndpointListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListMeshRevisionProfilesNextPageRequest(string nextLink, string subscriptionId, AzureLocation location) - { - 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; - } - - /// Contains extra metadata on each revision, including supported revisions, cluster compatibility and available upgrades. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the Azure region. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListMeshRevisionProfilesNextPageAsync(string nextLink, string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListMeshRevisionProfilesNextPageRequest(nextLink, subscriptionId, location); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - MeshRevisionProfileList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = MeshRevisionProfileList.DeserializeMeshRevisionProfileList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Contains extra metadata on each revision, including supported revisions, cluster compatibility and available upgrades. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the Azure region. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListMeshRevisionProfilesNextPage(string nextLink, string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListMeshRevisionProfilesNextPageRequest(nextLink, subscriptionId, location); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - MeshRevisionProfileList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = MeshRevisionProfileList.DeserializeMeshRevisionProfileList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListMeshUpgradeProfilesNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string resourceName) - { - 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 available upgrades for all service meshes in a specific cluster. - /// 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 managed cluster resource. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListMeshUpgradeProfilesNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListMeshUpgradeProfilesNextPageRequest(nextLink, subscriptionId, resourceGroupName, resourceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - MeshUpgradeProfileList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = MeshUpgradeProfileList.DeserializeMeshUpgradeProfileList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists available upgrades for all service meshes in a specific cluster. - /// 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 managed cluster resource. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListMeshUpgradeProfilesNextPage(string nextLink, string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListMeshUpgradeProfilesNextPageRequest(nextLink, subscriptionId, resourceGroupName, resourceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - MeshUpgradeProfileList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = MeshUpgradeProfileList.DeserializeMeshUpgradeProfileList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs deleted file mode 100644 index 854d29bc3b04a..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs +++ /dev/null @@ -1,377 +0,0 @@ -// 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; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.ContainerService.Models; - -namespace Azure.ResourceManager.ContainerService -{ - internal partial class PrivateEndpointConnectionsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of PrivateEndpointConnectionsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public PrivateEndpointConnectionsRestOperations(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 ?? "2023-10-01"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string resourceName) - { - 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/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/privateEndpointConnections", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. - /// 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 managed cluster resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListRequest(subscriptionId, resourceGroupName, resourceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ContainerServicePrivateEndpointConnectionListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ContainerServicePrivateEndpointConnectionListResult.DeserializeContainerServicePrivateEndpointConnectionListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. - /// 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 managed cluster resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListRequest(subscriptionId, resourceGroupName, resourceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ContainerServicePrivateEndpointConnectionListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ContainerServicePrivateEndpointConnectionListResult.DeserializeContainerServicePrivateEndpointConnectionListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName) - { - 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/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/privateEndpointConnections/", false); - uri.AppendPath(privateEndpointConnectionName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. - /// 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 managed cluster resource. - /// The name of the private endpoint connection. - /// 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 resourceName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, privateEndpointConnectionName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ContainerServicePrivateEndpointConnectionData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ContainerServicePrivateEndpointConnectionData.DeserializeContainerServicePrivateEndpointConnectionData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ContainerServicePrivateEndpointConnectionData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. - /// 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 managed cluster resource. - /// The name of the private endpoint connection. - /// 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 resourceName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, privateEndpointConnectionName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ContainerServicePrivateEndpointConnectionData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ContainerServicePrivateEndpointConnectionData.DeserializeContainerServicePrivateEndpointConnectionData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ContainerServicePrivateEndpointConnectionData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, ContainerServicePrivateEndpointConnectionData data) - { - 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/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/privateEndpointConnections/", false); - uri.AppendPath(privateEndpointConnectionName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Updates a private endpoint connection. - /// 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 managed cluster resource. - /// The name of the private endpoint connection. - /// The updated private endpoint connection. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, ContainerServicePrivateEndpointConnectionData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, resourceName, privateEndpointConnectionName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - { - ContainerServicePrivateEndpointConnectionData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ContainerServicePrivateEndpointConnectionData.DeserializeContainerServicePrivateEndpointConnectionData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Updates a private endpoint connection. - /// 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 managed cluster resource. - /// The name of the private endpoint connection. - /// The updated private endpoint connection. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, ContainerServicePrivateEndpointConnectionData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, resourceName, privateEndpointConnectionName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - { - ContainerServicePrivateEndpointConnectionData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ContainerServicePrivateEndpointConnectionData.DeserializeContainerServicePrivateEndpointConnectionData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName) - { - 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/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/privateEndpointConnections/", false); - uri.AppendPath(privateEndpointConnectionName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Deletes a private endpoint connection. - /// 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 managed cluster resource. - /// The name of the private endpoint connection. - /// 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 resourceName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName, privateEndpointConnectionName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Deletes a private endpoint connection. - /// 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 managed cluster resource. - /// The name of the private endpoint connection. - /// 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 resourceName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName, privateEndpointConnectionName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs deleted file mode 100644 index 8276e0eb3112d..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs +++ /dev/null @@ -1,119 +0,0 @@ -// 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; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.ContainerService.Models; - -namespace Azure.ResourceManager.ContainerService -{ - internal partial class PrivateLinkResourcesRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of PrivateLinkResourcesRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public PrivateLinkResourcesRestOperations(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 ?? "2023-10-01"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string resourceName) - { - 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/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/privateLinkResources", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. - /// 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 managed cluster resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListRequest(subscriptionId, resourceGroupName, resourceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ContainerServicePrivateLinkResourcesListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ContainerServicePrivateLinkResourcesListResult.DeserializeContainerServicePrivateLinkResourcesListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. - /// 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 managed cluster resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListRequest(subscriptionId, resourceGroupName, resourceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ContainerServicePrivateLinkResourcesListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ContainerServicePrivateLinkResourcesListResult.DeserializeContainerServicePrivateLinkResourcesListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/ResolvePrivateLinkServiceIdRestOperations.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/ResolvePrivateLinkServiceIdRestOperations.cs deleted file mode 100644 index 45d6853a0f2c8..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/ResolvePrivateLinkServiceIdRestOperations.cs +++ /dev/null @@ -1,127 +0,0 @@ -// 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; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.ContainerService.Models; - -namespace Azure.ResourceManager.ContainerService -{ - internal partial class ResolvePrivateLinkServiceIdRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of ResolvePrivateLinkServiceIdRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public ResolvePrivateLinkServiceIdRestOperations(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 ?? "2023-10-01"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreatePostRequest(string subscriptionId, string resourceGroupName, string resourceName, ContainerServicePrivateLinkResourceData data) - { - 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/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/resolvePrivateLinkServiceId", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Gets the private link service ID for the specified managed cluster. - /// 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 managed cluster resource. - /// Parameters required in order to resolve a private link service ID. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> PostAsync(string subscriptionId, string resourceGroupName, string resourceName, ContainerServicePrivateLinkResourceData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreatePostRequest(subscriptionId, resourceGroupName, resourceName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ContainerServicePrivateLinkResourceData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ContainerServicePrivateLinkResourceData.DeserializeContainerServicePrivateLinkResourceData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets the private link service ID for the specified managed cluster. - /// 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 managed cluster resource. - /// Parameters required in order to resolve a private link service ID. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Post(string subscriptionId, string resourceGroupName, string resourceName, ContainerServicePrivateLinkResourceData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreatePostRequest(subscriptionId, resourceGroupName, resourceName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ContainerServicePrivateLinkResourceData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ContainerServicePrivateLinkResourceData.DeserializeContainerServicePrivateLinkResourceData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/TrustedAccessRolesRestOperations.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/TrustedAccessRolesRestOperations.cs deleted file mode 100644 index 8ccca97984afb..0000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/TrustedAccessRolesRestOperations.cs +++ /dev/null @@ -1,181 +0,0 @@ -// 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; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.ContainerService.Models; - -namespace Azure.ResourceManager.ContainerService -{ - internal partial class TrustedAccessRolesRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of TrustedAccessRolesRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public TrustedAccessRolesRestOperations(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 ?? "2023-10-01"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListRequest(string subscriptionId, AzureLocation location) - { - 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/locations/", false); - uri.AppendPath(location, true); - uri.AppendPath("/trustedAccessRoles", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List supported trusted access roles. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the Azure region. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId, location); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - TrustedAccessRoleListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = TrustedAccessRoleListResult.DeserializeTrustedAccessRoleListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List supported trusted access roles. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the Azure region. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId, location); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - TrustedAccessRoleListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = TrustedAccessRoleListResult.DeserializeTrustedAccessRoleListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, AzureLocation location) - { - 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 supported trusted access roles. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the Azure region. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId, location); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - TrustedAccessRoleListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = TrustedAccessRoleListResult.DeserializeTrustedAccessRoleListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List supported trusted access roles. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the Azure region. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId, location); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - TrustedAccessRoleListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = TrustedAccessRoleListResult.DeserializeTrustedAccessRoleListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/AgentPoolsRestOperations.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/UpdateRunsRestOperations.cs similarity index 50% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/AgentPoolsRestOperations.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/UpdateRunsRestOperations.cs index 71157cc8c2cbe..4ded843602627 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/AgentPoolsRestOperations.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/UpdateRunsRestOperations.cs @@ -16,105 +16,28 @@ namespace Azure.ResourceManager.ContainerService { - internal partial class AgentPoolsRestOperations + 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 AgentPoolsRestOperations. + /// 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. /// server parameter. /// Api Version. /// or is null. - public AgentPoolsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + 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 ?? "2023-10-01"; + _apiVersion = apiVersion ?? "2024-02-02-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal HttpMessage CreateAbortLatestOperationRequest(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName) - { - 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/managedclusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/agentPools/", false); - uri.AppendPath(agentPoolName, true); - uri.AppendPath("/abort", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Aborts the currently running operation on the agent pool. The Agent Pool will be moved to a Canceling state and eventually to a Canceled state when cancellation finishes. If the operation completes before cancellation can take place, a 409 error code is returned. - /// 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 managed cluster resource. - /// The name of the agent pool. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task AbortLatestOperationAsync(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); - - using var message = CreateAbortLatestOperationRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Aborts the currently running operation on the agent pool. The Agent Pool will be moved to a Canceling state and eventually to a Canceled state when cancellation finishes. If the operation completes before cancellation can take place, a 409 error code is returned. - /// 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 managed cluster resource. - /// The name of the agent pool. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response AbortLatestOperation(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); - - using var message = CreateAbortLatestOperationRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string resourceName) + internal HttpMessage CreateListByFleetRequest(string subscriptionId, string resourceGroupName, string fleetName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -125,9 +48,9 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/agentPools", false); + 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"); @@ -135,28 +58,28 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro return message; } - /// Gets a list of agent pools in the specified managed cluster. - /// The ID of the target subscription. The value must be an UUID. + /// List UpdateRun resources by Fleet. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. + /// 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> ListAsync(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + /// , 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(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, resourceName); + using var message = CreateListByFleetRequest(subscriptionId, resourceGroupName, fleetName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - ContainerServiceAgentPoolListResult value = default; + UpdateRunListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ContainerServiceAgentPoolListResult.DeserializeContainerServiceAgentPoolListResult(document.RootElement); + value = UpdateRunListResult.DeserializeUpdateRunListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -164,28 +87,28 @@ public async Task> ListAsync(strin } } - /// Gets a list of agent pools in the specified managed cluster. - /// The ID of the target subscription. The value must be an UUID. + /// List UpdateRun resources by Fleet. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. + /// 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 List(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + /// , 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(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, resourceName); + using var message = CreateListByFleetRequest(subscriptionId, resourceGroupName, fleetName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - ContainerServiceAgentPoolListResult value = default; + UpdateRunListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ContainerServiceAgentPoolListResult.DeserializeContainerServiceAgentPoolListResult(document.RootElement); + value = UpdateRunListResult.DeserializeUpdateRunListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -193,7 +116,7 @@ public Response List(string subscriptionId, } } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName) + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -204,10 +127,10 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/agentPools/", false); - uri.AppendPath(agentPoolName, 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"); @@ -215,73 +138,73 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou return message; } - /// Gets the specified managed cluster agent pool. - /// The ID of the target subscription. The value must be an UUID. + /// Get a UpdateRun. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The name of the agent pool. + /// 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 resourceName, string agentPoolName, CancellationToken cancellationToken = default) + /// , , 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(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, updateRunName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - ContainerServiceAgentPoolData value = default; + UpdateRunData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ContainerServiceAgentPoolData.DeserializeContainerServiceAgentPoolData(document.RootElement); + value = UpdateRunData.DeserializeUpdateRunData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((ContainerServiceAgentPoolData)null, message.Response); + return Response.FromValue((UpdateRunData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Gets the specified managed cluster agent pool. - /// The ID of the target subscription. The value must be an UUID. + /// Get a UpdateRun. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The name of the agent pool. + /// 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 resourceName, string agentPoolName, CancellationToken cancellationToken = default) + /// , , 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(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, updateRunName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - ContainerServiceAgentPoolData value = default; + UpdateRunData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ContainerServiceAgentPoolData.DeserializeContainerServiceAgentPoolData(document.RootElement); + value = UpdateRunData.DeserializeUpdateRunData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((ContainerServiceAgentPoolData)null, message.Response); + return Response.FromValue((UpdateRunData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, ContainerServiceAgentPoolData data) + 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; @@ -292,12 +215,20 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/agentPools/", false); - uri.AppendPath(agentPoolName, 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(); @@ -307,24 +238,26 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r return message; } - /// Creates or updates an agent pool in the specified managed cluster. - /// The ID of the target subscription. The value must be an UUID. + /// Create a UpdateRun. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The name of the agent pool. - /// The agent pool to create or update. + /// 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 resourceName, string agentPoolName, ContainerServiceAgentPoolData data, CancellationToken cancellationToken = default) + /// , , , 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(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName, data); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, updateRunName, data, ifMatch, ifNoneMatch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -336,24 +269,26 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re } } - /// Creates or updates an agent pool in the specified managed cluster. - /// The ID of the target subscription. The value must be an UUID. + /// Create a UpdateRun. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The name of the agent pool. - /// The agent pool to create or update. + /// 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 resourceName, string agentPoolName, ContainerServiceAgentPoolData data, CancellationToken cancellationToken = default) + /// , , , 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(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName, data); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, updateRunName, data, ifMatch, ifNoneMatch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -365,7 +300,7 @@ public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, } } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, string ifMatch) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -376,36 +311,42 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/agentPools/", false); - uri.AppendPath(agentPoolName, 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; } - /// Deletes an agent pool in the specified managed cluster. - /// The ID of the target subscription. The value must be an UUID. + /// Delete a UpdateRun. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The name of the agent pool. + /// 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 resourceName, string agentPoolName, CancellationToken cancellationToken = default) + /// , , 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(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName); + 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; @@ -414,25 +355,27 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } } - /// Deletes an agent pool in the specified managed cluster. - /// The ID of the target subscription. The value must be an UUID. + /// Delete a UpdateRun. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The name of the agent pool. + /// 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 resourceName, string agentPoolName, CancellationToken cancellationToken = default) + /// , , 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(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName); + 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; @@ -441,175 +384,189 @@ public Response Delete(string subscriptionId, string resourceGroupName, string r } } - internal HttpMessage CreateGetUpgradeProfileRequest(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName) + 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.Get; + 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/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/agentPools/", false); - uri.AppendPath(agentPoolName, true); - uri.AppendPath("/upgradeProfiles/default", false); + 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); + request.Content = content; _userAgent.Apply(message); return message; } - /// Gets the upgrade profile for an agent pool. - /// The ID of the target subscription. The value must be an UUID. + /// Skips one or a combination of member/group/stage/afterStageWait(s) of an update run. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The name of the agent pool. + /// 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> GetUpgradeProfileAsync(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, CancellationToken cancellationToken = default) + /// , , , 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(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); + Argument.AssertNotNull(body, nameof(body)); - using var message = CreateGetUpgradeProfileRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName); + using var message = CreateSkipRequest(subscriptionId, resourceGroupName, fleetName, updateRunName, body, ifMatch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - AgentPoolUpgradeProfileData value = default; + UpdateRunData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AgentPoolUpgradeProfileData.DeserializeAgentPoolUpgradeProfileData(document.RootElement); + value = UpdateRunData.DeserializeUpdateRunData(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((AgentPoolUpgradeProfileData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Gets the upgrade profile for an agent pool. - /// The ID of the target subscription. The value must be an UUID. + /// Skips one or a combination of member/group/stage/afterStageWait(s) of an update run. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The name of the agent pool. + /// 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 GetUpgradeProfile(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, CancellationToken cancellationToken = default) + /// , , , 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(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); + Argument.AssertNotNull(body, nameof(body)); - using var message = CreateGetUpgradeProfileRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName); + using var message = CreateSkipRequest(subscriptionId, resourceGroupName, fleetName, updateRunName, body, ifMatch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - AgentPoolUpgradeProfileData value = default; + UpdateRunData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AgentPoolUpgradeProfileData.DeserializeAgentPoolUpgradeProfileData(document.RootElement); + value = UpdateRunData.DeserializeUpdateRunData(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((AgentPoolUpgradeProfileData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal HttpMessage CreateGetAvailableAgentPoolVersionsRequest(string subscriptionId, string resourceGroupName, string resourceName) + internal HttpMessage CreateStartRequest(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, string ifMatch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + 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/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/availableAgentPoolVersions", false); + 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; } - /// See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more details about the version lifecycle. - /// The ID of the target subscription. The value must be an UUID. + /// Starts an UpdateRun. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. + /// 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> GetAvailableAgentPoolVersionsAsync(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + /// , , 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(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); - using var message = CreateGetAvailableAgentPoolVersionsRequest(subscriptionId, resourceGroupName, resourceName); + using var message = CreateStartRequest(subscriptionId, resourceGroupName, fleetName, updateRunName, ifMatch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - AgentPoolAvailableVersions value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AgentPoolAvailableVersions.DeserializeAgentPoolAvailableVersions(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more details about the version lifecycle. - /// The ID of the target subscription. The value must be an UUID. + /// Starts an UpdateRun. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. + /// 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 GetAvailableAgentPoolVersions(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + /// , , 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(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); - using var message = CreateGetAvailableAgentPoolVersionsRequest(subscriptionId, resourceGroupName, resourceName); + using var message = CreateStartRequest(subscriptionId, resourceGroupName, fleetName, updateRunName, ifMatch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - AgentPoolAvailableVersions value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AgentPoolAvailableVersions.DeserializeAgentPoolAvailableVersions(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal HttpMessage CreateUpgradeNodeImageVersionRequest(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName) + internal HttpMessage CreateStopRequest(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, string ifMatch) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -620,34 +577,39 @@ internal HttpMessage CreateUpgradeNodeImageVersionRequest(string subscriptionId, uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/agentPools/", false); - uri.AppendPath(agentPoolName, true); - uri.AppendPath("/upgradeNodeImageVersion", false); + 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; } - /// Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS provides one new image per week with the latest updates. For more details on node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade. - /// The ID of the target subscription. The value must be an UUID. + /// Stops an UpdateRun. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The name of the agent pool. + /// 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 UpgradeNodeImageVersionAsync(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, CancellationToken cancellationToken = default) + /// , , 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(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); - using var message = CreateUpgradeNodeImageVersionRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName); + using var message = CreateStopRequest(subscriptionId, resourceGroupName, fleetName, updateRunName, ifMatch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -659,22 +621,23 @@ public async Task UpgradeNodeImageVersionAsync(string subscriptionId, } } - /// Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS provides one new image per week with the latest updates. For more details on node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade. - /// The ID of the target subscription. The value must be an UUID. + /// Stops an UpdateRun. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The name of the agent pool. + /// 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 UpgradeNodeImageVersion(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, CancellationToken cancellationToken = default) + /// , , 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(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); - using var message = CreateUpgradeNodeImageVersionRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName); + using var message = CreateStopRequest(subscriptionId, resourceGroupName, fleetName, updateRunName, ifMatch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -686,7 +649,7 @@ public Response UpgradeNodeImageVersion(string subscriptionId, string resourceGr } } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string resourceName) + internal HttpMessage CreateListByFleetNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string fleetName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -700,30 +663,30 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript return message; } - /// Gets a list of agent pools in the specified managed cluster. + /// 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 ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. + /// 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> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + /// , , 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(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, resourceName); + using var message = CreateListByFleetNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - ContainerServiceAgentPoolListResult value = default; + UpdateRunListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ContainerServiceAgentPoolListResult.DeserializeContainerServiceAgentPoolListResult(document.RootElement); + value = UpdateRunListResult.DeserializeUpdateRunListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -731,30 +694,30 @@ public async Task> ListNextPageAsy } } - /// Gets a list of agent pools in the specified managed cluster. + /// 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 ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. + /// 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 ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + /// , , 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(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, resourceName); + using var message = CreateListByFleetNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - ContainerServiceAgentPoolListResult value = default; + UpdateRunListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ContainerServiceAgentPoolListResult.DeserializeContainerServiceAgentPoolListResult(document.RootElement); + value = UpdateRunListResult.DeserializeUpdateRunListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/UpdateRunCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/UpdateRunCollection.cs new file mode 100644 index 0000000000000..3b9f49727f03c --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/UpdateRunCollection.cs @@ -0,0 +1,499 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.ContainerService +{ + /// + /// 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.ContainerService", 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 + /// UpdateRuns_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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 ContainerServiceArmOperation(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 + /// UpdateRuns_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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 ContainerServiceArmOperation(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 + /// UpdateRuns_Get + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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 + /// UpdateRuns_Get + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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 + /// UpdateRuns_ListByFleet + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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 + /// UpdateRuns_ListByFleet + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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 + /// UpdateRuns_Get + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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 + /// UpdateRuns_Get + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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 + /// UpdateRuns_Get + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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 + /// UpdateRuns_Get + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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/containerservice/Azure.ResourceManager.ContainerService/src/Generated/UpdateRunData.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/UpdateRunData.cs new file mode 100644 index 0000000000000..015ca9b708562 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/UpdateRunData.cs @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure; +using Azure.Core; +using Azure.ResourceManager.ContainerService.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerService +{ + /// + /// 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. + /// 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. + /// 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. + /// Keeps track of any properties unknown to the library. + internal UpdateRunData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ETag? eTag, UpdateRunProvisioningState? provisioningState, ResourceIdentifier updateStrategyId, UpdateRunStrategy strategy, ManagedClusterUpdate managedClusterUpdate, UpdateRunStatus status, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + ETag = eTag; + ProvisioningState = provisioningState; + UpdateStrategyId = updateStrategyId; + Strategy = strategy; + ManagedClusterUpdate = managedClusterUpdate; + Status = status; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// 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 ETag? ETag { get; } + /// 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; } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/UpdateRunResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/UpdateRunResource.cs new file mode 100644 index 0000000000000..5e9de55044f76 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/UpdateRunResource.cs @@ -0,0 +1,614 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.ContainerService.Models; + +namespace Azure.ResourceManager.ContainerService +{ + /// + /// 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.ContainerService", 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 + /// UpdateRuns_Get + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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 + /// UpdateRuns_Get + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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 + /// UpdateRuns_Delete + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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 ContainerServiceArmOperation(_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 + /// UpdateRuns_Delete + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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 ContainerServiceArmOperation(_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 + /// UpdateRuns_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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 ContainerServiceArmOperation(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 + /// UpdateRuns_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-02-02-preview + /// + /// + /// 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 ContainerServiceArmOperation(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; + } + } + + /// + /// 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 + /// 2024-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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(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); + return Response.FromValue(new UpdateRunResource(Client, response.Value), response.GetRawResponse()); + } + 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 + /// 2024-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 Response Skip(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); + return Response.FromValue(new UpdateRunResource(Client, response.Value), response.GetRawResponse()); + } + 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 + /// 2024-02-02-preview + /// + /// + /// 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 ContainerServiceArmOperation(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 + /// 2024-02-02-preview + /// + /// + /// 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 ContainerServiceArmOperation(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 + /// 2024-02-02-preview + /// + /// + /// 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 ContainerServiceArmOperation(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 + /// 2024-02-02-preview + /// + /// + /// 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 ContainerServiceArmOperation(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; + } + } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/autorest.md b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/autorest.md index 943ee58266388..2cd5235aa68ad 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/autorest.md +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/autorest.md @@ -8,7 +8,7 @@ azure-arm: true csharp: true library-name: ContainerService namespace: Azure.ResourceManager.ContainerService -require: https://github.com/Azure/azure-rest-api-specs/blob/8e674dd2a88ae73868c6fa7593a0ba4371e45991/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/readme.md #tag: package-2023-10 output-folder: $(this-folder)/Generated clear-output-folder: true