From bbbccf9612fdcbd324219f48253fc95e8be6a47c Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Tue, 10 Mar 2026 23:43:58 +0000 Subject: [PATCH] Configurations: 'specification/containerservice/resource-manager/Microsoft.ContainerService/aks/tspconfig.yaml', API Version: 2026-01-01, SDK Release Type: stable, and CommitSHA: '63cb8f987d0d5fb94e781d000c7f7fc7a4a69842' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=5990416 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- eng/versioning/version_client.txt | 1 + .../CHANGELOG.md | 8 + .../README.md | 102 + .../SAMPLE.md | 3787 ++++++++++++++ .../pom.xml | 73 + .../generated/ContainerServiceManager.java | 462 ++ .../generated/fluent/AgentPoolsClient.java | 496 ++ .../ContainerServiceManagementClient.java | 132 + .../generated/fluent/MachinesClient.java | 79 + .../MaintenanceConfigurationsClient.java | 146 + .../fluent/ManagedClustersClient.java | 1234 +++++ .../fluent/ManagedNamespacesClient.java | 272 + .../generated/fluent/OperationsClient.java | 38 + .../PrivateEndpointConnectionsClient.java | 187 + .../fluent/PrivateLinkResourcesClient.java | 53 + .../ResolvePrivateLinkServiceIdsClient.java | 46 + .../generated/fluent/SnapshotsClient.java | 179 + .../TrustedAccessRoleBindingsClient.java | 205 + .../fluent/TrustedAccessRolesClient.java | 41 + .../fluent/models/AccessProfile.java | 75 + .../AgentPoolAvailableVersionsInner.java | 136 + .../AgentPoolAvailableVersionsProperties.java | 82 + .../fluent/models/AgentPoolInner.java | 1495 ++++++ .../models/AgentPoolUpgradeProfileInner.java | 183 + .../AgentPoolUpgradeProfileProperties.java | 132 + .../models/CommandResultProperties.java | 157 + .../fluent/models/CredentialResultsInner.java | 77 + .../KubernetesVersionListResultInner.java | 78 + .../generated/fluent/models/MachineInner.java | 163 + .../models/MaintenanceConfigurationInner.java | 222 + .../MaintenanceConfigurationProperties.java | 153 + .../ManagedClusterAccessProfileInner.java | 163 + ...agedClusterAgentPoolProfileProperties.java | 1846 +++++++ .../fluent/models/ManagedClusterInner.java | 1318 +++++ .../models/ManagedClusterProperties.java | 1362 +++++ .../ManagedClusterUpgradeProfileInner.java | 165 + ...anagedClusterUpgradeProfileProperties.java | 100 + .../fluent/models/ManagedNamespaceInner.java | 235 + .../models/MeshRevisionProfileInner.java | 144 + .../models/MeshUpgradeProfileInner.java | 144 + .../fluent/models/OperationValueDisplay.java | 121 + .../fluent/models/OperationValueInner.java | 142 + .../OutboundEnvironmentEndpointInner.java | 97 + .../PrivateEndpointConnectionInner.java | 206 + ...vateEndpointConnectionListResultInner.java | 79 + .../PrivateEndpointConnectionProperties.java | 140 + .../models/PrivateLinkResourceInner.java | 219 + .../PrivateLinkResourcesListResultInner.java | 79 + .../fluent/models/RunCommandResultInner.java | 145 + .../fluent/models/SnapshotInner.java | 277 + .../fluent/models/SnapshotProperties.java | 218 + .../models/TrustedAccessRoleBindingInner.java | 204 + .../TrustedAccessRoleBindingProperties.java | 138 + .../fluent/models/TrustedAccessRoleInner.java | 111 + .../generated/fluent/models/package-info.java | 9 + .../generated/fluent/package-info.java | 9 + .../AgentPoolAvailableVersionsImpl.java | 52 + .../implementation/AgentPoolImpl.java | 705 +++ .../AgentPoolUpgradeProfileImpl.java | 70 + .../implementation/AgentPoolsClientImpl.java | 1808 +++++++ .../implementation/AgentPoolsImpl.java | 227 + ...ntainerServiceManagementClientBuilder.java | 138 + .../ContainerServiceManagementClientImpl.java | 484 ++ .../implementation/CredentialResultsImpl.java | 40 + .../KubernetesVersionListResultImpl.java | 40 + .../generated/implementation/MachineImpl.java | 61 + .../implementation/MachinesClientImpl.java | 372 ++ .../implementation/MachinesImpl.java | 66 + .../MaintenanceConfigurationImpl.java | 167 + .../MaintenanceConfigurationsClientImpl.java | 585 +++ .../MaintenanceConfigurationsImpl.java | 156 + .../ManagedClusterAccessProfileImpl.java | 64 + .../implementation/ManagedClusterImpl.java | 762 +++ .../ManagedClusterUpgradeProfileImpl.java | 61 + .../ManagedClustersClientImpl.java | 4599 +++++++++++++++++ .../implementation/ManagedClustersImpl.java | 446 ++ .../implementation/ManagedNamespaceImpl.java | 200 + .../ManagedNamespacesClientImpl.java | 989 ++++ .../implementation/ManagedNamespacesImpl.java | 176 + .../MeshRevisionProfileImpl.java | 50 + .../MeshUpgradeProfileImpl.java | 50 + .../implementation/OperationValueImpl.java | 52 + .../implementation/OperationsClientImpl.java | 237 + .../implementation/OperationsImpl.java | 45 + .../OutboundEnvironmentEndpointImpl.java | 44 + .../PrivateEndpointConnectionImpl.java | 60 + ...ivateEndpointConnectionListResultImpl.java | 44 + .../PrivateEndpointConnectionsClientImpl.java | 581 +++ .../PrivateEndpointConnectionsImpl.java | 102 + .../PrivateLinkResourceImpl.java | 59 + .../PrivateLinkResourcesClientImpl.java | 166 + .../PrivateLinkResourcesImpl.java | 53 + .../PrivateLinkResourcesListResultImpl.java | 44 + ...esolvePrivateLinkServiceIdsClientImpl.java | 156 + .../ResolvePrivateLinkServiceIdsImpl.java | 54 + .../implementation/ResourceManagerUtils.java | 195 + .../implementation/RunCommandResultImpl.java | 57 + .../implementation/SnapshotImpl.java | 218 + .../implementation/SnapshotsClientImpl.java | 803 +++ .../implementation/SnapshotsImpl.java | 143 + .../TrustedAccessRoleBindingImpl.java | 154 + .../TrustedAccessRoleBindingsClientImpl.java | 778 +++ .../TrustedAccessRoleBindingsImpl.java | 162 + .../implementation/TrustedAccessRoleImpl.java | 48 + .../TrustedAccessRolesClientImpl.java | 253 + .../TrustedAccessRolesImpl.java | 45 + .../models/AgentPoolListResult.java | 95 + .../models/MachineListResult.java | 95 + .../MaintenanceConfigurationListResult.java | 97 + .../models/ManagedClusterListResult.java | 96 + .../models/ManagedNamespaceListResult.java | 96 + .../models/MeshRevisionProfileList.java | 96 + .../models/MeshUpgradeProfileList.java | 96 + .../models/OperationListResult.java | 96 + ...OutboundEnvironmentEndpointCollection.java | 98 + .../models/SnapshotListResult.java | 95 + .../TrustedAccessRoleBindingListResult.java | 97 + .../models/TrustedAccessRoleListResult.java | 96 + .../implementation/package-info.java | 9 + .../models/AbsoluteMonthlySchedule.java | 114 + .../generated/models/AccelerationMode.java | 54 + .../generated/models/AdoptionPolicy.java | 56 + .../models/AdvancedNetworkPolicies.java | 59 + .../generated/models/AdvancedNetworking.java | 180 + .../AdvancedNetworkingObservability.java | 88 + .../models/AdvancedNetworkingPerformance.java | 97 + .../models/AdvancedNetworkingSecurity.java | 160 + ...edNetworkingSecurityTransitEncryption.java | 92 + .../generated/models/AgentPool.java | 2351 +++++++++ .../models/AgentPoolAvailableVersions.java | 49 + ...rsionsPropertiesAgentPoolVersionsItem.java | 115 + .../AgentPoolDeleteMachinesParameter.java | 89 + .../models/AgentPoolGatewayProfile.java | 97 + .../generated/models/AgentPoolMode.java | 60 + .../models/AgentPoolNetworkProfile.java | 152 + .../generated/models/AgentPoolSSHAccess.java | 51 + .../models/AgentPoolSecurityProfile.java | 151 + .../generated/models/AgentPoolStatus.java | 76 + .../generated/models/AgentPoolType.java | 56 + .../models/AgentPoolUpgradeProfile.java | 78 + ...lUpgradeProfilePropertiesUpgradesItem.java | 94 + .../models/AgentPoolUpgradeSettings.java | 243 + .../models/AgentPoolWindowsProfile.java | 90 + .../generated/models/AgentPools.java | 312 ++ .../generated/models/ArtifactSource.java | 51 + .../generated/models/AzureKeyVaultKms.java | 189 + .../generated/models/BackendPoolType.java | 53 + .../models/ClusterUpgradeSettings.java | 85 + .../generated/models/Code.java | 51 + .../generated/models/CompatibleVersions.java | 93 + .../generated/models/ConnectionStatus.java | 61 + .../models/ContainerServiceLinuxProfile.java | 114 + .../ContainerServiceNetworkProfile.java | 595 +++ .../ContainerServiceSshConfiguration.java | 92 + .../models/ContainerServiceSshPublicKey.java | 89 + .../generated/models/CreationData.java | 87 + .../generated/models/CredentialResult.java | 90 + .../generated/models/CredentialResults.java | 27 + .../generated/models/DailySchedule.java | 86 + .../generated/models/DateSpan.java | 118 + .../generated/models/DelegatedResource.java | 169 + .../generated/models/DeletePolicy.java | 51 + .../generated/models/EndpointDependency.java | 95 + .../generated/models/EndpointDetail.java | 125 + .../generated/models/Expander.java | 69 + .../generated/models/ExtendedLocation.java | 113 + .../models/ExtendedLocationTypes.java | 46 + .../generated/models/Format.java | 52 + .../generated/models/GPUDriver.java | 51 + .../generated/models/GPUInstanceProfile.java | 66 + .../generated/models/GPUProfile.java | 85 + .../generated/models/IPFamily.java | 51 + .../generated/models/IPTag.java | 113 + .../models/IstioCertificateAuthority.java | 86 + .../generated/models/IstioComponents.java | 150 + .../generated/models/IstioEgressGateway.java | 179 + .../generated/models/IstioIngressGateway.java | 115 + .../models/IstioIngressGatewayMode.java | 51 + .../IstioPluginCertificateAuthority.java | 198 + .../generated/models/IstioServiceMesh.java | 152 + .../models/KeyVaultNetworkAccessTypes.java | 53 + .../generated/models/KubeletConfig.java | 401 ++ .../generated/models/KubeletDiskType.java | 51 + .../models/KubernetesPatchVersion.java | 76 + .../models/KubernetesSupportPlan.java | 53 + .../generated/models/KubernetesVersion.java | 145 + .../models/KubernetesVersionCapabilities.java | 79 + .../models/KubernetesVersionListResult.java | 28 + .../generated/models/LicenseType.java | 52 + .../generated/models/LinuxOSConfig.java | 185 + .../generated/models/LoadBalancerSku.java | 55 + .../models/LocalDNSForwardDestination.java | 52 + .../models/LocalDNSForwardPolicy.java | 60 + .../generated/models/LocalDNSMode.java | 56 + .../generated/models/LocalDNSOverride.java | 297 ++ .../generated/models/LocalDNSProfile.java | 170 + .../generated/models/LocalDNSProtocol.java | 51 + .../models/LocalDNSQueryLogging.java | 51 + .../generated/models/LocalDNSServeStale.java | 59 + .../generated/models/LocalDNSState.java | 51 + .../generated/models/Machine.java | 63 + .../generated/models/MachineIpAddress.java | 89 + .../models/MachineNetworkProperties.java | 76 + .../generated/models/MachineProperties.java | 89 + .../generated/models/Machines.java | 71 + .../models/MaintenanceConfiguration.java | 268 + .../models/MaintenanceConfigurations.java | 154 + .../generated/models/MaintenanceWindow.java | 249 + .../generated/models/ManagedCluster.java | 1530 ++++++ .../models/ManagedClusterAADProfile.java | 266 + ...agedClusterAIToolchainOperatorProfile.java | 92 + .../models/ManagedClusterAccessProfile.java | 71 + .../models/ManagedClusterAddonProfile.java | 133 + .../ManagedClusterAddonProfileIdentity.java | 66 + .../ManagedClusterAgentPoolProfile.java | 802 +++ .../ManagedClusterApiServerAccessProfile.java | 291 ++ .../ManagedClusterAutoUpgradeProfile.java | 125 + .../ManagedClusterAzureMonitorProfile.java | 93 + ...erAzureMonitorProfileKubeStateMetrics.java | 132 + ...agedClusterAzureMonitorProfileMetrics.java | 129 + .../ManagedClusterBootstrapProfile.java | 119 + .../models/ManagedClusterCostAnalysis.java | 93 + .../models/ManagedClusterHttpProxyConfig.java | 203 + .../models/ManagedClusterIdentity.java | 199 + .../models/ManagedClusterIngressProfile.java | 91 + .../ManagedClusterIngressProfileNginx.java | 91 + ...gedClusterIngressProfileWebAppRouting.java | 182 + .../ManagedClusterLoadBalancerProfile.java | 292 ++ ...LoadBalancerProfileManagedOutboundIPs.java | 126 + ...LoadBalancerProfileOutboundIPPrefixes.java | 93 + ...ClusterLoadBalancerProfileOutboundIPs.java | 90 + ...anagedClusterManagedOutboundIPProfile.java | 90 + .../models/ManagedClusterMetricsProfile.java | 85 + .../ManagedClusterNATGatewayProfile.java | 141 + ...ManagedClusterNodeProvisioningProfile.java | 133 + ...anagedClusterNodeResourceGroupProfile.java | 92 + .../ManagedClusterOIDCIssuerProfile.java | 102 + .../models/ManagedClusterPodIdentity.java | 204 + .../ManagedClusterPodIdentityException.java | 148 + .../ManagedClusterPodIdentityProfile.java | 195 + ...edClusterPodIdentityProvisioningError.java | 77 + ...usterPodIdentityProvisioningErrorBody.java | 132 + ...gedClusterPodIdentityProvisioningInfo.java | 77 + ...edClusterPodIdentityProvisioningState.java | 72 + .../ManagedClusterPoolUpgradeProfile.java | 130 + ...ClusterPoolUpgradeProfileUpgradesItem.java | 94 + ...gedClusterPropertiesAutoScalerProfile.java | 727 +++ .../generated/models/ManagedClusterSKU.java | 116 + .../models/ManagedClusterSKUName.java | 53 + .../models/ManagedClusterSKUTier.java | 62 + .../models/ManagedClusterSecurityProfile.java | 219 + ...ManagedClusterSecurityProfileDefender.java | 127 + ...rityProfileDefenderSecurityMonitoring.java | 89 + ...gedClusterSecurityProfileImageCleaner.java | 118 + ...lusterSecurityProfileWorkloadIdentity.java | 88 + ...ManagedClusterServicePrincipalProfile.java | 116 + ...agedClusterStaticEgressGatewayProfile.java | 90 + .../models/ManagedClusterStatus.java | 76 + .../models/ManagedClusterStorageProfile.java | 174 + ...gedClusterStorageProfileBlobCSIDriver.java | 88 + ...gedClusterStorageProfileDiskCSIDriver.java | 88 + ...gedClusterStorageProfileFileCSIDriver.java | 88 + ...usterStorageProfileSnapshotController.java | 88 + .../models/ManagedClusterUpgradeProfile.java | 64 + .../models/ManagedClusterWindowsProfile.java | 233 + ...nagedClusterWorkloadAutoScalerProfile.java | 120 + ...dClusterWorkloadAutoScalerProfileKeda.java | 88 + ...utoScalerProfileVerticalPodAutoscaler.java | 91 + .../generated/models/ManagedClusters.java | 784 +++ ...anagedClustersGetCommandResultHeaders.java | 39 + ...nagedClustersGetCommandResultResponse.java | 40 + .../generated/models/ManagedNamespace.java | 285 + .../generated/models/ManagedNamespaces.java | 175 + ...ceIdentityUserAssignedIdentitiesValue.java | 91 + .../generated/models/ManualScaleProfile.java | 116 + .../generated/models/MeshRevision.java | 148 + .../generated/models/MeshRevisionProfile.java | 56 + .../models/MeshRevisionProfileProperties.java | 77 + .../generated/models/MeshUpgradeProfile.java | 55 + .../models/MeshUpgradeProfileProperties.java | 115 + .../generated/models/NamespaceProperties.java | 285 + .../models/NamespaceProvisioningState.java | 71 + .../generated/models/NetworkDataplane.java | 52 + .../generated/models/NetworkMode.java | 53 + .../generated/models/NetworkPlugin.java | 60 + .../generated/models/NetworkPluginMode.java | 47 + .../generated/models/NetworkPolicies.java | 113 + .../generated/models/NetworkPolicy.java | 65 + .../models/NginxIngressControllerType.java | 65 + .../models/NodeOSUpgradeChannel.java | 72 + .../NodeProvisioningDefaultNodePools.java | 56 + .../models/NodeProvisioningMode.java | 52 + .../generated/models/OSDiskType.java | 58 + .../generated/models/OSSKU.java | 89 + .../generated/models/OSType.java | 51 + .../generated/models/OperationValue.java | 61 + .../generated/models/Operations.java | 33 + .../models/OutboundEnvironmentEndpoint.java | 36 + .../generated/models/OutboundType.java | 74 + .../generated/models/PodIPAllocationMode.java | 57 + .../generated/models/PolicyRule.java | 56 + .../generated/models/PortRange.java | 147 + .../generated/models/PowerState.java | 85 + .../generated/models/PrivateEndpoint.java | 85 + .../models/PrivateEndpointConnection.java | 71 + .../PrivateEndpointConnectionListResult.java | 29 + ...teEndpointConnectionProvisioningState.java | 67 + .../models/PrivateEndpointConnections.java | 142 + .../generated/models/PrivateLinkResource.java | 65 + .../models/PrivateLinkResources.java | 48 + .../PrivateLinkResourcesListResult.java | 28 + .../PrivateLinkServiceConnectionState.java | 115 + .../generated/models/Protocol.java | 51 + .../models/ProxyRedirectionMechanism.java | 51 + .../generated/models/PublicNetworkAccess.java | 51 + .../models/RelativeMonthlySchedule.java | 142 + .../models/ResolvePrivateLinkServiceIds.java | 42 + .../models/ResourceIdentityType.java | 60 + .../generated/models/ResourceQuota.java | 197 + .../generated/models/ResourceReference.java | 85 + .../generated/models/RestrictionLevel.java | 51 + .../generated/models/RunCommandRequest.java | 142 + .../generated/models/RunCommandResult.java | 69 + .../generated/models/ScaleDownMode.java | 53 + .../generated/models/ScaleProfile.java | 87 + .../models/ScaleSetEvictionPolicy.java | 55 + .../generated/models/ScaleSetPriority.java | 52 + .../generated/models/Schedule.java | 174 + .../generated/models/ServiceMeshMode.java | 51 + .../generated/models/ServiceMeshProfile.java | 114 + .../generated/models/Snapshot.java | 320 ++ .../generated/models/SnapshotType.java | 46 + .../generated/models/Snapshots.java | 159 + .../generated/models/SysctlConfig.java | 841 +++ .../generated/models/TagsObject.java | 87 + .../generated/models/TimeInWeek.java | 121 + .../generated/models/TimeSpan.java | 120 + .../models/TransitEncryptionType.java | 53 + .../generated/models/TrustedAccessRole.java | 42 + .../models/TrustedAccessRoleBinding.java | 238 + ...tedAccessRoleBindingProvisioningState.java | 67 + .../models/TrustedAccessRoleBindings.java | 146 + .../models/TrustedAccessRoleRule.java | 143 + .../generated/models/TrustedAccessRoles.java | 36 + .../generated/models/Type.java | 66 + .../models/UndrainableNodeBehavior.java | 60 + .../generated/models/UpgradeChannel.java | 76 + .../models/UpgradeOverrideSettings.java | 129 + .../models/UserAssignedIdentity.java | 141 + .../generated/models/VirtualMachineNodes.java | 113 + .../models/VirtualMachinesProfile.java | 85 + .../generated/models/WeekDay.java | 76 + .../generated/models/WeeklySchedule.java | 114 + .../generated/models/WindowsGmsaProfile.java | 149 + .../generated/models/WorkloadRuntime.java | 58 + .../generated/models/package-info.java | 9 + .../generated/package-info.java | 9 + .../src/main/java/module-info.java | 16 + ...r-containerservice-generated_metadata.json | 1 + .../proxy-config.json | 1 + .../reflect-config.json | 1 + ...ager-containerservice-generated.properties | 1 + ...AgentPoolsAbortLatestOperationSamples.java | 24 + .../AgentPoolsCreateOrUpdateSamples.java | 556 ++ .../AgentPoolsDeleteMachinesSamples.java | 30 + .../generated/AgentPoolsDeleteSamples.java | 23 + ...sGetAvailableAgentPoolVersionsSamples.java | 24 + .../generated/AgentPoolsGetSamples.java | 23 + .../AgentPoolsGetUpgradeProfileSamples.java | 24 + .../generated/AgentPoolsListSamples.java | 23 + ...ntPoolsUpgradeNodeImageVersionSamples.java | 24 + .../generated/MachinesGetSamples.java | 25 + .../generated/MachinesListSamples.java | 23 + ...ceConfigurationsCreateOrUpdateSamples.java | 46 + ...aintenanceConfigurationsDeleteSamples.java | 25 + .../MaintenanceConfigurationsGetSamples.java | 25 + ...igurationsListByManagedClusterSamples.java | 24 + ...edClustersAbortLatestOperationSamples.java | 23 + .../ManagedClustersCreateOrUpdateSamples.java | 1512 ++++++ .../ManagedClustersDeleteSamples.java | 23 + ...anagedClustersGetAccessProfileSamples.java | 24 + ...agedClustersGetByResourceGroupSamples.java | 24 + ...anagedClustersGetCommandResultSamples.java | 40 + ...ClustersGetMeshRevisionProfileSamples.java | 24 + ...dClustersGetMeshUpgradeProfileSamples.java | 24 + ...nagedClustersGetUpgradeProfileSamples.java | 24 + ...gedClustersListByResourceGroupSamples.java | 23 + ...ersListClusterAdminCredentialsSamples.java | 24 + ...usterMonitoringUserCredentialsSamples.java | 25 + ...tersListClusterUserCredentialsSamples.java | 25 + ...ClustersListKubernetesVersionsSamples.java | 23 + ...ustersListMeshRevisionProfilesSamples.java | 23 + ...lustersListMeshUpgradeProfilesSamples.java | 23 + ...ndNetworkDependenciesEndpointsSamples.java | 24 + .../generated/ManagedClustersListSamples.java | 23 + ...ManagedClustersResetAADProfileSamples.java | 31 + ...rsResetServicePrincipalProfileSamples.java | 28 + ...stersRotateClusterCertificatesSamples.java | 23 + ...otateServiceAccountSigningKeysSamples.java | 24 + .../ManagedClustersRunCommandSamples.java | 30 + .../ManagedClustersStartSamples.java | 23 + .../generated/ManagedClustersStopSamples.java | 23 + .../ManagedClustersUpdateTagsSamples.java | 42 + ...anagedNamespacesCreateOrUpdateSamples.java | 58 + .../ManagedNamespacesDeleteSamples.java | 23 + .../ManagedNamespacesGetSamples.java | 24 + ...NamespacesListByManagedClusterSamples.java | 23 + ...anagedNamespacesListCredentialSamples.java | 24 + .../ManagedNamespacesUpdateSamples.java | 42 + .../generated/OperationsListSamples.java | 23 + ...ivateEndpointConnectionsDeleteSamples.java | 24 + .../PrivateEndpointConnectionsGetSamples.java | 24 + ...PrivateEndpointConnectionsListSamples.java | 23 + ...ivateEndpointConnectionsUpdateSamples.java | 31 + .../PrivateLinkResourcesListSamples.java | 23 + ...esolvePrivateLinkServiceIdPOSTSamples.java | 27 + .../SnapshotsCreateOrUpdateSamples.java | 46 + .../generated/SnapshotsDeleteSamples.java | 23 + .../SnapshotsGetByResourceGroupSamples.java | 23 + .../SnapshotsListByResourceGroupSamples.java | 23 + .../generated/SnapshotsListSamples.java | 23 + .../generated/SnapshotsUpdateTagsSamples.java | 42 + ...cessRoleBindingsCreateOrUpdateSamples.java | 32 + ...rustedAccessRoleBindingsDeleteSamples.java | 23 + .../TrustedAccessRoleBindingsGetSamples.java | 24 + .../TrustedAccessRoleBindingsListSamples.java | 23 + .../TrustedAccessRolesListSamples.java | 23 + .../AbsoluteMonthlyScheduleTests.java | 29 + .../generated/AccessProfileTests.java | 15 + .../AdvancedNetworkingObservabilityTests.java | 25 + .../AdvancedNetworkingPerformanceTests.java | 27 + .../AdvancedNetworkingSecurityTests.java | 37 + ...workingSecurityTransitEncryptionTests.java | 27 + .../generated/AdvancedNetworkingTests.java | 49 + .../AgentPoolAvailableVersionsInnerTests.java | 21 + ...sPropertiesAgentPoolVersionsItemTests.java | 21 + ...tPoolAvailableVersionsPropertiesTests.java | 21 + ...AgentPoolDeleteMachinesParameterTests.java | 28 + .../AgentPoolGatewayProfileTests.java | 25 + .../AgentPoolNetworkProfileTests.java | 48 + .../AgentPoolSecurityProfileTests.java | 33 + .../AgentPoolUpgradeProfileInnerTests.java | 24 + ...gentPoolUpgradeProfilePropertiesTests.java | 24 + ...adeProfilePropertiesUpgradesItemTests.java | 20 + .../AgentPoolUpgradeSettingsTests.java | 39 + .../AgentPoolWindowsProfileTests.java | 25 + ...gentPoolVersionsWithResponseMockTests.java | 41 + ...etUpgradeProfileWithResponseMockTests.java | 44 + ...PoolsUpgradeNodeImageVersionMockTests.java | 34 + .../ClusterUpgradeSettingsTests.java | 32 + .../generated/CompatibleVersionsTests.java | 20 + .../ContainerServiceNetworkProfileTests.java | 156 + .../generated/CreationDataTests.java | 25 + .../generated/CredentialResultTests.java | 16 + .../CredentialResultsInnerTests.java | 16 + .../generated/DailyScheduleTests.java | 24 + .../generated/generated/DateSpanTests.java | 21 + .../generated/DelegatedResourceTests.java | 35 + .../generated/EndpointDependencyTests.java | 23 + .../generated/EndpointDetailTests.java | 22 + .../generated/ExtendedLocationTests.java | 29 + .../generated/generated/GPUProfileTests.java | 25 + .../generated/generated/IPTagTests.java | 27 + .../generated/IstioComponentsTests.java | 53 + .../generated/IstioEgressGatewayTests.java | 35 + .../generated/IstioIngressGatewayTests.java | 29 + .../generated/KubeletConfigTests.java | 57 + .../KubernetesPatchVersionTests.java | 18 + .../KubernetesVersionCapabilitiesTests.java | 19 + ...KubernetesVersionListResultInnerTests.java | 25 + .../generated/KubernetesVersionTests.java | 24 + .../generated/LinuxOSConfigTests.java | 118 + .../generated/LocalDNSOverrideTests.java | 52 + .../generated/LocalDNSProfileTests.java | 128 + .../generated/MachineInnerTests.java | 17 + .../generated/MachineIpAddressTests.java | 16 + .../generated/MachineListResultTests.java | 19 + .../MachineNetworkPropertiesTests.java | 17 + .../generated/MachinePropertiesTests.java | 17 + .../MachinesGetWithResponseMockTests.java | 37 + .../generated/MachinesListMockTests.java | 37 + .../MaintenanceConfigurationInnerTests.java | 92 + ...intenanceConfigurationListResultTests.java | 46 + ...intenanceConfigurationPropertiesTests.java | 93 + ...nsCreateOrUpdateWithResponseMockTests.java | 91 + ...igurationsDeleteWithResponseMockTests.java | 33 + ...onfigurationsGetWithResponseMockTests.java | 55 + ...urationsListByManagedClusterMockTests.java | 65 + .../generated/MaintenanceWindowTests.java | 66 + ...lusterAIToolchainOperatorProfileTests.java | 26 + ...ManagedClusterAccessProfileInnerTests.java | 20 + ...nagedClusterAddonProfileIdentityTests.java | 21 + .../ManagedClusterAddonProfileTests.java | 43 + ...gedClusterApiServerAccessProfileTests.java | 46 + ...ManagedClusterAutoUpgradeProfileTests.java | 32 + ...reMonitorProfileKubeStateMetricsTests.java | 30 + ...lusterAzureMonitorProfileMetricsTests.java | 35 + ...anagedClusterAzureMonitorProfileTests.java | 38 + .../ManagedClusterBootstrapProfileTests.java | 31 + .../ManagedClusterCostAnalysisTests.java | 25 + .../ManagedClusterHttpProxyConfigTests.java | 39 + .../ManagedClusterIdentityTests.java | 69 + ...anagedClusterIngressProfileNginxTests.java | 28 + .../ManagedClusterIngressProfileTests.java | 40 + ...usterIngressProfileWebAppRoutingTests.java | 37 + ...alancerProfileManagedOutboundIPsTests.java | 29 + ...alancerProfileOutboundIPPrefixesTests.java | 31 + ...erLoadBalancerProfileOutboundIPsTests.java | 31 + ...anagedClusterLoadBalancerProfileTests.java | 59 + ...dClusterManagedOutboundIPProfileTests.java | 26 + .../ManagedClusterMetricsProfileTests.java | 27 + .../ManagedClusterNATGatewayProfileTests.java | 31 + ...edClusterNodeProvisioningProfileTests.java | 32 + ...dClusterNodeResourceGroupProfileTests.java | 27 + .../ManagedClusterOIDCIssuerProfileTests.java | 26 + ...nagedClusterPodIdentityExceptionTests.java | 46 + ...ManagedClusterPoolUpgradeProfileTests.java | 24 + ...erPoolUpgradeProfileUpgradesItemTests.java | 20 + ...usterPropertiesAutoScalerProfileTests.java | 85 + .../generated/ManagedClusterSKUTests.java | 30 + ...rofileDefenderSecurityMonitoringTests.java | 26 + ...edClusterSecurityProfileDefenderTests.java | 32 + ...usterSecurityProfileImageCleanerTests.java | 29 + ...rSecurityProfileWorkloadIdentityTests.java | 26 + ...lusterStaticEgressGatewayProfileTests.java | 26 + ...usterStorageProfileBlobCSIDriverTests.java | 26 + ...usterStorageProfileDiskCSIDriverTests.java | 26 + ...usterStorageProfileFileCSIDriverTests.java | 26 + ...StorageProfileSnapshotControllerTests.java | 26 + .../ManagedClusterStorageProfileTests.java | 40 + ...anagedClusterUpgradeProfileInnerTests.java | 29 + ...dClusterUpgradeProfilePropertiesTests.java | 29 + ...terWorkloadAutoScalerProfileKedaTests.java | 26 + ...ClusterWorkloadAutoScalerProfileTests.java | 33 + ...alerProfileVerticalPodAutoscalerTests.java | 27 + ...GetAccessProfileWithResponseMockTests.java | 40 + ...hRevisionProfileWithResponseMockTests.java | 40 + ...shUpgradeProfileWithResponseMockTests.java | 42 + ...etUpgradeProfileWithResponseMockTests.java | 47 + ...AdminCredentialsWithResponseMockTests.java | 37 + ...ingUserCredentialsWithResponMockTests.java | 37 + ...rUserCredentialsWithResponseMockTests.java | 38 + ...bernetesVersionsWithResponseMockTests.java | 46 + ...tersListMeshRevisionProfilesMockTests.java | 41 + ...stersListMeshUpgradeProfilesMockTests.java | 43 + ...NetworkDependenciesEndpointsMockTests.java | 48 + .../generated/ManagedNamespaceInnerTests.java | 81 + .../ManagedNamespaceListResultTests.java | 35 + ...agedNamespacesCreateOrUpdateMockTests.java | 83 + ...gedNamespacesGetWithResponseMockTests.java | 54 + ...mespacesListByManagedClusterMockTests.java | 57 + ...esListCredentialWithResponseMockTests.java | 37 + ...ntityUserAssignedIdentitiesValueTests.java | 24 + .../generated/ManualScaleProfileTests.java | 27 + .../MeshRevisionProfileInnerTests.java | 23 + .../MeshRevisionProfileListTests.java | 21 + .../MeshRevisionProfilePropertiesTests.java | 23 + .../generated/MeshRevisionTests.java | 22 + .../MeshUpgradeProfileInnerTests.java | 22 + .../MeshUpgradeProfileListTests.java | 24 + .../MeshUpgradeProfilePropertiesTests.java | 22 + .../generated/NamespacePropertiesTests.java | 72 + .../generated/NetworkPoliciesTests.java | 29 + .../generated/OperationListResultTests.java | 19 + .../generated/OperationValueDisplayTests.java | 18 + .../generated/OperationValueInnerTests.java | 17 + .../generated/OperationsListMockTests.java | 36 + ...undEnvironmentEndpointCollectionTests.java | 21 + ...OutboundEnvironmentEndpointInnerTests.java | 24 + .../generated/generated/PortRangeTests.java | 31 + .../PrivateEndpointConnectionInnerTests.java | 37 + ...ndpointConnectionListResultInnerTests.java | 23 + ...vateEndpointConnectionPropertiesTests.java | 37 + ...ateEndpointConnectionsDeleteMockTests.java | 33 + ...ntConnectionsGetWithResponseMockTests.java | 42 + ...tConnectionsListWithResponseMockTests.java | 44 + ...onnectionsUpdateWithResponseMockTests.java | 50 + .../generated/PrivateEndpointTests.java | 24 + .../PrivateLinkResourceInnerTests.java | 39 + ...vateLinkResourcesListResultInnerTests.java | 23 + ...inkResourcesListWithResponseMockTests.java | 43 + ...rivateLinkServiceConnectionStateTests.java | 30 + .../RelativeMonthlyScheduleTests.java | 34 + ...nkServiceIdsPOSTWithResponseMockTests.java | 51 + .../generated/ResourceQuotaTests.java | 35 + .../generated/ResourceReferenceTests.java | 24 + .../generated/ScaleProfileTests.java | 30 + .../generated/generated/ScheduleTests.java | 52 + .../generated/SnapshotInnerTests.java | 51 + .../generated/SnapshotListResultTests.java | 24 + .../generated/SnapshotPropertiesTests.java | 32 + ...tsCreateOrUpdateWithResponseMockTests.java | 63 + ...eByResourceGroupWithResponseMockTests.java | 34 + ...tByResourceGroupWithResponseMockTests.java | 43 + ...SnapshotsListByResourceGroupMockTests.java | 43 + .../generated/SnapshotsListMockTests.java | 42 + .../generated/SysctlConfigTests.java | 107 + .../generated/generated/TagsObjectTests.java | 41 + .../generated/generated/TimeInWeekTests.java | 31 + .../generated/generated/TimeSpanTests.java | 29 + .../TrustedAccessRoleBindingInnerTests.java | 30 + ...ustedAccessRoleBindingListResultTests.java | 21 + ...ustedAccessRoleBindingPropertiesTests.java | 31 + ...ssRoleBindingsCreateOrUpdateMockTests.java | 44 + ...sRoleBindingsGetWithResponseMockTests.java | 40 + ...rustedAccessRoleBindingsListMockTests.java | 40 + .../TrustedAccessRoleInnerTests.java | 17 + .../TrustedAccessRoleListResultTests.java | 19 + .../generated/TrustedAccessRoleRuleTests.java | 17 + .../TrustedAccessRolesListMockTests.java | 37 + .../UpgradeOverrideSettingsTests.java | 30 + .../generated/UserAssignedIdentityTests.java | 31 + .../generated/VirtualMachineNodesTests.java | 27 + .../VirtualMachinesProfileTests.java | 34 + .../generated/WeeklyScheduleTests.java | 28 + .../generated/WindowsGmsaProfileTests.java | 32 + .../tsp-location.yaml | 4 + sdk/containerservice/ci.yml | 16 +- sdk/containerservice/pom.xml | 1 + 619 files changed, 78311 insertions(+), 4 deletions(-) create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/CHANGELOG.md create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/README.md create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/SAMPLE.md create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/pom.xml create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/ContainerServiceManager.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/AgentPoolsClient.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/ContainerServiceManagementClient.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/MachinesClient.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/MaintenanceConfigurationsClient.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/ManagedClustersClient.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/ManagedNamespacesClient.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/OperationsClient.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/PrivateEndpointConnectionsClient.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/PrivateLinkResourcesClient.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/ResolvePrivateLinkServiceIdsClient.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/SnapshotsClient.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/TrustedAccessRoleBindingsClient.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/TrustedAccessRolesClient.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AccessProfile.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AgentPoolAvailableVersionsInner.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AgentPoolAvailableVersionsProperties.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AgentPoolInner.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AgentPoolUpgradeProfileInner.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AgentPoolUpgradeProfileProperties.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/CommandResultProperties.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/CredentialResultsInner.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/KubernetesVersionListResultInner.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/MachineInner.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/MaintenanceConfigurationInner.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/MaintenanceConfigurationProperties.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterAccessProfileInner.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterAgentPoolProfileProperties.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterInner.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterProperties.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterUpgradeProfileInner.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterUpgradeProfileProperties.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedNamespaceInner.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/MeshRevisionProfileInner.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/MeshUpgradeProfileInner.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/OperationValueDisplay.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/OperationValueInner.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/OutboundEnvironmentEndpointInner.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/PrivateEndpointConnectionInner.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/PrivateEndpointConnectionListResultInner.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/PrivateEndpointConnectionProperties.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/PrivateLinkResourceInner.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/PrivateLinkResourcesListResultInner.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/RunCommandResultInner.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/SnapshotInner.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/SnapshotProperties.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/TrustedAccessRoleBindingInner.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/TrustedAccessRoleBindingProperties.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/TrustedAccessRoleInner.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/package-info.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/package-info.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/AgentPoolAvailableVersionsImpl.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/AgentPoolImpl.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/AgentPoolUpgradeProfileImpl.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/AgentPoolsClientImpl.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/AgentPoolsImpl.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ContainerServiceManagementClientBuilder.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ContainerServiceManagementClientImpl.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/CredentialResultsImpl.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/KubernetesVersionListResultImpl.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MachineImpl.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MachinesClientImpl.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MachinesImpl.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MaintenanceConfigurationImpl.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MaintenanceConfigurationsClientImpl.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MaintenanceConfigurationsImpl.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClusterAccessProfileImpl.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClusterImpl.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClusterUpgradeProfileImpl.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClustersClientImpl.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClustersImpl.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedNamespaceImpl.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedNamespacesClientImpl.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedNamespacesImpl.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MeshRevisionProfileImpl.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MeshUpgradeProfileImpl.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OperationValueImpl.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OperationsClientImpl.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OperationsImpl.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OutboundEnvironmentEndpointImpl.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateEndpointConnectionImpl.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateEndpointConnectionListResultImpl.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateEndpointConnectionsClientImpl.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateEndpointConnectionsImpl.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateLinkResourceImpl.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateLinkResourcesClientImpl.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateLinkResourcesImpl.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateLinkResourcesListResultImpl.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ResolvePrivateLinkServiceIdsClientImpl.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ResolvePrivateLinkServiceIdsImpl.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ResourceManagerUtils.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/RunCommandResultImpl.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/SnapshotImpl.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/SnapshotsClientImpl.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/SnapshotsImpl.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/TrustedAccessRoleBindingImpl.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/TrustedAccessRoleBindingsClientImpl.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/TrustedAccessRoleBindingsImpl.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/TrustedAccessRoleImpl.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/TrustedAccessRolesClientImpl.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/TrustedAccessRolesImpl.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/AgentPoolListResult.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/MachineListResult.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/MaintenanceConfigurationListResult.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/ManagedClusterListResult.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/ManagedNamespaceListResult.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/MeshRevisionProfileList.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/MeshUpgradeProfileList.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/OperationListResult.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/OutboundEnvironmentEndpointCollection.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/SnapshotListResult.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/TrustedAccessRoleBindingListResult.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/TrustedAccessRoleListResult.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/package-info.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AbsoluteMonthlySchedule.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AccelerationMode.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AdoptionPolicy.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AdvancedNetworkPolicies.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AdvancedNetworking.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AdvancedNetworkingObservability.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AdvancedNetworkingPerformance.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AdvancedNetworkingSecurity.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AdvancedNetworkingSecurityTransitEncryption.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPool.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolAvailableVersions.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolDeleteMachinesParameter.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolGatewayProfile.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolMode.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolNetworkProfile.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolSSHAccess.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolSecurityProfile.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolStatus.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolType.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolUpgradeProfile.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolUpgradeProfilePropertiesUpgradesItem.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolUpgradeSettings.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolWindowsProfile.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPools.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ArtifactSource.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AzureKeyVaultKms.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/BackendPoolType.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ClusterUpgradeSettings.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Code.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/CompatibleVersions.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ConnectionStatus.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceLinuxProfile.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceNetworkProfile.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceSshConfiguration.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceSshPublicKey.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/CreationData.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/CredentialResult.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/CredentialResults.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/DailySchedule.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/DateSpan.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/DelegatedResource.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/DeletePolicy.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/EndpointDependency.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/EndpointDetail.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Expander.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ExtendedLocation.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ExtendedLocationTypes.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Format.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/GPUDriver.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/GPUInstanceProfile.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/GPUProfile.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/IPFamily.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/IPTag.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/IstioCertificateAuthority.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/IstioComponents.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/IstioEgressGateway.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/IstioIngressGateway.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/IstioIngressGatewayMode.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/IstioPluginCertificateAuthority.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/IstioServiceMesh.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/KeyVaultNetworkAccessTypes.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/KubeletConfig.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/KubeletDiskType.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/KubernetesPatchVersion.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/KubernetesSupportPlan.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/KubernetesVersion.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/KubernetesVersionCapabilities.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/KubernetesVersionListResult.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LicenseType.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LinuxOSConfig.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LoadBalancerSku.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LocalDNSForwardDestination.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LocalDNSForwardPolicy.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LocalDNSMode.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LocalDNSOverride.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LocalDNSProfile.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LocalDNSProtocol.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LocalDNSQueryLogging.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LocalDNSServeStale.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LocalDNSState.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Machine.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MachineIpAddress.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MachineNetworkProperties.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MachineProperties.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Machines.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MaintenanceConfiguration.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MaintenanceConfigurations.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MaintenanceWindow.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedCluster.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAADProfile.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAIToolchainOperatorProfile.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAccessProfile.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAddonProfile.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAddonProfileIdentity.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAgentPoolProfile.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterApiServerAccessProfile.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAutoUpgradeProfile.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAzureMonitorProfile.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAzureMonitorProfileKubeStateMetrics.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAzureMonitorProfileMetrics.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterBootstrapProfile.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterCostAnalysis.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterHttpProxyConfig.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterIdentity.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterIngressProfile.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterIngressProfileNginx.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterIngressProfileWebAppRouting.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterLoadBalancerProfile.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterLoadBalancerProfileManagedOutboundIPs.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterLoadBalancerProfileOutboundIPPrefixes.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterLoadBalancerProfileOutboundIPs.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterManagedOutboundIPProfile.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterMetricsProfile.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterNATGatewayProfile.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterNodeProvisioningProfile.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterNodeResourceGroupProfile.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterOIDCIssuerProfile.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentity.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityException.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityProfile.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityProvisioningError.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityProvisioningErrorBody.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityProvisioningInfo.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityProvisioningState.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPoolUpgradeProfile.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPoolUpgradeProfileUpgradesItem.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPropertiesAutoScalerProfile.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSKU.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSKUName.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSKUTier.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSecurityProfile.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSecurityProfileDefender.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSecurityProfileDefenderSecurityMonitoring.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSecurityProfileImageCleaner.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSecurityProfileWorkloadIdentity.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterServicePrincipalProfile.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterStaticEgressGatewayProfile.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterStatus.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterStorageProfile.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterStorageProfileBlobCSIDriver.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterStorageProfileDiskCSIDriver.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterStorageProfileFileCSIDriver.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterStorageProfileSnapshotController.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterUpgradeProfile.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterWindowsProfile.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterWorkloadAutoScalerProfile.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterWorkloadAutoScalerProfileKeda.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusters.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClustersGetCommandResultHeaders.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClustersGetCommandResultResponse.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedNamespace.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedNamespaces.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedServiceIdentityUserAssignedIdentitiesValue.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManualScaleProfile.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MeshRevision.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MeshRevisionProfile.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MeshRevisionProfileProperties.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MeshUpgradeProfile.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MeshUpgradeProfileProperties.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NamespaceProperties.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NamespaceProvisioningState.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NetworkDataplane.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NetworkMode.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NetworkPlugin.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NetworkPluginMode.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NetworkPolicies.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NetworkPolicy.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NginxIngressControllerType.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NodeOSUpgradeChannel.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NodeProvisioningDefaultNodePools.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NodeProvisioningMode.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OSDiskType.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OSSKU.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OSType.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OperationValue.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Operations.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OutboundEnvironmentEndpoint.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OutboundType.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PodIPAllocationMode.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PolicyRule.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PortRange.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PowerState.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateEndpoint.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateEndpointConnection.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateEndpointConnectionListResult.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateEndpointConnectionProvisioningState.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateEndpointConnections.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateLinkResource.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateLinkResources.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateLinkResourcesListResult.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateLinkServiceConnectionState.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Protocol.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ProxyRedirectionMechanism.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PublicNetworkAccess.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/RelativeMonthlySchedule.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ResolvePrivateLinkServiceIds.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ResourceIdentityType.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ResourceQuota.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ResourceReference.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/RestrictionLevel.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/RunCommandRequest.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/RunCommandResult.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ScaleDownMode.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ScaleProfile.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ScaleSetEvictionPolicy.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ScaleSetPriority.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Schedule.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ServiceMeshMode.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ServiceMeshProfile.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Snapshot.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/SnapshotType.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Snapshots.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/SysctlConfig.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TagsObject.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TimeInWeek.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TimeSpan.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TransitEncryptionType.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TrustedAccessRole.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TrustedAccessRoleBinding.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TrustedAccessRoleBindingProvisioningState.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TrustedAccessRoleBindings.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TrustedAccessRoleRule.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TrustedAccessRoles.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Type.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/UndrainableNodeBehavior.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/UpgradeChannel.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/UpgradeOverrideSettings.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/UserAssignedIdentity.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/VirtualMachineNodes.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/VirtualMachinesProfile.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/WeekDay.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/WeeklySchedule.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/WindowsGmsaProfile.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/WorkloadRuntime.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/package-info.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/package-info.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/module-info.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/resources/META-INF/azure-resourcemanager-containerservice-generated_metadata.json create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-containerservice-generated/proxy-config.json create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-containerservice-generated/reflect-config.json create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/resources/azure-resourcemanager-containerservice-generated.properties create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsAbortLatestOperationSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsCreateOrUpdateSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsDeleteMachinesSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsDeleteSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsGetAvailableAgentPoolVersionsSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsGetSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsGetUpgradeProfileSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsListSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsUpgradeNodeImageVersionSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/MachinesGetSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/MachinesListSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationsCreateOrUpdateSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationsDeleteSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationsGetSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationsListByManagedClusterSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersAbortLatestOperationSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersCreateOrUpdateSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersDeleteSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetAccessProfileSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetByResourceGroupSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetCommandResultSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetMeshRevisionProfileSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetMeshUpgradeProfileSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetUpgradeProfileSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListByResourceGroupSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListClusterAdminCredentialsSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListClusterMonitoringUserCredentialsSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListClusterUserCredentialsSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListKubernetesVersionsSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListMeshRevisionProfilesSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListMeshUpgradeProfilesSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListOutboundNetworkDependenciesEndpointsSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersResetAADProfileSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersResetServicePrincipalProfileSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersRotateClusterCertificatesSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersRotateServiceAccountSigningKeysSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersRunCommandSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersStartSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersStopSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersUpdateTagsSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedNamespacesCreateOrUpdateSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedNamespacesDeleteSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedNamespacesGetSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedNamespacesListByManagedClusterSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedNamespacesListCredentialSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedNamespacesUpdateSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/OperationsListSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionsDeleteSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionsGetSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionsListSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionsUpdateSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateLinkResourcesListSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ResolvePrivateLinkServiceIdPOSTSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsCreateOrUpdateSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsDeleteSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsGetByResourceGroupSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsListByResourceGroupSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsListSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsUpdateTagsSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleBindingsCreateOrUpdateSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleBindingsDeleteSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleBindingsGetSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleBindingsListSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRolesListSamples.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AbsoluteMonthlyScheduleTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AccessProfileTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AdvancedNetworkingObservabilityTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AdvancedNetworkingPerformanceTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AdvancedNetworkingSecurityTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AdvancedNetworkingSecurityTransitEncryptionTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AdvancedNetworkingTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolAvailableVersionsInnerTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItemTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolAvailableVersionsPropertiesTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolDeleteMachinesParameterTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolGatewayProfileTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolNetworkProfileTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolSecurityProfileTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolUpgradeProfileInnerTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolUpgradeProfilePropertiesTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolUpgradeProfilePropertiesUpgradesItemTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolUpgradeSettingsTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolWindowsProfileTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsGetAvailableAgentPoolVersionsWithResponseMockTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsGetUpgradeProfileWithResponseMockTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsUpgradeNodeImageVersionMockTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ClusterUpgradeSettingsTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/CompatibleVersionsTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ContainerServiceNetworkProfileTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/CreationDataTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/CredentialResultTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/CredentialResultsInnerTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/DailyScheduleTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/DateSpanTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/DelegatedResourceTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/EndpointDependencyTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/EndpointDetailTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ExtendedLocationTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/GPUProfileTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/IPTagTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/IstioComponentsTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/IstioEgressGatewayTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/IstioIngressGatewayTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/KubeletConfigTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/KubernetesPatchVersionTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/KubernetesVersionCapabilitiesTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/KubernetesVersionListResultInnerTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/KubernetesVersionTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/LinuxOSConfigTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/LocalDNSOverrideTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/LocalDNSProfileTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MachineInnerTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MachineIpAddressTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MachineListResultTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MachineNetworkPropertiesTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MachinePropertiesTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MachinesGetWithResponseMockTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MachinesListMockTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationInnerTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationListResultTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationPropertiesTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationsCreateOrUpdateWithResponseMockTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationsDeleteWithResponseMockTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationsGetWithResponseMockTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationsListByManagedClusterMockTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceWindowTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterAIToolchainOperatorProfileTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterAccessProfileInnerTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterAddonProfileIdentityTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterAddonProfileTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterApiServerAccessProfileTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterAutoUpgradeProfileTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterAzureMonitorProfileKubeStateMetricsTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterAzureMonitorProfileMetricsTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterAzureMonitorProfileTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterBootstrapProfileTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterCostAnalysisTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterHttpProxyConfigTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterIdentityTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterIngressProfileNginxTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterIngressProfileTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterIngressProfileWebAppRoutingTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterLoadBalancerProfileManagedOutboundIPsTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterLoadBalancerProfileOutboundIPPrefixesTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterLoadBalancerProfileOutboundIPsTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterLoadBalancerProfileTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterManagedOutboundIPProfileTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterMetricsProfileTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterNATGatewayProfileTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterNodeProvisioningProfileTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterNodeResourceGroupProfileTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterOIDCIssuerProfileTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterPodIdentityExceptionTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterPoolUpgradeProfileTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterPoolUpgradeProfileUpgradesItemTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterPropertiesAutoScalerProfileTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterSKUTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterSecurityProfileDefenderSecurityMonitoringTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterSecurityProfileDefenderTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterSecurityProfileImageCleanerTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterSecurityProfileWorkloadIdentityTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterStaticEgressGatewayProfileTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterStorageProfileBlobCSIDriverTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterStorageProfileDiskCSIDriverTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterStorageProfileFileCSIDriverTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterStorageProfileSnapshotControllerTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterStorageProfileTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterUpgradeProfileInnerTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterUpgradeProfilePropertiesTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterWorkloadAutoScalerProfileKedaTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterWorkloadAutoScalerProfileTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscalerTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetAccessProfileWithResponseMockTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetMeshRevisionProfileWithResponseMockTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetMeshUpgradeProfileWithResponseMockTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetUpgradeProfileWithResponseMockTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListClusterAdminCredentialsWithResponseMockTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListClusterMonitoringUserCredentialsWithResponMockTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListClusterUserCredentialsWithResponseMockTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListKubernetesVersionsWithResponseMockTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListMeshRevisionProfilesMockTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListMeshUpgradeProfilesMockTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListOutboundNetworkDependenciesEndpointsMockTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedNamespaceInnerTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedNamespaceListResultTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedNamespacesCreateOrUpdateMockTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedNamespacesGetWithResponseMockTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedNamespacesListByManagedClusterMockTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedNamespacesListCredentialWithResponseMockTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedServiceIdentityUserAssignedIdentitiesValueTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManualScaleProfileTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MeshRevisionProfileInnerTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MeshRevisionProfileListTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MeshRevisionProfilePropertiesTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MeshRevisionTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MeshUpgradeProfileInnerTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MeshUpgradeProfileListTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MeshUpgradeProfilePropertiesTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/NamespacePropertiesTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/NetworkPoliciesTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/OperationListResultTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/OperationValueDisplayTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/OperationValueInnerTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/OperationsListMockTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/OutboundEnvironmentEndpointCollectionTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/OutboundEnvironmentEndpointInnerTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PortRangeTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionInnerTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionListResultInnerTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionPropertiesTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionsDeleteMockTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionsListWithResponseMockTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionsUpdateWithResponseMockTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateLinkResourceInnerTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateLinkResourcesListResultInnerTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateLinkResourcesListWithResponseMockTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateLinkServiceConnectionStateTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/RelativeMonthlyScheduleTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ResolvePrivateLinkServiceIdsPOSTWithResponseMockTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ResourceQuotaTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ResourceReferenceTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ScaleProfileTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ScheduleTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotInnerTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotListResultTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotPropertiesTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsCreateOrUpdateWithResponseMockTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsDeleteByResourceGroupWithResponseMockTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsGetByResourceGroupWithResponseMockTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsListByResourceGroupMockTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsListMockTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/SysctlConfigTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TagsObjectTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TimeInWeekTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TimeSpanTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleBindingInnerTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleBindingListResultTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleBindingPropertiesTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleBindingsCreateOrUpdateMockTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleBindingsGetWithResponseMockTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleBindingsListMockTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleInnerTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleListResultTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleRuleTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRolesListMockTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/UpgradeOverrideSettingsTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/UserAssignedIdentityTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/VirtualMachineNodesTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/VirtualMachinesProfileTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/WeeklyScheduleTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/WindowsGmsaProfileTests.java create mode 100644 sdk/containerservice/azure-resourcemanager-containerservice-generated/tsp-location.yaml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 48e0e7ac5038..1936ccfc4681 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -521,6 +521,7 @@ com.azure.resourcemanager:azure-resourcemanager-virtualenclaves;1.0.0-beta.1;1.0 com.azure.resourcemanager:azure-resourcemanager-edgeactions;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-computebulkactions;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-artifactsigning;1.0.0;1.1.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-containerservice-generated;1.0.0;1.0.0 com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1 com.azure.tools:azure-sdk-build-tool;1.0.0;1.1.0-beta.1 com.azure.v2:azure-client-sdk-parent;2.0.0-beta.2;2.0.0-beta.2 diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/CHANGELOG.md b/sdk/containerservice/azure-resourcemanager-containerservice-generated/CHANGELOG.md new file mode 100644 index 000000000000..15cb51709c87 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/CHANGELOG.md @@ -0,0 +1,8 @@ +# Release History + +## 1.0.0 (2026-03-10) + +- Azure Resource Manager Container Service client library for Java. This package contains Microsoft Azure SDK for Container Service Management SDK. The Container Service Client. Package api-version 2026-01-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +### Features Added + +- Initial release for the azure-resourcemanager-containerservice-generated Java SDK. diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/README.md b/sdk/containerservice/azure-resourcemanager-containerservice-generated/README.md new file mode 100644 index 000000000000..b04c3a34ab94 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/README.md @@ -0,0 +1,102 @@ +# Azure Resource Manager Container Service client library for Java + +Azure Resource Manager Container Service client library for Java. + +This package contains Microsoft Azure SDK for Container Service Management SDK. The Container Service Client. Package api-version 2026-01-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-containerservice-generated;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-containerservice-generated + 1.0.0 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. + +### Authentication + +Microsoft Entra ID token authentication relies on the [credential class][azure_identity_credentials] from [Azure Identity][azure_identity] package. + +Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. + +Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: + +```java +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +ContainerServiceManager manager = ContainerServiceManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/containerservice/azure-resourcemanager-containerservice-generated/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide][cg]. + +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#credentials +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/SAMPLE.md b/sdk/containerservice/azure-resourcemanager-containerservice-generated/SAMPLE.md new file mode 100644 index 000000000000..08cbdbc375cd --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/SAMPLE.md @@ -0,0 +1,3787 @@ +# Code snippets and samples + + +## AgentPools + +- [AbortLatestOperation](#agentpools_abortlatestoperation) +- [CreateOrUpdate](#agentpools_createorupdate) +- [Delete](#agentpools_delete) +- [DeleteMachines](#agentpools_deletemachines) +- [Get](#agentpools_get) +- [GetAvailableAgentPoolVersions](#agentpools_getavailableagentpoolversions) +- [GetUpgradeProfile](#agentpools_getupgradeprofile) +- [List](#agentpools_list) +- [UpgradeNodeImageVersion](#agentpools_upgradenodeimageversion) + +## Machines + +- [Get](#machines_get) +- [List](#machines_list) + +## MaintenanceConfigurations + +- [CreateOrUpdate](#maintenanceconfigurations_createorupdate) +- [Delete](#maintenanceconfigurations_delete) +- [Get](#maintenanceconfigurations_get) +- [ListByManagedCluster](#maintenanceconfigurations_listbymanagedcluster) + +## ManagedClusters + +- [AbortLatestOperation](#managedclusters_abortlatestoperation) +- [CreateOrUpdate](#managedclusters_createorupdate) +- [Delete](#managedclusters_delete) +- [GetAccessProfile](#managedclusters_getaccessprofile) +- [GetByResourceGroup](#managedclusters_getbyresourcegroup) +- [GetCommandResult](#managedclusters_getcommandresult) +- [GetMeshRevisionProfile](#managedclusters_getmeshrevisionprofile) +- [GetMeshUpgradeProfile](#managedclusters_getmeshupgradeprofile) +- [GetUpgradeProfile](#managedclusters_getupgradeprofile) +- [List](#managedclusters_list) +- [ListByResourceGroup](#managedclusters_listbyresourcegroup) +- [ListClusterAdminCredentials](#managedclusters_listclusteradmincredentials) +- [ListClusterMonitoringUserCredentials](#managedclusters_listclustermonitoringusercredentials) +- [ListClusterUserCredentials](#managedclusters_listclusterusercredentials) +- [ListKubernetesVersions](#managedclusters_listkubernetesversions) +- [ListMeshRevisionProfiles](#managedclusters_listmeshrevisionprofiles) +- [ListMeshUpgradeProfiles](#managedclusters_listmeshupgradeprofiles) +- [ListOutboundNetworkDependenciesEndpoints](#managedclusters_listoutboundnetworkdependenciesendpoints) +- [ResetAADProfile](#managedclusters_resetaadprofile) +- [ResetServicePrincipalProfile](#managedclusters_resetserviceprincipalprofile) +- [RotateClusterCertificates](#managedclusters_rotateclustercertificates) +- [RotateServiceAccountSigningKeys](#managedclusters_rotateserviceaccountsigningkeys) +- [RunCommand](#managedclusters_runcommand) +- [Start](#managedclusters_start) +- [Stop](#managedclusters_stop) +- [UpdateTags](#managedclusters_updatetags) + +## ManagedNamespaces + +- [CreateOrUpdate](#managednamespaces_createorupdate) +- [Delete](#managednamespaces_delete) +- [Get](#managednamespaces_get) +- [ListByManagedCluster](#managednamespaces_listbymanagedcluster) +- [ListCredential](#managednamespaces_listcredential) +- [Update](#managednamespaces_update) + +## Operations + +- [List](#operations_list) + +## PrivateEndpointConnections + +- [Delete](#privateendpointconnections_delete) +- [Get](#privateendpointconnections_get) +- [List](#privateendpointconnections_list) +- [Update](#privateendpointconnections_update) + +## PrivateLinkResources + +- [List](#privatelinkresources_list) + +## ResolvePrivateLinkServiceId + +- [POST](#resolveprivatelinkserviceid_post) + +## Snapshots + +- [CreateOrUpdate](#snapshots_createorupdate) +- [Delete](#snapshots_delete) +- [GetByResourceGroup](#snapshots_getbyresourcegroup) +- [List](#snapshots_list) +- [ListByResourceGroup](#snapshots_listbyresourcegroup) +- [UpdateTags](#snapshots_updatetags) + +## TrustedAccessRoleBindings + +- [CreateOrUpdate](#trustedaccessrolebindings_createorupdate) +- [Delete](#trustedaccessrolebindings_delete) +- [Get](#trustedaccessrolebindings_get) +- [List](#trustedaccessrolebindings_list) + +## TrustedAccessRoles + +- [List](#trustedaccessroles_list) +### AgentPools_AbortLatestOperation + +```java +/** + * Samples for AgentPools AbortLatestOperation. + */ +public final class AgentPoolsAbortLatestOperationSamples { + /* + * x-ms-original-file: 2026-01-01/AgentPoolsAbortOperation.json + */ + /** + * Sample code: Abort operation on agent pool. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void abortOperationOnAgentPool( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .abortLatestOperation("rg1", "clustername1", "agentpool1", com.azure.core.util.Context.NONE); + } +} +``` + +### AgentPools_CreateOrUpdate + +```java +import com.azure.resourcemanager.containerservice.generated.models.AgentPool; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolMode; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolType; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolWindowsProfile; +import com.azure.resourcemanager.containerservice.generated.models.Code; +import com.azure.resourcemanager.containerservice.generated.models.CreationData; +import com.azure.resourcemanager.containerservice.generated.models.GPUInstanceProfile; +import com.azure.resourcemanager.containerservice.generated.models.KubeletConfig; +import com.azure.resourcemanager.containerservice.generated.models.LinuxOSConfig; +import com.azure.resourcemanager.containerservice.generated.models.ManualScaleProfile; +import com.azure.resourcemanager.containerservice.generated.models.OSDiskType; +import com.azure.resourcemanager.containerservice.generated.models.OSSKU; +import com.azure.resourcemanager.containerservice.generated.models.OSType; +import com.azure.resourcemanager.containerservice.generated.models.PowerState; +import com.azure.resourcemanager.containerservice.generated.models.ScaleProfile; +import com.azure.resourcemanager.containerservice.generated.models.ScaleSetEvictionPolicy; +import com.azure.resourcemanager.containerservice.generated.models.ScaleSetPriority; +import com.azure.resourcemanager.containerservice.generated.models.SysctlConfig; +import com.azure.resourcemanager.containerservice.generated.models.VirtualMachinesProfile; +import com.azure.resourcemanager.containerservice.generated.models.WorkloadRuntime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for AgentPools CreateOrUpdate. + */ +public final class AgentPoolsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-01-01/AgentPoolsCreate_EnableFIPS.json + */ + /** + * Sample code: Create Agent Pool with FIPS enabled OS. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolWithFIPSEnabledOS( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withOrchestratorVersion("") + .withEnableFIPS(true) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/AgentPoolsCreate_GPUMIG.json + */ + /** + * Sample code: Create Agent Pool with GPUMIG. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolWithGPUMIG( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_ND96asr_v4") + .withOsType(OSType.LINUX) + .withOrchestratorVersion("") + .withKubeletConfig(new KubeletConfig().withCpuManagerPolicy("static") + .withCpuCfsQuota(true) + .withCpuCfsQuotaPeriod("200ms") + .withImageGcHighThreshold(90) + .withImageGcLowThreshold(70) + .withTopologyManagerPolicy("best-effort") + .withAllowedUnsafeSysctls(Arrays.asList("kernel.msg*", "net.core.somaxconn")) + .withFailSwapOn(false)) + .withLinuxOSConfig(new LinuxOSConfig() + .withSysctls(new SysctlConfig().withNetCoreWmemDefault(12345) + .withNetIpv4TcpTwReuse(true) + .withNetIpv4IpLocalPortRange("20000 60000") + .withKernelThreadsMax(99999)) + .withTransparentHugePageEnabled("always") + .withTransparentHugePageDefrag("madvise") + .withSwapFileSizeMB(1500)) + .withGpuInstanceProfile(GPUInstanceProfile.MIG2G) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/AgentPoolsCreate_WindowsOSSKU.json + */ + /** + * Sample code: Create Agent Pool with Windows OSSKU. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolWithWindowsOSSKU( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .define("wnp2") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_D4s_v3") + .withOsType(OSType.WINDOWS) + .withOsSKU(OSSKU.WINDOWS2022) + .withOrchestratorVersion("1.23.3") + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/AgentPoolsCreate_DedicatedHostGroup.json + */ + /** + * Sample code: Create Agent Pool with Dedicated Host Group. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolWithDedicatedHostGroup( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withOrchestratorVersion("") + .withHostGroupID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1") + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/AgentPoolsCreate_Update.json + */ + /** + * Sample code: Create/Update Agent Pool. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + createUpdateAgentPool(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withTags(mapOf("name1", "val1")) + .withCount(3) + .withVmSize("Standard_DS1_v2") + .withOsType(OSType.LINUX) + .withMode(AgentPoolMode.USER) + .withOrchestratorVersion("") + .withScaleSetPriority(ScaleSetPriority.SPOT) + .withScaleSetEvictionPolicy(ScaleSetEvictionPolicy.DELETE) + .withNodeLabels(mapOf("key1", "fakeTokenPlaceholder")) + .withNodeTaints(Arrays.asList("Key1=Value1:NoSchedule")) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/AgentPoolsCreate_WindowsDisableOutboundNAT.json + */ + /** + * Sample code: Create Windows Agent Pool with disabling OutboundNAT. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createWindowsAgentPoolWithDisablingOutboundNAT( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .define("wnp2") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_D4s_v3") + .withOsType(OSType.WINDOWS) + .withOsSKU(OSSKU.WINDOWS2022) + .withOrchestratorVersion("1.23.8") + .withWindowsProfile(new AgentPoolWindowsProfile().withDisableOutboundNat(true)) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/AgentPools_Start.json + */ + /** + * Sample code: Start Agent Pool. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + startAgentPool(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withPowerState(new PowerState().withCode(Code.RUNNING)) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/AgentPoolsCreate_Spot.json + */ + /** + * Sample code: Create Spot Agent Pool. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + createSpotAgentPool(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withTags(mapOf("name1", "val1")) + .withCount(3) + .withVmSize("Standard_DS1_v2") + .withOsType(OSType.LINUX) + .withOrchestratorVersion("") + .withScaleSetPriority(ScaleSetPriority.SPOT) + .withScaleSetEvictionPolicy(ScaleSetEvictionPolicy.DELETE) + .withNodeLabels(mapOf("key1", "fakeTokenPlaceholder")) + .withNodeTaints(Arrays.asList("Key1=Value1:NoSchedule")) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/AgentPoolsCreate_Ephemeral.json + */ + /** + * Sample code: Create Agent Pool with Ephemeral OS Disk. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolWithEphemeralOSDisk( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsDiskSizeGB(64) + .withOsDiskType(OSDiskType.EPHEMERAL) + .withOsType(OSType.LINUX) + .withOrchestratorVersion("") + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/AgentPoolsCreate_EnableEncryptionAtHost.json + */ + /** + * Sample code: Create Agent Pool with EncryptionAtHost enabled. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolWithEncryptionAtHostEnabled( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withOrchestratorVersion("") + .withEnableEncryptionAtHost(true) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/AgentPoolsCreate_EnableUltraSSD.json + */ + /** + * Sample code: Create Agent Pool with UltraSSD enabled. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolWithUltraSSDEnabled( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withOrchestratorVersion("") + .withEnableUltraSSD(true) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/AgentPoolsCreate_WasmWasi.json + */ + /** + * Sample code: Create Agent Pool with Krustlet and the WASI runtime. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolWithKrustletAndTheWASIRuntime( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsDiskSizeGB(64) + .withWorkloadRuntime(WorkloadRuntime.WASM_WASI) + .withOsType(OSType.LINUX) + .withMode(AgentPoolMode.USER) + .withOrchestratorVersion("") + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/AgentPoolsCreate_PPG.json + */ + /** + * Sample code: Create Agent Pool with PPG. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + createAgentPoolWithPPG(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withOrchestratorVersion("") + .withProximityPlacementGroupID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1") + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/AgentPoolsCreate_Snapshot.json + */ + /** + * Sample code: Create Agent Pool using an agent pool snapshot. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolUsingAnAgentPoolSnapshot( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withOrchestratorVersion("") + .withEnableFIPS(true) + .withCreationData(new CreationData().withSourceResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1")) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/AgentPoolsCreate_CustomNodeConfig.json + */ + /** + * Sample code: Create Agent Pool with KubeletConfig and LinuxOSConfig. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolWithKubeletConfigAndLinuxOSConfig( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withOrchestratorVersion("") + .withKubeletConfig(new KubeletConfig().withCpuManagerPolicy("static") + .withCpuCfsQuota(true) + .withCpuCfsQuotaPeriod("200ms") + .withImageGcHighThreshold(90) + .withImageGcLowThreshold(70) + .withTopologyManagerPolicy("best-effort") + .withAllowedUnsafeSysctls(Arrays.asList("kernel.msg*", "net.core.somaxconn")) + .withFailSwapOn(false)) + .withLinuxOSConfig(new LinuxOSConfig() + .withSysctls(new SysctlConfig().withNetCoreWmemDefault(12345) + .withNetIpv4TcpTwReuse(true) + .withNetIpv4IpLocalPortRange("20000 60000") + .withKernelThreadsMax(99999)) + .withTransparentHugePageEnabled("always") + .withTransparentHugePageDefrag("madvise") + .withSwapFileSizeMB(1500)) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/AgentPools_Stop.json + */ + /** + * Sample code: Stop Agent Pool. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + stopAgentPool(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withPowerState(new PowerState().withCode(Code.STOPPED)) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/AgentPoolsCreate_MessageOfTheDay.json + */ + /** + * Sample code: Create Agent Pool with Message of the Day. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolWithMessageOfTheDay( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsDiskSizeGB(64) + .withMessageOfTheDay("Zm9vCg==") + .withOsType(OSType.LINUX) + .withMode(AgentPoolMode.USER) + .withOrchestratorVersion("") + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/AgentPoolsCreate_CRG.json + */ + /** + * Sample code: Create Agent Pool with Capacity Reservation Group. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolWithCapacityReservationGroup( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withOrchestratorVersion("") + .withCapacityReservationGroupID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/CapacityReservationGroups/crg1") + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/AgentPoolsCreate_OSSKU.json + */ + /** + * Sample code: Create Agent Pool with OSSKU. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + createAgentPoolWithOSSKU(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withOsSKU(OSSKU.AZURE_LINUX) + .withOrchestratorVersion("") + .withKubeletConfig(new KubeletConfig().withCpuManagerPolicy("static") + .withCpuCfsQuota(true) + .withCpuCfsQuotaPeriod("200ms") + .withImageGcHighThreshold(90) + .withImageGcLowThreshold(70) + .withTopologyManagerPolicy("best-effort") + .withAllowedUnsafeSysctls(Arrays.asList("kernel.msg*", "net.core.somaxconn")) + .withFailSwapOn(false)) + .withLinuxOSConfig(new LinuxOSConfig() + .withSysctls(new SysctlConfig().withNetCoreWmemDefault(12345) + .withNetIpv4TcpTwReuse(true) + .withNetIpv4IpLocalPortRange("20000 60000") + .withKernelThreadsMax(99999)) + .withTransparentHugePageEnabled("always") + .withTransparentHugePageDefrag("madvise") + .withSwapFileSizeMB(1500)) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/AgentPoolsCreate_TypeVirtualMachines.json + */ + /** + * Sample code: Create Agent Pool with VirtualMachines pool type. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolWithVirtualMachinesPoolType( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withTags(mapOf("name1", "val1")) + .withOsType(OSType.LINUX) + .withTypePropertiesType(AgentPoolType.VIRTUAL_MACHINES) + .withOrchestratorVersion("1.9.6") + .withNodeLabels(mapOf("key1", "fakeTokenPlaceholder")) + .withNodeTaints(Arrays.asList("Key1=Value1:NoSchedule")) + .withVirtualMachinesProfile(new VirtualMachinesProfile().withScale(new ScaleProfile() + .withManual(Arrays.asList(new ManualScaleProfile().withSize("Standard_D2_v2").withCount(3), + new ManualScaleProfile().withSize("Standard_D2_v3").withCount(2))))) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/AgentPools_Update.json + */ + /** + * Sample code: Update Agent Pool. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + updateAgentPool(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + AgentPool resource = manager.agentPools() + .getWithResponse("rg1", "clustername1", "agentpool1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withCount(3) + .withVmSize("Standard_DS1_v2") + .withOsType(OSType.LINUX) + .withMaxCount(2) + .withMinCount(2) + .withEnableAutoScaling(true) + .withOrchestratorVersion("") + .withScaleSetPriority(ScaleSetPriority.SPOT) + .withScaleSetEvictionPolicy(ScaleSetEvictionPolicy.DELETE) + .withNodeTaints(Arrays.asList("Key1=Value1:NoSchedule")) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### AgentPools_Delete + +```java +/** + * Samples for AgentPools Delete. + */ +public final class AgentPoolsDeleteSamples { + /* + * x-ms-original-file: 2026-01-01/AgentPoolsDelete.json + */ + /** + * Sample code: Delete Agent Pool. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + deleteAgentPool(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools().delete("rg1", "clustername1", "agentpool1", null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### AgentPools_DeleteMachines + +```java +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolDeleteMachinesParameter; +import java.util.Arrays; + +/** + * Samples for AgentPools DeleteMachines. + */ +public final class AgentPoolsDeleteMachinesSamples { + /* + * x-ms-original-file: 2026-01-01/AgentPoolsDeleteMachines.json + */ + /** + * Sample code: Delete Specific Machines in an Agent Pool. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void deleteSpecificMachinesInAnAgentPool( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .deleteMachines("rg1", "clustername1", "agentpool1", + new AgentPoolDeleteMachinesParameter().withMachineNames( + Arrays.asList("aks-nodepool1-42263519-vmss00000a", "aks-nodepool1-42263519-vmss00000b")), + com.azure.core.util.Context.NONE); + } +} +``` + +### AgentPools_Get + +```java +/** + * Samples for AgentPools Get. + */ +public final class AgentPoolsGetSamples { + /* + * x-ms-original-file: 2026-01-01/AgentPoolsGet.json + */ + /** + * Sample code: Get Agent Pool. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + getAgentPool(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools().getWithResponse("rg1", "clustername1", "agentpool1", com.azure.core.util.Context.NONE); + } +} +``` + +### AgentPools_GetAvailableAgentPoolVersions + +```java +/** + * Samples for AgentPools GetAvailableAgentPoolVersions. + */ +public final class AgentPoolsGetAvailableAgentPoolVersionsSamples { + /* + * x-ms-original-file: 2026-01-01/AgentPoolsGetAgentPoolAvailableVersions.json + */ + /** + * Sample code: Get available versions for agent pool. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getAvailableVersionsForAgentPool( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .getAvailableAgentPoolVersionsWithResponse("rg1", "clustername1", com.azure.core.util.Context.NONE); + } +} +``` + +### AgentPools_GetUpgradeProfile + +```java +/** + * Samples for AgentPools GetUpgradeProfile. + */ +public final class AgentPoolsGetUpgradeProfileSamples { + /* + * x-ms-original-file: 2026-01-01/AgentPoolsGetUpgradeProfile.json + */ + /** + * Sample code: Get Upgrade Profile for Agent Pool. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getUpgradeProfileForAgentPool( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .getUpgradeProfileWithResponse("rg1", "clustername1", "agentpool1", com.azure.core.util.Context.NONE); + } +} +``` + +### AgentPools_List + +```java +/** + * Samples for AgentPools List. + */ +public final class AgentPoolsListSamples { + /* + * x-ms-original-file: 2026-01-01/AgentPoolsList.json + */ + /** + * Sample code: List Agent Pools by Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listAgentPoolsByManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools().list("rg1", "clustername1", com.azure.core.util.Context.NONE); + } +} +``` + +### AgentPools_UpgradeNodeImageVersion + +```java +/** + * Samples for AgentPools UpgradeNodeImageVersion. + */ +public final class AgentPoolsUpgradeNodeImageVersionSamples { + /* + * x-ms-original-file: 2026-01-01/AgentPoolsUpgradeNodeImageVersion.json + */ + /** + * Sample code: Upgrade Agent Pool Node Image Version. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void upgradeAgentPoolNodeImageVersion( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .upgradeNodeImageVersion("rg1", "clustername1", "agentpool1", com.azure.core.util.Context.NONE); + } +} +``` + +### Machines_Get + +```java +/** + * Samples for Machines Get. + */ +public final class MachinesGetSamples { + /* + * x-ms-original-file: 2026-01-01/MachineGet.json + */ + /** + * Sample code: Get a Machine in an Agent Pools by Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getAMachineInAnAgentPoolsByManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.machines() + .getWithResponse("rg1", "clustername1", "agentpool1", "aks-nodepool1-42263519-vmss00000t", + com.azure.core.util.Context.NONE); + } +} +``` + +### Machines_List + +```java +/** + * Samples for Machines List. + */ +public final class MachinesListSamples { + /* + * x-ms-original-file: 2026-01-01/MachineList.json + */ + /** + * Sample code: List Machines in an Agentpool by Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listMachinesInAnAgentpoolByManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.machines().list("rg1", "clustername1", "agentpool1", com.azure.core.util.Context.NONE); + } +} +``` + +### MaintenanceConfigurations_CreateOrUpdate + +```java +import com.azure.resourcemanager.containerservice.generated.models.DateSpan; +import com.azure.resourcemanager.containerservice.generated.models.MaintenanceWindow; +import com.azure.resourcemanager.containerservice.generated.models.RelativeMonthlySchedule; +import com.azure.resourcemanager.containerservice.generated.models.Schedule; +import com.azure.resourcemanager.containerservice.generated.models.Type; +import com.azure.resourcemanager.containerservice.generated.models.WeekDay; +import java.time.LocalDate; +import java.util.Arrays; + +/** + * Samples for MaintenanceConfigurations CreateOrUpdate. + */ +public final class MaintenanceConfigurationsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-01-01/MaintenanceConfigurationsCreate_Update_MaintenanceWindow.json + */ + /** + * Sample code: Create/Update Maintenance Configuration with Maintenance Window. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createUpdateMaintenanceConfigurationWithMaintenanceWindow( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.maintenanceConfigurations() + .define("aksManagedAutoUpgradeSchedule") + .withExistingManagedCluster("rg1", "clustername1") + .withMaintenanceWindow(new MaintenanceWindow() + .withSchedule(new Schedule().withRelativeMonthly(new RelativeMonthlySchedule().withIntervalMonths(3) + .withWeekIndex(Type.FIRST) + .withDayOfWeek(WeekDay.MONDAY))) + .withDurationHours(10) + .withUtcOffset("+05:30") + .withStartDate(LocalDate.parse("2023-01-01")) + .withStartTime("08:30") + .withNotAllowedDates(Arrays.asList( + new DateSpan().withStart(LocalDate.parse("2023-02-18")).withEnd(LocalDate.parse("2023-02-25")), + new DateSpan().withStart(LocalDate.parse("2023-12-23")).withEnd(LocalDate.parse("2024-01-05"))))) + .create(); + } +} +``` + +### MaintenanceConfigurations_Delete + +```java +/** + * Samples for MaintenanceConfigurations Delete. + */ +public final class MaintenanceConfigurationsDeleteSamples { + /* + * x-ms-original-file: 2026-01-01/MaintenanceConfigurationsDelete_MaintenanceWindow.json + */ + /** + * Sample code: Delete Maintenance Configuration For Node OS Upgrade. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void deleteMaintenanceConfigurationForNodeOSUpgrade( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.maintenanceConfigurations() + .deleteWithResponse("rg1", "clustername1", "aksManagedNodeOSUpgradeSchedule", + com.azure.core.util.Context.NONE); + } +} +``` + +### MaintenanceConfigurations_Get + +```java +/** + * Samples for MaintenanceConfigurations Get. + */ +public final class MaintenanceConfigurationsGetSamples { + /* + * x-ms-original-file: 2026-01-01/MaintenanceConfigurationsGet_MaintenanceWindow.json + */ + /** + * Sample code: Get Maintenance Configuration Configured With Maintenance Window. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getMaintenanceConfigurationConfiguredWithMaintenanceWindow( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.maintenanceConfigurations() + .getWithResponse("rg1", "clustername1", "aksManagedNodeOSUpgradeSchedule", + com.azure.core.util.Context.NONE); + } +} +``` + +### MaintenanceConfigurations_ListByManagedCluster + +```java +/** + * Samples for MaintenanceConfigurations ListByManagedCluster. + */ +public final class MaintenanceConfigurationsListByManagedClusterSamples { + /* + * x-ms-original-file: 2026-01-01/MaintenanceConfigurationsList_MaintenanceWindow.json + */ + /** + * Sample code: List maintenance configurations configured with maintenance window by Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listMaintenanceConfigurationsConfiguredWithMaintenanceWindowByManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.maintenanceConfigurations() + .listByManagedCluster("rg1", "clustername1", com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedClusters_AbortLatestOperation + +```java +/** + * Samples for ManagedClusters AbortLatestOperation. + */ +public final class ManagedClustersAbortLatestOperationSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedClustersAbortOperation.json + */ + /** + * Sample code: Abort operation on managed cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void abortOperationOnManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters().abortLatestOperation("rg1", "clustername1", com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedClusters_CreateOrUpdate + +```java +import com.azure.resourcemanager.containerservice.generated.models.AdvancedNetworkPolicies; +import com.azure.resourcemanager.containerservice.generated.models.AdvancedNetworking; +import com.azure.resourcemanager.containerservice.generated.models.AdvancedNetworkingObservability; +import com.azure.resourcemanager.containerservice.generated.models.AdvancedNetworkingSecurity; +import com.azure.resourcemanager.containerservice.generated.models.AdvancedNetworkingSecurityTransitEncryption; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolMode; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolType; +import com.azure.resourcemanager.containerservice.generated.models.ClusterUpgradeSettings; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServiceLinuxProfile; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServiceNetworkProfile; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServiceSshConfiguration; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServiceSshPublicKey; +import com.azure.resourcemanager.containerservice.generated.models.CreationData; +import com.azure.resourcemanager.containerservice.generated.models.Expander; +import com.azure.resourcemanager.containerservice.generated.models.GPUInstanceProfile; +import com.azure.resourcemanager.containerservice.generated.models.IPFamily; +import com.azure.resourcemanager.containerservice.generated.models.IstioCertificateAuthority; +import com.azure.resourcemanager.containerservice.generated.models.IstioComponents; +import com.azure.resourcemanager.containerservice.generated.models.IstioEgressGateway; +import com.azure.resourcemanager.containerservice.generated.models.IstioIngressGateway; +import com.azure.resourcemanager.containerservice.generated.models.IstioIngressGatewayMode; +import com.azure.resourcemanager.containerservice.generated.models.IstioPluginCertificateAuthority; +import com.azure.resourcemanager.containerservice.generated.models.IstioServiceMesh; +import com.azure.resourcemanager.containerservice.generated.models.KubernetesSupportPlan; +import com.azure.resourcemanager.containerservice.generated.models.LicenseType; +import com.azure.resourcemanager.containerservice.generated.models.LoadBalancerSku; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAADProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAddonProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAgentPoolProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterApiServerAccessProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterHttpProxyConfig; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterIdentity; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterIngressProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterIngressProfileWebAppRouting; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterLoadBalancerProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterManagedOutboundIPProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterNATGatewayProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterPodIdentityProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterPropertiesAutoScalerProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSKU; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSKUName; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSKUTier; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSecurityProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSecurityProfileDefender; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSecurityProfileDefenderSecurityMonitoring; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSecurityProfileWorkloadIdentity; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterServicePrincipalProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterWindowsProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedServiceIdentityUserAssignedIdentitiesValue; +import com.azure.resourcemanager.containerservice.generated.models.NetworkDataplane; +import com.azure.resourcemanager.containerservice.generated.models.NetworkPlugin; +import com.azure.resourcemanager.containerservice.generated.models.NetworkPluginMode; +import com.azure.resourcemanager.containerservice.generated.models.OSSKU; +import com.azure.resourcemanager.containerservice.generated.models.OSType; +import com.azure.resourcemanager.containerservice.generated.models.OutboundType; +import com.azure.resourcemanager.containerservice.generated.models.ResourceIdentityType; +import com.azure.resourcemanager.containerservice.generated.models.ScaleDownMode; +import com.azure.resourcemanager.containerservice.generated.models.ServiceMeshMode; +import com.azure.resourcemanager.containerservice.generated.models.ServiceMeshProfile; +import com.azure.resourcemanager.containerservice.generated.models.TransitEncryptionType; +import com.azure.resourcemanager.containerservice.generated.models.UpgradeOverrideSettings; +import com.azure.resourcemanager.containerservice.generated.models.WindowsGmsaProfile; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ManagedClusters CreateOrUpdate. + */ +public final class ManagedClustersCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_CRG.json + */ + /** + * Sample code: Create Managed Cluster with Capacity Reservation Group. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithCapacityReservationGroup( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIP(true) + .withCapacityReservationGroupID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/capacityReservationGroups/crg1") + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_CustomCATrustCertificates.json + */ + /** + * Sample code: Create Managed Cluster with Custom CA Trust Certificates. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithCustomCATrustCertificates( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIP(true) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .withSecurityProfile(new ManagedClusterSecurityProfile().withCustomCATrustCertificates( + Arrays.asList("ZHVtbXlFeGFtcGxlVGVzdFZhbHVlRm9yQ2VydGlmaWNhdGVUb0JlQWRkZWQ=".getBytes()))) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_DualStackNetworking.json + */ + /** + * Sample code: Create/Update Managed Cluster with dual-stack networking. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createUpdateManagedClusterWithDualStackNetworking( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withIdentity(new ManagedClusterIdentity().withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1", + new ManagedServiceIdentityUserAssignedIdentitiesValue()))) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS1_v2") + .withOsType(OSType.LINUX) + .withScaleDownMode(ScaleDownMode.DEALLOCATE) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withAvailabilityZones(Arrays.asList("1", "2", "3")) + .withEnableNodePublicIP(true) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2))) + .withIpFamilies(Arrays.asList(IPFamily.IPV4, IPFamily.IPV6))) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withBalanceSimilarNodeGroups("true") + .withExpander(Expander.PRIORITY) + .withMaxNodeProvisionTime("15m") + .withNewPodScaleUpDelay("1m") + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m") + .withSkipNodesWithSystemPods("false")) + .withDiskEncryptionSetID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_PodIdentity.json + */ + /** + * Sample code: Create Managed Cluster with PodIdentity enabled. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithPodIdentityEnabled( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIP(true) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withPodIdentityProfile( + new ManagedClusterPodIdentityProfile().withEnabled(true).withAllowNetworkPluginKubenet(true)) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_UserAssignedNATGateway.json + */ + /** + * Sample code: Create Managed Cluster with user-assigned NAT gateway as outbound type. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithUserAssignedNATGatewayAsOutboundType( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIP(false) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withEnableRBAC(true) + .withNetworkProfile( + new ContainerServiceNetworkProfile().withOutboundType(OutboundType.USER_ASSIGNED_NATGATEWAY) + .withLoadBalancerSku(LoadBalancerSku.STANDARD)) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_Update.json + */ + /** + * Sample code: Create/Update Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createUpdateManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withIdentity(new ManagedClusterIdentity().withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1", + new ManagedServiceIdentityUserAssignedIdentitiesValue()))) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS1_v2") + .withOsType(OSType.LINUX) + .withScaleDownMode(ScaleDownMode.DEALLOCATE) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withAvailabilityZones(Arrays.asList("1", "2", "3")) + .withEnableNodePublicIP(true) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withUpgradeSettings( + new ClusterUpgradeSettings().withOverrideSettings(new UpgradeOverrideSettings().withForceUpgrade(false) + .withUntil(OffsetDateTime.parse("2022-11-01T13:00:00Z")))) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withBalanceSimilarNodeGroups("true") + .withExpander(Expander.PRIORITY) + .withMaxNodeProvisionTime("15m") + .withNewPodScaleUpDelay("1m") + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m") + .withSkipNodesWithSystemPods("false")) + .withDiskEncryptionSetID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_PrivateClusterFQDNSubdomain.json + */ + /** + * Sample code: Create Managed Private Cluster with fqdn subdomain specified. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedPrivateClusterWithFqdnSubdomainSpecified( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withKubernetesVersion("") + .withFqdnSubdomain("domain1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIP(true) + .withEnableEncryptionAtHost(true) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withApiServerAccessProfile(new ManagedClusterApiServerAccessProfile().withEnablePrivateCluster(true) + .withPrivateDNSZone( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateDnsZones/privatelink.location1.azmk8s.io")) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_ManagedNATGateway.json + */ + /** + * Sample code: Create Managed Cluster with AKS-managed NAT gateway as outbound type. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithAKSManagedNATGatewayAsOutboundType( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIP(false) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.MANAGED_NATGATEWAY) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withNatGatewayProfile(new ManagedClusterNATGatewayProfile() + .withManagedOutboundIPProfile(new ManagedClusterManagedOutboundIPProfile().withCount(2)))) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_Premium.json + */ + /** + * Sample code: Create Managed Cluster with LongTermSupport. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithLongTermSupport( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku( + new ManagedClusterSKU().withName(ManagedClusterSKUName.BASE).withTier(ManagedClusterSKUTier.PREMIUM)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIP(true) + .withEnableEncryptionAtHost(true) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withEnableRBAC(true) + .withSupportPlan(KubernetesSupportPlan.AKSLONG_TERM_SUPPORT) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withApiServerAccessProfile(new ManagedClusterApiServerAccessProfile().withDisableRunCommand(true)) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_NodePublicIPPrefix.json + */ + /** + * Sample code: Create Managed Cluster with Node Public IP Prefix. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithNodePublicIPPrefix( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIP(true) + .withNodePublicIPPrefixID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/public-ip-prefix") + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_EnableEncryptionAtHost.json + */ + /** + * Sample code: Create Managed Cluster with EncryptionAtHost enabled. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithEncryptionAtHostEnabled( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIP(true) + .withEnableEncryptionAtHost(true) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_PrivateClusterPublicFQDN.json + */ + /** + * Sample code: Create Managed Private Cluster with Public FQDN specified. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedPrivateClusterWithPublicFQDNSpecified( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIP(true) + .withEnableEncryptionAtHost(true) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withApiServerAccessProfile(new ManagedClusterApiServerAccessProfile().withEnablePrivateCluster(true) + .withEnablePrivateClusterPublicFQDN(true)) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_HTTPProxy.json + */ + /** + * Sample code: Create Managed Cluster with HTTP proxy configured. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithHTTPProxyConfigured( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIP(true) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .withHttpProxyConfig(new ManagedClusterHttpProxyConfig().withHttpProxy("http://myproxy.server.com:8080") + .withHttpsProxy("https://myproxy.server.com:8080") + .withNoProxy(Arrays.asList("localhost", "127.0.0.1")) + .withTrustedCa("Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U=")) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_DedicatedHostGroup.json + */ + /** + * Sample code: Create Managed Cluster with Dedicated Host Group. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithDedicatedHostGroup( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withEnableNodePublicIP(true) + .withHostGroupID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1") + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_EnabledFIPS.json + */ + /** + * Sample code: Create Managed Cluster with FIPS enabled OS. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithFIPSEnabledOS( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIP(true) + .withEnableFIPS(true) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_SecurityProfile.json + */ + /** + * Sample code: Create Managed Cluster with Security Profile configured. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithSecurityProfileConfigured( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIP(true) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withSecurityProfile(new ManagedClusterSecurityProfile() + .withDefender(new ManagedClusterSecurityProfileDefender().withLogAnalyticsWorkspaceResourceId( + "/subscriptions/SUB_ID/resourceGroups/RG_NAME/providers/microsoft.operationalinsights/workspaces/WORKSPACE_NAME") + .withSecurityMonitoring( + new ManagedClusterSecurityProfileDefenderSecurityMonitoring().withEnabled(true))) + .withWorkloadIdentity(new ManagedClusterSecurityProfileWorkloadIdentity().withEnabled(true))) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_PPG.json + */ + /** + * Sample code: Create Managed Cluster with PPG. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithPPG( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIP(true) + .withProximityPlacementGroupID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1") + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_IngressProfile_WebAppRouting.json + */ + /** + * Sample code: Create Managed Cluster with Web App Routing Ingress Profile configured. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithWebAppRoutingIngressProfileConfigured( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIP(true) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withIngressProfile(new ManagedClusterIngressProfile() + .withWebAppRouting(new ManagedClusterIngressProfileWebAppRouting().withEnabled(true) + .withDnsZoneResourceIds(Arrays.asList( + "/subscriptions/SUB_ID/resourceGroups/RG_NAME/providers/Microsoft.Network/dnszones/DNS_ZONE_NAME")))) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_UpdateWithAHUB.json + */ + /** + * Sample code: Create/Update Managed Cluster with EnableAHUB. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createUpdateManagedClusterWithEnableAHUB( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withIdentity(new ManagedClusterIdentity().withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1", + new ManagedServiceIdentityUserAssignedIdentitiesValue()))) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS1_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withAvailabilityZones(Arrays.asList("1", "2", "3")) + .withEnableNodePublicIP(true) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder") + .withLicenseType(LicenseType.WINDOWS_SERVER)) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_DisableRunCommand.json + */ + /** + * Sample code: Create Managed Cluster with RunCommand disabled. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithRunCommandDisabled( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIP(true) + .withEnableEncryptionAtHost(true) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withApiServerAccessProfile(new ManagedClusterApiServerAccessProfile().withDisableRunCommand(true)) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_AzureServiceMesh.json + */ + /** + * Sample code: Create/Update Managed Cluster with Azure Service Mesh. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createUpdateManagedClusterWithAzureServiceMesh( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIP(true) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf("azureKeyvaultSecretsProvider", + new ManagedClusterAddonProfile().withEnabled(true) + .withConfig(mapOf("enableSecretRotation", "fakeTokenPlaceholder", "rotationPollInterval", "2m")))) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .withServiceMeshProfile( + new ServiceMeshProfile().withMode(ServiceMeshMode.ISTIO) + .withIstio( + new IstioServiceMesh() + .withComponents(new IstioComponents() + .withIngressGateways( + Arrays.asList(new IstioIngressGateway().withMode(IstioIngressGatewayMode.INTERNAL) + .withEnabled(true))) + .withEgressGateways(Arrays.asList(new IstioEgressGateway().withEnabled(true) + .withName("test-istio-egress") + .withGatewayConfigurationName("test-gateway-configuration")))) + .withCertificateAuthority(new IstioCertificateAuthority() + .withPlugin(new IstioPluginCertificateAuthority().withKeyVaultId("fakeTokenPlaceholder") + .withCertObjectName("ca-cert") + .withKeyObjectName("fakeTokenPlaceholder") + .withRootCertObjectName("root-cert") + .withCertChainObjectName("cert-chain"))))) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_Snapshot.json + */ + /** + * Sample code: Create Managed Cluster using an agent pool snapshot. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterUsingAnAgentPoolSnapshot( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIP(true) + .withEnableFIPS(true) + .withCreationData(new CreationData().withSourceResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1")) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_AzureKeyvaultSecretsProvider.json + */ + /** + * Sample code: Create Managed Cluster with Azure KeyVault Secrets Provider Addon. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithAzureKeyVaultSecretsProviderAddon( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIP(true) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf("azureKeyvaultSecretsProvider", + new ManagedClusterAddonProfile().withEnabled(true) + .withConfig(mapOf("enableSecretRotation", "fakeTokenPlaceholder", "rotationPollInterval", "2m")))) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_OSSKU.json + */ + /** + * Sample code: Create Managed Cluster with OSSKU. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithOSSKU( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withOsSKU(OSSKU.AZURE_LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIP(true) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .withHttpProxyConfig(new ManagedClusterHttpProxyConfig().withHttpProxy("http://myproxy.server.com:8080") + .withHttpsProxy("https://myproxy.server.com:8080") + .withNoProxy(Arrays.asList("localhost", "127.0.0.1")) + .withTrustedCa("Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U=")) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/AdvancedNetworkingTransitEncryption.json + */ + /** + * Sample code: Create Managed Cluster with Advanced Networking Transit Encryption. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithAdvancedNetworkingTransitEncryption( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIP(true) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withNetworkPlugin(NetworkPlugin.AZURE) + .withNetworkPluginMode(NetworkPluginMode.OVERLAY) + .withNetworkDataplane(NetworkDataplane.CILIUM) + .withAdvancedNetworking(new AdvancedNetworking().withEnabled(true) + .withObservability(new AdvancedNetworkingObservability().withEnabled(false)) + .withSecurity(new AdvancedNetworkingSecurity().withEnabled(true) + .withAdvancedNetworkPolicies(AdvancedNetworkPolicies.FQDN) + .withTransitEncryption(new AdvancedNetworkingSecurityTransitEncryption() + .withType(TransitEncryptionType.WIRE_GUARD)))) + .withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_UpdateWithEnableAzureRBAC.json + */ + /** + * Sample code: Create/Update AAD Managed Cluster with EnableAzureRBAC. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createUpdateAADManagedClusterWithEnableAzureRBAC( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS1_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withAvailabilityZones(Arrays.asList("1", "2", "3")) + .withEnableNodePublicIP(true) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAadProfile(new ManagedClusterAADProfile().withManaged(true).withEnableAzureRBAC(true)) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_EnableUltraSSD.json + */ + /** + * Sample code: Create Managed Cluster with UltraSSD enabled. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithUltraSSDEnabled( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIP(true) + .withEnableUltraSSD(true) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_UpdateWindowsGmsa.json + */ + /** + * Sample code: Create/Update Managed Cluster with Windows gMSA enabled. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createUpdateManagedClusterWithWindowsGMSAEnabled( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withIdentity(new ManagedClusterIdentity().withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1", + new ManagedServiceIdentityUserAssignedIdentitiesValue()))) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS1_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withAvailabilityZones(Arrays.asList("1", "2", "3")) + .withEnableNodePublicIP(true) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder") + .withGmsaProfile(new WindowsGmsaProfile().withEnabled(true))) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_GPUMIG.json + */ + /** + * Sample code: Create Managed Cluster with GPUMIG. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithGPUMIG( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_ND96asr_v4") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIP(true) + .withGpuInstanceProfile(GPUInstanceProfile.MIG3G) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .withHttpProxyConfig(new ManagedClusterHttpProxyConfig().withHttpProxy("http://myproxy.server.com:8080") + .withHttpsProxy("https://myproxy.server.com:8080") + .withNoProxy(Arrays.asList("localhost", "127.0.0.1")) + .withTrustedCa("Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U=")) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ManagedClusters_Delete + +```java +/** + * Samples for ManagedClusters Delete. + */ +public final class ManagedClustersDeleteSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedClustersDelete.json + */ + /** + * Sample code: Delete Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + deleteManagedCluster(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters().delete("rg1", "clustername1", null, com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedClusters_GetAccessProfile + +```java +/** + * Samples for ManagedClusters GetAccessProfile. + */ +public final class ManagedClustersGetAccessProfileSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedClustersGetAccessProfile.json + */ + /** + * Sample code: Get Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + getManagedCluster(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .getAccessProfileWithResponse("rg1", "clustername1", "clusterUser", com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedClusters_GetByResourceGroup + +```java +/** + * Samples for ManagedClusters GetByResourceGroup. + */ +public final class ManagedClustersGetByResourceGroupSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedClustersGet.json + */ + /** + * Sample code: Get Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + getManagedCluster(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .getByResourceGroupWithResponse("rg1", "clustername1", com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedClusters_GetCommandResult + +```java +/** + * Samples for ManagedClusters GetCommandResult. + */ +public final class ManagedClustersGetCommandResultSamples { + /* + * x-ms-original-file: 2026-01-01/RunCommandResultFailed.json + */ + /** + * Sample code: commandFailedResult. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + commandFailedResult(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .getCommandResultWithResponse("rg1", "clustername1", "def7b3ea71bd4f7e9d226ddbc0f00ad9", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-01-01/RunCommandResultSucceed.json + */ + /** + * Sample code: commandSucceedResult. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + commandSucceedResult(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .getCommandResultWithResponse("rg1", "clustername1", "def7b3ea71bd4f7e9d226ddbc0f00ad9", + com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedClusters_GetMeshRevisionProfile + +```java +/** + * Samples for ManagedClusters GetMeshRevisionProfile. + */ +public final class ManagedClustersGetMeshRevisionProfileSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedClustersGet_MeshRevisionProfile.json + */ + /** + * Sample code: Get a mesh revision profile for a mesh mode. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getAMeshRevisionProfileForAMeshMode( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .getMeshRevisionProfileWithResponse("location1", "istio", com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedClusters_GetMeshUpgradeProfile + +```java +/** + * Samples for ManagedClusters GetMeshUpgradeProfile. + */ +public final class ManagedClustersGetMeshUpgradeProfileSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedClustersGet_MeshUpgradeProfile.json + */ + /** + * Sample code: Gets version compatibility and upgrade profile for a service mesh in a cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getsVersionCompatibilityAndUpgradeProfileForAServiceMeshInACluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .getMeshUpgradeProfileWithResponse("rg1", "clustername1", "istio", com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedClusters_GetUpgradeProfile + +```java +/** + * Samples for ManagedClusters GetUpgradeProfile. + */ +public final class ManagedClustersGetUpgradeProfileSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedClustersGetUpgradeProfile.json + */ + /** + * Sample code: Get Upgrade Profile for Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getUpgradeProfileForManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .getUpgradeProfileWithResponse("rg1", "clustername1", com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedClusters_List + +```java +/** + * Samples for ManagedClusters List. + */ +public final class ManagedClustersListSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedClustersList.json + */ + /** + * Sample code: List Managed Clusters. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + listManagedClusters(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters().list(com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedClusters_ListByResourceGroup + +```java +/** + * Samples for ManagedClusters ListByResourceGroup. + */ +public final class ManagedClustersListByResourceGroupSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedClustersListByResourceGroup.json + */ + /** + * Sample code: Get Managed Clusters by Resource Group. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getManagedClustersByResourceGroup( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedClusters_ListClusterAdminCredentials + +```java +/** + * Samples for ManagedClusters ListClusterAdminCredentials. + */ +public final class ManagedClustersListClusterAdminCredentialsSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedClustersListClusterAdminCredentials.json + */ + /** + * Sample code: Get Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + getManagedCluster(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .listClusterAdminCredentialsWithResponse("rg1", "clustername1", null, com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedClusters_ListClusterMonitoringUserCredentials + +```java +/** + * Samples for ManagedClusters ListClusterMonitoringUserCredentials. + */ +public final class ManagedClustersListClusterMonitoringUserCredentialsSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedClustersListClusterMonitoringUserCredentials.json + */ + /** + * Sample code: Get Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + getManagedCluster(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .listClusterMonitoringUserCredentialsWithResponse("rg1", "clustername1", null, + com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedClusters_ListClusterUserCredentials + +```java + +/** + * Samples for ManagedClusters ListClusterUserCredentials. + */ +public final class ManagedClustersListClusterUserCredentialsSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedClustersListClusterUserCredentials.json + */ + /** + * Sample code: Get Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + getManagedCluster(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .listClusterUserCredentialsWithResponse("rg1", "clustername1", null, null, + com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedClusters_ListKubernetesVersions + +```java +/** + * Samples for ManagedClusters ListKubernetesVersions. + */ +public final class ManagedClustersListKubernetesVersionsSamples { + /* + * x-ms-original-file: 2026-01-01/KubernetesVersions_List.json + */ + /** + * Sample code: List Kubernetes Versions. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + listKubernetesVersions(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters().listKubernetesVersionsWithResponse("location1", com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedClusters_ListMeshRevisionProfiles + +```java +/** + * Samples for ManagedClusters ListMeshRevisionProfiles. + */ +public final class ManagedClustersListMeshRevisionProfilesSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedClustersList_MeshRevisionProfiles.json + */ + /** + * Sample code: List mesh revision profiles in a location. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listMeshRevisionProfilesInALocation( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters().listMeshRevisionProfiles("location1", com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedClusters_ListMeshUpgradeProfiles + +```java +/** + * Samples for ManagedClusters ListMeshUpgradeProfiles. + */ +public final class ManagedClustersListMeshUpgradeProfilesSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedClustersList_MeshUpgradeProfiles.json + */ + /** + * Sample code: Lists version compatibility and upgrade profile for all service meshes in a cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listsVersionCompatibilityAndUpgradeProfileForAllServiceMeshesInACluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters().listMeshUpgradeProfiles("rg1", "clustername1", com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedClusters_ListOutboundNetworkDependenciesEndpoints + +```java +/** + * Samples for ManagedClusters ListOutboundNetworkDependenciesEndpoints. + */ +public final class ManagedClustersListOutboundNetworkDependenciesEndpointsSamples { + /* + * x-ms-original-file: 2026-01-01/OutboundNetworkDependenciesEndpointsList.json + */ + /** + * Sample code: List OutboundNetworkDependenciesEndpoints by Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listOutboundNetworkDependenciesEndpointsByManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .listOutboundNetworkDependenciesEndpoints("rg1", "clustername1", com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedClusters_ResetAADProfile + +```java +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAADProfile; + +/** + * Samples for ManagedClusters ResetAADProfile. + */ +public final class ManagedClustersResetAADProfileSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedClustersResetAADProfile.json + */ + /** + * Sample code: Reset AAD Profile. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + resetAADProfile(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .resetAADProfile("rg1", "clustername1", + new ManagedClusterAADProfile().withClientAppID("clientappid") + .withServerAppID("serverappid") + .withServerAppSecret("fakeTokenPlaceholder") + .withTenantID("tenantid"), + com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedClusters_ResetServicePrincipalProfile + +```java +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterServicePrincipalProfile; + +/** + * Samples for ManagedClusters ResetServicePrincipalProfile. + */ +public final class ManagedClustersResetServicePrincipalProfileSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedClustersResetServicePrincipalProfile.json + */ + /** + * Sample code: Reset Service Principal Profile. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void resetServicePrincipalProfile( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .resetServicePrincipalProfile("rg1", "clustername1", + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder"), + com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedClusters_RotateClusterCertificates + +```java +/** + * Samples for ManagedClusters RotateClusterCertificates. + */ +public final class ManagedClustersRotateClusterCertificatesSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedClustersRotateClusterCertificates.json + */ + /** + * Sample code: Rotate Cluster Certificates. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void rotateClusterCertificates( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters().rotateClusterCertificates("rg1", "clustername1", com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedClusters_RotateServiceAccountSigningKeys + +```java +/** + * Samples for ManagedClusters RotateServiceAccountSigningKeys. + */ +public final class ManagedClustersRotateServiceAccountSigningKeysSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedClustersRotateServiceAccountSigningKeys.json + */ + /** + * Sample code: Rotate Cluster Service Account Signing Keys. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void rotateClusterServiceAccountSigningKeys( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .rotateServiceAccountSigningKeys("rg1", "clustername1", com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedClusters_RunCommand + +```java +import com.azure.resourcemanager.containerservice.generated.models.RunCommandRequest; + +/** + * Samples for ManagedClusters RunCommand. + */ +public final class ManagedClustersRunCommandSamples { + /* + * x-ms-original-file: 2026-01-01/RunCommandRequest.json + */ + /** + * Sample code: submitNewCommand. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + submitNewCommand(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .runCommand("rg1", "clustername1", + new RunCommandRequest().withCommand("kubectl apply -f ns.yaml") + .withContext("") + .withClusterToken("fakeTokenPlaceholder"), + com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedClusters_Start + +```java +/** + * Samples for ManagedClusters Start. + */ +public final class ManagedClustersStartSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedClustersStart.json + */ + /** + * Sample code: Start Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + startManagedCluster(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters().start("rg1", "clustername1", com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedClusters_Stop + +```java +/** + * Samples for ManagedClusters Stop. + */ +public final class ManagedClustersStopSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedClustersStop.json + */ + /** + * Sample code: Stop Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + stopManagedCluster(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters().stop("rg1", "clustername1", com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedClusters_UpdateTags + +```java +import com.azure.resourcemanager.containerservice.generated.models.ManagedCluster; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ManagedClusters UpdateTags. + */ +public final class ManagedClustersUpdateTagsSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedClustersUpdateTags.json + */ + /** + * Sample code: Update Managed Cluster Tags. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + updateManagedClusterTags(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + ManagedCluster resource = manager.managedClusters() + .getByResourceGroupWithResponse("rg1", "clustername1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("archv3", "", "tier", "testing")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ManagedNamespaces_CreateOrUpdate + +```java +import com.azure.resourcemanager.containerservice.generated.models.AdoptionPolicy; +import com.azure.resourcemanager.containerservice.generated.models.DeletePolicy; +import com.azure.resourcemanager.containerservice.generated.models.NamespaceProperties; +import com.azure.resourcemanager.containerservice.generated.models.NetworkPolicies; +import com.azure.resourcemanager.containerservice.generated.models.PolicyRule; +import com.azure.resourcemanager.containerservice.generated.models.ResourceQuota; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ManagedNamespaces CreateOrUpdate. + */ +public final class ManagedNamespacesCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedNamespacesCreate_Update.json + */ + /** + * Sample code: Create/Update Managed Namespace. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createUpdateManagedNamespace( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedNamespaces() + .define("namespace1") + .withExistingManagedCluster("rg1", "clustername1") + .withTags(mapOf("tagKey1", "fakeTokenPlaceholder")) + .withProperties(new NamespaceProperties().withLabels(mapOf("kubernetes.io/metadata.name", "true")) + .withAnnotations(mapOf("annatationKey", "fakeTokenPlaceholder")) + .withDefaultResourceQuota(new ResourceQuota().withCpuRequest("3m") + .withCpuLimit("3m") + .withMemoryRequest("5Gi") + .withMemoryLimit("5Gi")) + .withDefaultNetworkPolicy( + new NetworkPolicies().withIngress(PolicyRule.ALLOW_SAME_NAMESPACE).withEgress(PolicyRule.ALLOW_ALL)) + .withAdoptionPolicy(AdoptionPolicy.IF_IDENTICAL) + .withDeletePolicy(DeletePolicy.KEEP)) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ManagedNamespaces_Delete + +```java +/** + * Samples for ManagedNamespaces Delete. + */ +public final class ManagedNamespacesDeleteSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedNamespacesDelete.json + */ + /** + * Sample code: Delete Managed Namespace. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + deleteManagedNamespace(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedNamespaces().delete("rg1", "clustername1", "namespace1", com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedNamespaces_Get + +```java +/** + * Samples for ManagedNamespaces Get. + */ +public final class ManagedNamespacesGetSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedNamespacesGet.json + */ + /** + * Sample code: Get Managed Namespace. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + getManagedNamespace(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedNamespaces() + .getWithResponse("rg1", "clustername1", "namespace1", com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedNamespaces_ListByManagedCluster + +```java +/** + * Samples for ManagedNamespaces ListByManagedCluster. + */ +public final class ManagedNamespacesListByManagedClusterSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedNamespacesList.json + */ + /** + * Sample code: List namespaces by Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listNamespacesByManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedNamespaces().listByManagedCluster("rg1", "clustername1", com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedNamespaces_ListCredential + +```java +/** + * Samples for ManagedNamespaces ListCredential. + */ +public final class ManagedNamespacesListCredentialSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedNamespacesListCredentialResult.json + */ + /** + * Sample code: List managed namespace credentials. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listManagedNamespaceCredentials( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedNamespaces() + .listCredentialWithResponse("rg1", "clustername1", "namespace1", com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedNamespaces_Update + +```java +import com.azure.resourcemanager.containerservice.generated.models.ManagedNamespace; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ManagedNamespaces Update. + */ +public final class ManagedNamespacesUpdateSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedNamespacesUpdateTags.json + */ + /** + * Sample code: Update Managed Namespace Tags. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void updateManagedNamespaceTags( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + ManagedNamespace resource = manager.managedNamespaces() + .getWithResponse("rg1", "clustername1", "namespace1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagKey1", "fakeTokenPlaceholder", "tagKey2", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Operations_List + +```java +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: 2026-01-01/Operation_List.json + */ + /** + * Sample code: List available operations for the container service resource provider. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listAvailableOperationsForTheContainerServiceResourceProvider( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Delete + +```java +/** + * Samples for PrivateEndpointConnections Delete. + */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: 2026-01-01/PrivateEndpointConnectionsDelete.json + */ + /** + * Sample code: Delete Private Endpoint Connection. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void deletePrivateEndpointConnection( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.privateEndpointConnections() + .delete("rg1", "clustername1", "privateendpointconnection1", com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Get + +```java +/** + * Samples for PrivateEndpointConnections Get. + */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: 2026-01-01/PrivateEndpointConnectionsGet.json + */ + /** + * Sample code: Get Private Endpoint Connection. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getPrivateEndpointConnection( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.privateEndpointConnections() + .getWithResponse("rg1", "clustername1", "privateendpointconnection1", com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateEndpointConnections_List + +```java +/** + * Samples for PrivateEndpointConnections List. + */ +public final class PrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: 2026-01-01/PrivateEndpointConnectionsList.json + */ + /** + * Sample code: List Private Endpoint Connections by Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listPrivateEndpointConnectionsByManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.privateEndpointConnections().listWithResponse("rg1", "clustername1", com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Update + +```java +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.containerservice.generated.models.ConnectionStatus; +import com.azure.resourcemanager.containerservice.generated.models.PrivateLinkServiceConnectionState; + +/** + * Samples for PrivateEndpointConnections Update. + */ +public final class PrivateEndpointConnectionsUpdateSamples { + /* + * x-ms-original-file: 2026-01-01/PrivateEndpointConnectionsUpdate.json + */ + /** + * Sample code: Update Private Endpoint Connection. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void updatePrivateEndpointConnection( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.privateEndpointConnections() + .updateWithResponse("rg1", "clustername1", "privateendpointconnection1", + new PrivateEndpointConnectionInner().withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState().withStatus(ConnectionStatus.APPROVED)), + com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateLinkResources_List + +```java +/** + * Samples for PrivateLinkResources List. + */ +public final class PrivateLinkResourcesListSamples { + /* + * x-ms-original-file: 2026-01-01/PrivateLinkResourcesList.json + */ + /** + * Sample code: List Private Link Resources by Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listPrivateLinkResourcesByManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.privateLinkResources().listWithResponse("rg1", "clustername1", com.azure.core.util.Context.NONE); + } +} +``` + +### ResolvePrivateLinkServiceId_POST + +```java +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateLinkResourceInner; + +/** + * Samples for ResolvePrivateLinkServiceId POST. + */ +public final class ResolvePrivateLinkServiceIdPOSTSamples { + /* + * x-ms-original-file: 2026-01-01/ResolvePrivateLinkServiceId.json + */ + /** + * Sample code: Resolve the Private Link Service ID for Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void resolveThePrivateLinkServiceIDForManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.resolvePrivateLinkServiceIds() + .pOSTWithResponse("rg1", "clustername1", new PrivateLinkResourceInner().withName("management"), + com.azure.core.util.Context.NONE); + } +} +``` + +### Snapshots_CreateOrUpdate + +```java +import com.azure.resourcemanager.containerservice.generated.models.CreationData; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Snapshots CreateOrUpdate. + */ +public final class SnapshotsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-01-01/SnapshotsCreate.json + */ + /** + * Sample code: Create/Update Snapshot. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + createUpdateSnapshot(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.snapshots() + .define("snapshot1") + .withRegion("westus") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) + .withCreationData(new CreationData().withSourceResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1/agentPools/pool0")) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Snapshots_Delete + +```java +/** + * Samples for Snapshots Delete. + */ +public final class SnapshotsDeleteSamples { + /* + * x-ms-original-file: 2026-01-01/SnapshotsDelete.json + */ + /** + * Sample code: Delete Snapshot. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + deleteSnapshot(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.snapshots().deleteByResourceGroupWithResponse("rg1", "snapshot1", com.azure.core.util.Context.NONE); + } +} +``` + +### Snapshots_GetByResourceGroup + +```java +/** + * Samples for Snapshots GetByResourceGroup. + */ +public final class SnapshotsGetByResourceGroupSamples { + /* + * x-ms-original-file: 2026-01-01/SnapshotsGet.json + */ + /** + * Sample code: Get Snapshot. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + getSnapshot(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.snapshots().getByResourceGroupWithResponse("rg1", "snapshot1", com.azure.core.util.Context.NONE); + } +} +``` + +### Snapshots_List + +```java +/** + * Samples for Snapshots List. + */ +public final class SnapshotsListSamples { + /* + * x-ms-original-file: 2026-01-01/SnapshotsList.json + */ + /** + * Sample code: List Snapshots. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + listSnapshots(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.snapshots().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Snapshots_ListByResourceGroup + +```java +/** + * Samples for Snapshots ListByResourceGroup. + */ +public final class SnapshotsListByResourceGroupSamples { + /* + * x-ms-original-file: 2026-01-01/SnapshotsListByResourceGroup.json + */ + /** + * Sample code: List Snapshots by Resource Group. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listSnapshotsByResourceGroup( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.snapshots().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### Snapshots_UpdateTags + +```java +import com.azure.resourcemanager.containerservice.generated.models.Snapshot; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Snapshots UpdateTags. + */ +public final class SnapshotsUpdateTagsSamples { + /* + * x-ms-original-file: 2026-01-01/SnapshotsUpdateTags.json + */ + /** + * Sample code: Update Snapshot Tags. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + updateSnapshotTags(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + Snapshot resource = manager.snapshots() + .getByResourceGroupWithResponse("rg1", "snapshot1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key2", "fakeTokenPlaceholder", "key3", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### TrustedAccessRoleBindings_CreateOrUpdate + +```java +import java.util.Arrays; + +/** + * Samples for TrustedAccessRoleBindings CreateOrUpdate. + */ +public final class TrustedAccessRoleBindingsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-01-01/TrustedAccessRoleBindings_CreateOrUpdate.json + */ + /** + * Sample code: Create or update a trusted access role binding. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createOrUpdateATrustedAccessRoleBinding( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.trustedAccessRoleBindings() + .define("binding1") + .withExistingManagedCluster("rg1", "clustername1") + .withSourceResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/b/providers/Microsoft.MachineLearningServices/workspaces/c") + .withRoles(Arrays.asList("Microsoft.MachineLearningServices/workspaces/reader", + "Microsoft.MachineLearningServices/workspaces/writer")) + .create(); + } +} +``` + +### TrustedAccessRoleBindings_Delete + +```java +/** + * Samples for TrustedAccessRoleBindings Delete. + */ +public final class TrustedAccessRoleBindingsDeleteSamples { + /* + * x-ms-original-file: 2026-01-01/TrustedAccessRoleBindings_Delete.json + */ + /** + * Sample code: Delete a trusted access role binding. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void deleteATrustedAccessRoleBinding( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.trustedAccessRoleBindings().delete("rg1", "clustername1", "binding1", com.azure.core.util.Context.NONE); + } +} +``` + +### TrustedAccessRoleBindings_Get + +```java +/** + * Samples for TrustedAccessRoleBindings Get. + */ +public final class TrustedAccessRoleBindingsGetSamples { + /* + * x-ms-original-file: 2026-01-01/TrustedAccessRoleBindings_Get.json + */ + /** + * Sample code: Get a trusted access role binding. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getATrustedAccessRoleBinding( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.trustedAccessRoleBindings() + .getWithResponse("rg1", "clustername1", "binding1", com.azure.core.util.Context.NONE); + } +} +``` + +### TrustedAccessRoleBindings_List + +```java +/** + * Samples for TrustedAccessRoleBindings List. + */ +public final class TrustedAccessRoleBindingsListSamples { + /* + * x-ms-original-file: 2026-01-01/TrustedAccessRoleBindings_List.json + */ + /** + * Sample code: List trusted access role bindings. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listTrustedAccessRoleBindings( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.trustedAccessRoleBindings().list("rg1", "clustername1", com.azure.core.util.Context.NONE); + } +} +``` + +### TrustedAccessRoles_List + +```java +/** + * Samples for TrustedAccessRoles List. + */ +public final class TrustedAccessRolesListSamples { + /* + * x-ms-original-file: 2026-01-01/TrustedAccessRoles_List.json + */ + /** + * Sample code: List trusted access roles. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + listTrustedAccessRoles(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.trustedAccessRoles().list("westus2", com.azure.core.util.Context.NONE); + } +} +``` + diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/pom.xml b/sdk/containerservice/azure-resourcemanager-containerservice-generated/pom.xml new file mode 100644 index 000000000000..5fa0dbe4880a --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/pom.xml @@ -0,0 +1,73 @@ + + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-containerservice-generated + 1.0.0 + jar + + Microsoft Azure SDK for Container Service Management + This package contains Microsoft Azure SDK for Container Service Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Container Service Client. Package api-version 2026-01-01. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + 0 + 0 + + + + com.azure + azure-core + 1.57.1 + + + com.azure + azure-core-management + 1.19.3 + + + com.azure + azure-core-test + 1.27.0-beta.14 + test + + + com.azure + azure-identity + 1.18.2 + test + + + diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/ContainerServiceManager.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/ContainerServiceManager.java new file mode 100644 index 000000000000..02f151fc05cd --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/ContainerServiceManager.java @@ -0,0 +1,462 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerservice.generated.fluent.ContainerServiceManagementClient; +import com.azure.resourcemanager.containerservice.generated.implementation.AgentPoolsImpl; +import com.azure.resourcemanager.containerservice.generated.implementation.ContainerServiceManagementClientBuilder; +import com.azure.resourcemanager.containerservice.generated.implementation.MachinesImpl; +import com.azure.resourcemanager.containerservice.generated.implementation.MaintenanceConfigurationsImpl; +import com.azure.resourcemanager.containerservice.generated.implementation.ManagedClustersImpl; +import com.azure.resourcemanager.containerservice.generated.implementation.ManagedNamespacesImpl; +import com.azure.resourcemanager.containerservice.generated.implementation.OperationsImpl; +import com.azure.resourcemanager.containerservice.generated.implementation.PrivateEndpointConnectionsImpl; +import com.azure.resourcemanager.containerservice.generated.implementation.PrivateLinkResourcesImpl; +import com.azure.resourcemanager.containerservice.generated.implementation.ResolvePrivateLinkServiceIdsImpl; +import com.azure.resourcemanager.containerservice.generated.implementation.SnapshotsImpl; +import com.azure.resourcemanager.containerservice.generated.implementation.TrustedAccessRoleBindingsImpl; +import com.azure.resourcemanager.containerservice.generated.implementation.TrustedAccessRolesImpl; +import com.azure.resourcemanager.containerservice.generated.models.AgentPools; +import com.azure.resourcemanager.containerservice.generated.models.Machines; +import com.azure.resourcemanager.containerservice.generated.models.MaintenanceConfigurations; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusters; +import com.azure.resourcemanager.containerservice.generated.models.ManagedNamespaces; +import com.azure.resourcemanager.containerservice.generated.models.Operations; +import com.azure.resourcemanager.containerservice.generated.models.PrivateEndpointConnections; +import com.azure.resourcemanager.containerservice.generated.models.PrivateLinkResources; +import com.azure.resourcemanager.containerservice.generated.models.ResolvePrivateLinkServiceIds; +import com.azure.resourcemanager.containerservice.generated.models.Snapshots; +import com.azure.resourcemanager.containerservice.generated.models.TrustedAccessRoleBindings; +import com.azure.resourcemanager.containerservice.generated.models.TrustedAccessRoles; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * Entry point to ContainerServiceManager. + * The Container Service Client. + */ +public final class ContainerServiceManager { + private AgentPools agentPools; + + private ManagedClusters managedClusters; + + private MaintenanceConfigurations maintenanceConfigurations; + + private ManagedNamespaces managedNamespaces; + + private Machines machines; + + private PrivateEndpointConnections privateEndpointConnections; + + private Snapshots snapshots; + + private TrustedAccessRoleBindings trustedAccessRoleBindings; + + private Operations operations; + + private PrivateLinkResources privateLinkResources; + + private ResolvePrivateLinkServiceIds resolvePrivateLinkServiceIds; + + private TrustedAccessRoles trustedAccessRoles; + + private final ContainerServiceManagementClient clientObject; + + private ContainerServiceManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = new ContainerServiceManagementClientBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of Container Service service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Container Service service API instance. + */ + public static ContainerServiceManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Creates an instance of Container Service service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the Container Service service API instance. + */ + public static ContainerServiceManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new ContainerServiceManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create ContainerServiceManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new ContainerServiceManager.Configurable(); + } + + /** + * The Configurable allowing configurations to be set. + */ + public static final class Configurable { + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-containerservice-generated.properties"); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private RetryOptions retryOptions; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the retry options for the HTTP pipeline retry policy. + *

+ * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval + = Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of Container Service service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Container Service service API instance. + */ + public ContainerServiceManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder.append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.containerservice.generated") + .append("/") + .append(clientVersion); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder.append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); + policies.add(new RequestIdPolicy()); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new BearerTokenAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new ContainerServiceManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of AgentPools. It manages AgentPool. + * + * @return Resource collection API of AgentPools. + */ + public AgentPools agentPools() { + if (this.agentPools == null) { + this.agentPools = new AgentPoolsImpl(clientObject.getAgentPools(), this); + } + return agentPools; + } + + /** + * Gets the resource collection API of ManagedClusters. It manages ManagedCluster. + * + * @return Resource collection API of ManagedClusters. + */ + public ManagedClusters managedClusters() { + if (this.managedClusters == null) { + this.managedClusters = new ManagedClustersImpl(clientObject.getManagedClusters(), this); + } + return managedClusters; + } + + /** + * Gets the resource collection API of MaintenanceConfigurations. It manages MaintenanceConfiguration. + * + * @return Resource collection API of MaintenanceConfigurations. + */ + public MaintenanceConfigurations maintenanceConfigurations() { + if (this.maintenanceConfigurations == null) { + this.maintenanceConfigurations + = new MaintenanceConfigurationsImpl(clientObject.getMaintenanceConfigurations(), this); + } + return maintenanceConfigurations; + } + + /** + * Gets the resource collection API of ManagedNamespaces. It manages ManagedNamespace. + * + * @return Resource collection API of ManagedNamespaces. + */ + public ManagedNamespaces managedNamespaces() { + if (this.managedNamespaces == null) { + this.managedNamespaces = new ManagedNamespacesImpl(clientObject.getManagedNamespaces(), this); + } + return managedNamespaces; + } + + /** + * Gets the resource collection API of Machines. + * + * @return Resource collection API of Machines. + */ + public Machines machines() { + if (this.machines == null) { + this.machines = new MachinesImpl(clientObject.getMachines(), this); + } + return machines; + } + + /** + * Gets the resource collection API of PrivateEndpointConnections. + * + * @return Resource collection API of PrivateEndpointConnections. + */ + public PrivateEndpointConnections privateEndpointConnections() { + if (this.privateEndpointConnections == null) { + this.privateEndpointConnections + = new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); + } + return privateEndpointConnections; + } + + /** + * Gets the resource collection API of Snapshots. It manages Snapshot. + * + * @return Resource collection API of Snapshots. + */ + public Snapshots snapshots() { + if (this.snapshots == null) { + this.snapshots = new SnapshotsImpl(clientObject.getSnapshots(), this); + } + return snapshots; + } + + /** + * Gets the resource collection API of TrustedAccessRoleBindings. It manages TrustedAccessRoleBinding. + * + * @return Resource collection API of TrustedAccessRoleBindings. + */ + public TrustedAccessRoleBindings trustedAccessRoleBindings() { + if (this.trustedAccessRoleBindings == null) { + this.trustedAccessRoleBindings + = new TrustedAccessRoleBindingsImpl(clientObject.getTrustedAccessRoleBindings(), this); + } + return trustedAccessRoleBindings; + } + + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** + * Gets the resource collection API of PrivateLinkResources. + * + * @return Resource collection API of PrivateLinkResources. + */ + public PrivateLinkResources privateLinkResources() { + if (this.privateLinkResources == null) { + this.privateLinkResources = new PrivateLinkResourcesImpl(clientObject.getPrivateLinkResources(), this); + } + return privateLinkResources; + } + + /** + * Gets the resource collection API of ResolvePrivateLinkServiceIds. + * + * @return Resource collection API of ResolvePrivateLinkServiceIds. + */ + public ResolvePrivateLinkServiceIds resolvePrivateLinkServiceIds() { + if (this.resolvePrivateLinkServiceIds == null) { + this.resolvePrivateLinkServiceIds + = new ResolvePrivateLinkServiceIdsImpl(clientObject.getResolvePrivateLinkServiceIds(), this); + } + return resolvePrivateLinkServiceIds; + } + + /** + * Gets the resource collection API of TrustedAccessRoles. + * + * @return Resource collection API of TrustedAccessRoles. + */ + public TrustedAccessRoles trustedAccessRoles() { + if (this.trustedAccessRoles == null) { + this.trustedAccessRoles = new TrustedAccessRolesImpl(clientObject.getTrustedAccessRoles(), this); + } + return trustedAccessRoles; + } + + /** + * Gets wrapped service client ContainerServiceManagementClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. + * + * @return Wrapped service client ContainerServiceManagementClient. + */ + public ContainerServiceManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/AgentPoolsClient.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/AgentPoolsClient.java new file mode 100644 index 000000000000..b42b7a6fdb43 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/AgentPoolsClient.java @@ -0,0 +1,496 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerservice.generated.fluent.models.AgentPoolAvailableVersionsInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.AgentPoolInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.AgentPoolUpgradeProfileInner; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolDeleteMachinesParameter; + +/** + * An instance of this class provides access to all the operations defined in AgentPoolsClient. + */ +public interface AgentPoolsClient { + /** + * Gets the specified managed cluster agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified managed cluster agent pool along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String resourceName, String agentPoolName, + Context context); + + /** + * Gets the specified managed cluster agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified managed cluster agent pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AgentPoolInner get(String resourceGroupName, String resourceName, String agentPoolName); + + /** + * Creates or updates an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param parameters The agent pool to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of agent Pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AgentPoolInner> beginCreateOrUpdate(String resourceGroupName, + String resourceName, String agentPoolName, AgentPoolInner parameters); + + /** + * Creates or updates an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param parameters The agent pool to create or update. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param ifNoneMatch The request should only proceed if no entity matches this string. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of agent Pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AgentPoolInner> beginCreateOrUpdate(String resourceGroupName, + String resourceName, String agentPoolName, AgentPoolInner parameters, String ifMatch, String ifNoneMatch, + Context context); + + /** + * Creates or updates an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param parameters The agent pool to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return agent Pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AgentPoolInner createOrUpdate(String resourceGroupName, String resourceName, String agentPoolName, + AgentPoolInner parameters); + + /** + * Creates or updates an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param parameters The agent pool to create or update. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param ifNoneMatch The request should only proceed if no entity matches this string. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return agent Pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AgentPoolInner createOrUpdate(String resourceGroupName, String resourceName, String agentPoolName, + AgentPoolInner parameters, String ifMatch, String ifNoneMatch, Context context); + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, String agentPoolName); + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param ignorePodDisruptionBudget ignore-pod-disruption-budget=true to delete those pods on a node without + * considering Pod Disruption Budget. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, String agentPoolName, + Boolean ignorePodDisruptionBudget, String ifMatch, Context context); + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String resourceName, String agentPoolName); + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param ignorePodDisruptionBudget ignore-pod-disruption-budget=true to delete those pods on a node without + * considering Pod Disruption Budget. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String resourceName, String agentPoolName, Boolean ignorePodDisruptionBudget, + String ifMatch, Context context); + + /** + * Gets a list of agent pools in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of agent pools in the specified managed cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String resourceName); + + /** + * Gets a list of agent pools in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of agent pools in the specified managed cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String resourceName, Context context); + + /** + * Aborts last operation running on agent pool. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginAbortLatestOperation(String resourceGroupName, String resourceName, + String agentPoolName); + + /** + * Aborts last operation running on agent pool. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginAbortLatestOperation(String resourceGroupName, String resourceName, + String agentPoolName, Context context); + + /** + * Aborts last operation running on agent pool. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void abortLatestOperation(String resourceGroupName, String resourceName, String agentPoolName); + + /** + * Aborts last operation running on agent pool. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void abortLatestOperation(String resourceGroupName, String resourceName, String agentPoolName, Context context); + + /** + * Deletes specific machines in an agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param machines A list of machines from the agent pool to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDeleteMachines(String resourceGroupName, String resourceName, + String agentPoolName, AgentPoolDeleteMachinesParameter machines); + + /** + * Deletes specific machines in an agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param machines A list of machines from the agent pool to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDeleteMachines(String resourceGroupName, String resourceName, + String agentPoolName, AgentPoolDeleteMachinesParameter machines, Context context); + + /** + * Deletes specific machines in an agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param machines A list of machines from the agent pool to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteMachines(String resourceGroupName, String resourceName, String agentPoolName, + AgentPoolDeleteMachinesParameter machines); + + /** + * Deletes specific machines in an agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param machines A list of machines from the agent pool to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteMachines(String resourceGroupName, String resourceName, String agentPoolName, + AgentPoolDeleteMachinesParameter machines, Context context); + + /** + * Upgrades the node image version of an agent pool to the latest. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of agent Pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginUpgradeNodeImageVersion(String resourceGroupName, String resourceName, + String agentPoolName); + + /** + * Upgrades the node image version of an agent pool to the latest. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of agent Pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginUpgradeNodeImageVersion(String resourceGroupName, String resourceName, + String agentPoolName, Context context); + + /** + * Upgrades the node image version of an agent pool to the latest. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void upgradeNodeImageVersion(String resourceGroupName, String resourceName, String agentPoolName); + + /** + * Upgrades the node image version of an agent pool to the latest. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void upgradeNodeImageVersion(String resourceGroupName, String resourceName, String agentPoolName, Context context); + + /** + * Gets a list of supported Kubernetes versions for the specified agent pool. + * + * See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more + * details about the version lifecycle. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of supported Kubernetes versions for the specified agent pool. + * + * See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more + * details about the version lifecycle along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getAvailableAgentPoolVersionsWithResponse(String resourceGroupName, + String resourceName, Context context); + + /** + * Gets a list of supported Kubernetes versions for the specified agent pool. + * + * See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more + * details about the version lifecycle. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of supported Kubernetes versions for the specified agent pool. + * + * See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more + * details about the version lifecycle. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AgentPoolAvailableVersionsInner getAvailableAgentPoolVersions(String resourceGroupName, String resourceName); + + /** + * Gets the upgrade profile for an agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upgrade profile for an agent pool along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getUpgradeProfileWithResponse(String resourceGroupName, String resourceName, + String agentPoolName, Context context); + + /** + * Gets the upgrade profile for an agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upgrade profile for an agent pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AgentPoolUpgradeProfileInner getUpgradeProfile(String resourceGroupName, String resourceName, String agentPoolName); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/ContainerServiceManagementClient.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/ContainerServiceManagementClient.java new file mode 100644 index 000000000000..21777f985a90 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/ContainerServiceManagementClient.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** + * The interface for ContainerServiceManagementClient class. + */ +public interface ContainerServiceManagementClient { + /** + * Gets Service host. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Version parameter. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the AgentPoolsClient object to access its operations. + * + * @return the AgentPoolsClient object. + */ + AgentPoolsClient getAgentPools(); + + /** + * Gets the ManagedClustersClient object to access its operations. + * + * @return the ManagedClustersClient object. + */ + ManagedClustersClient getManagedClusters(); + + /** + * Gets the MaintenanceConfigurationsClient object to access its operations. + * + * @return the MaintenanceConfigurationsClient object. + */ + MaintenanceConfigurationsClient getMaintenanceConfigurations(); + + /** + * Gets the ManagedNamespacesClient object to access its operations. + * + * @return the ManagedNamespacesClient object. + */ + ManagedNamespacesClient getManagedNamespaces(); + + /** + * Gets the MachinesClient object to access its operations. + * + * @return the MachinesClient object. + */ + MachinesClient getMachines(); + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + PrivateEndpointConnectionsClient getPrivateEndpointConnections(); + + /** + * Gets the SnapshotsClient object to access its operations. + * + * @return the SnapshotsClient object. + */ + SnapshotsClient getSnapshots(); + + /** + * Gets the TrustedAccessRoleBindingsClient object to access its operations. + * + * @return the TrustedAccessRoleBindingsClient object. + */ + TrustedAccessRoleBindingsClient getTrustedAccessRoleBindings(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + PrivateLinkResourcesClient getPrivateLinkResources(); + + /** + * Gets the ResolvePrivateLinkServiceIdsClient object to access its operations. + * + * @return the ResolvePrivateLinkServiceIdsClient object. + */ + ResolvePrivateLinkServiceIdsClient getResolvePrivateLinkServiceIds(); + + /** + * Gets the TrustedAccessRolesClient object to access its operations. + * + * @return the TrustedAccessRolesClient object. + */ + TrustedAccessRolesClient getTrustedAccessRoles(); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/MachinesClient.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/MachinesClient.java new file mode 100644 index 000000000000..603f2fd4d6ef --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/MachinesClient.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.fluent.models.MachineInner; + +/** + * An instance of this class provides access to all the operations defined in MachinesClient. + */ +public interface MachinesClient { + /** + * Get a specific machine in the specified agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param machineName Host name of the machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific machine in the specified agent pool along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String resourceName, String agentPoolName, + String machineName, Context context); + + /** + * Get a specific machine in the specified agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param machineName Host name of the machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific machine in the specified agent pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MachineInner get(String resourceGroupName, String resourceName, String agentPoolName, String machineName); + + /** + * Gets a list of machines in the specified agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of machines in the specified agent pool as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String resourceName, String agentPoolName); + + /** + * Gets a list of machines in the specified agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of machines in the specified agent pool as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String resourceName, String agentPoolName, + Context context); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/MaintenanceConfigurationsClient.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/MaintenanceConfigurationsClient.java new file mode 100644 index 000000000000..3151a2d84d10 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/MaintenanceConfigurationsClient.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.fluent.models.MaintenanceConfigurationInner; + +/** + * An instance of this class provides access to all the operations defined in MaintenanceConfigurationsClient. + */ +public interface MaintenanceConfigurationsClient { + /** + * Gets the specified maintenance configuration of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param configName The name of the maintenance configuration. Supported values are 'default', + * 'aksManagedAutoUpgradeSchedule', or 'aksManagedNodeOSUpgradeSchedule'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified maintenance configuration of a managed cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String resourceName, + String configName, Context context); + + /** + * Gets the specified maintenance configuration of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param configName The name of the maintenance configuration. Supported values are 'default', + * 'aksManagedAutoUpgradeSchedule', or 'aksManagedNodeOSUpgradeSchedule'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified maintenance configuration of a managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MaintenanceConfigurationInner get(String resourceGroupName, String resourceName, String configName); + + /** + * Creates or updates a maintenance configuration in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param configName The name of the maintenance configuration. Supported values are 'default', + * 'aksManagedAutoUpgradeSchedule', or 'aksManagedNodeOSUpgradeSchedule'. + * @param parameters The maintenance configuration to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return planned maintenance configuration, used to configure when updates can be deployed to a Managed Cluster + * along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, String resourceName, + String configName, MaintenanceConfigurationInner parameters, Context context); + + /** + * Creates or updates a maintenance configuration in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param configName The name of the maintenance configuration. Supported values are 'default', + * 'aksManagedAutoUpgradeSchedule', or 'aksManagedNodeOSUpgradeSchedule'. + * @param parameters The maintenance configuration to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return planned maintenance configuration, used to configure when updates can be deployed to a Managed Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MaintenanceConfigurationInner createOrUpdate(String resourceGroupName, String resourceName, String configName, + MaintenanceConfigurationInner parameters); + + /** + * Deletes a maintenance configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param configName The name of the maintenance configuration. Supported values are 'default', + * 'aksManagedAutoUpgradeSchedule', or 'aksManagedNodeOSUpgradeSchedule'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String resourceName, String configName, + Context context); + + /** + * Deletes a maintenance configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param configName The name of the maintenance configuration. Supported values are 'default', + * 'aksManagedAutoUpgradeSchedule', or 'aksManagedNodeOSUpgradeSchedule'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String resourceName, String configName); + + /** + * Gets a list of maintenance configurations in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of maintenance configurations in the specified managed cluster as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByManagedCluster(String resourceGroupName, String resourceName); + + /** + * Gets a list of maintenance configurations in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of maintenance configurations in the specified managed cluster as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByManagedCluster(String resourceGroupName, String resourceName, + Context context); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/ManagedClustersClient.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/ManagedClustersClient.java new file mode 100644 index 000000000000..35348a938898 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/ManagedClustersClient.java @@ -0,0 +1,1234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerservice.generated.fluent.models.CredentialResultsInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.KubernetesVersionListResultInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterAccessProfileInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterUpgradeProfileInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.MeshRevisionProfileInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.MeshUpgradeProfileInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.OutboundEnvironmentEndpointInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.RunCommandResultInner; +import com.azure.resourcemanager.containerservice.generated.models.Format; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAADProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterServicePrincipalProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClustersGetCommandResultResponse; +import com.azure.resourcemanager.containerservice.generated.models.RunCommandRequest; +import com.azure.resourcemanager.containerservice.generated.models.TagsObject; + +/** + * An instance of this class provides access to all the operations defined in ManagedClustersClient. + */ +public interface ManagedClustersClient { + /** + * Gets a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a managed cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String resourceName, + Context context); + + /** + * Gets a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedClusterInner getByResourceGroup(String resourceGroupName, String resourceName); + + /** + * Creates or updates a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The managed cluster to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of managed cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ManagedClusterInner> beginCreateOrUpdate(String resourceGroupName, + String resourceName, ManagedClusterInner parameters); + + /** + * Creates or updates a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The managed cluster to create or update. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param ifNoneMatch The request should only proceed if no entity matches this string. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of managed cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ManagedClusterInner> beginCreateOrUpdate(String resourceGroupName, + String resourceName, ManagedClusterInner parameters, String ifMatch, String ifNoneMatch, Context context); + + /** + * Creates or updates a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The managed cluster to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedClusterInner createOrUpdate(String resourceGroupName, String resourceName, ManagedClusterInner parameters); + + /** + * Creates or updates a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The managed cluster to create or update. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param ifNoneMatch The request should only proceed if no entity matches this string. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedClusterInner createOrUpdate(String resourceGroupName, String resourceName, ManagedClusterInner parameters, + String ifMatch, String ifNoneMatch, Context context); + + /** + * Updates tags on a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update Managed Cluster Tags operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of managed cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ManagedClusterInner> beginUpdateTags(String resourceGroupName, + String resourceName, TagsObject parameters); + + /** + * Updates tags on a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update Managed Cluster Tags operation. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of managed cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ManagedClusterInner> beginUpdateTags(String resourceGroupName, + String resourceName, TagsObject parameters, String ifMatch, Context context); + + /** + * Updates tags on a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update Managed Cluster Tags operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedClusterInner updateTags(String resourceGroupName, String resourceName, TagsObject parameters); + + /** + * Updates tags on a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update Managed Cluster Tags operation. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedClusterInner updateTags(String resourceGroupName, String resourceName, TagsObject parameters, String ifMatch, + Context context); + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName); + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, String ifMatch, + Context context); + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String resourceName); + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String resourceName, String ifMatch, Context context); + + /** + * Lists managed clusters in the specified subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ManagedCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists managed clusters in the specified subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ManagedCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets a list of managed clusters in the specified subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of managed clusters in the specified subscription as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets a list of managed clusters in the specified subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of managed clusters in the specified subscription as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets an access profile of a managed cluster. + * + * **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) + * . + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param roleName The name of the role for managed cluster accessProfile resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an access profile of a managed cluster. + * + * **WARNING**: This API will be deprecated along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getAccessProfileWithResponse(String resourceGroupName, + String resourceName, String roleName, Context context); + + /** + * Gets an access profile of a managed cluster. + * + * **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) + * . + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param roleName The name of the role for managed cluster accessProfile resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an access profile of a managed cluster. + * + * **WARNING**: This API will be deprecated. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedClusterAccessProfileInner getAccessProfile(String resourceGroupName, String resourceName, String roleName); + + /** + * Lists the admin credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param serverFqdn server fqdn type for credentials to be returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list credential result response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listClusterAdminCredentialsWithResponse(String resourceGroupName, + String resourceName, String serverFqdn, Context context); + + /** + * Lists the admin credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list credential result response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CredentialResultsInner listClusterAdminCredentials(String resourceGroupName, String resourceName); + + /** + * Lists the user credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param serverFqdn server fqdn type for credentials to be returned. + * @param format 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list credential result response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listClusterUserCredentialsWithResponse(String resourceGroupName, + String resourceName, String serverFqdn, Format format, Context context); + + /** + * Lists the user credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list credential result response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CredentialResultsInner listClusterUserCredentials(String resourceGroupName, String resourceName); + + /** + * Lists the cluster monitoring user credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param serverFqdn server fqdn type for credentials to be returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list credential result response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listClusterMonitoringUserCredentialsWithResponse(String resourceGroupName, + String resourceName, String serverFqdn, Context context); + + /** + * Lists the cluster monitoring user credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list credential result response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CredentialResultsInner listClusterMonitoringUserCredentials(String resourceGroupName, String resourceName); + + /** + * Reset the Service Principal Profile of a managed cluster. + * + * This action cannot be performed on a cluster that is not using a service principal. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The service principal profile to set on the managed cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginResetServicePrincipalProfile(String resourceGroupName, String resourceName, + ManagedClusterServicePrincipalProfile parameters); + + /** + * Reset the Service Principal Profile of a managed cluster. + * + * This action cannot be performed on a cluster that is not using a service principal. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The service principal profile to set on the managed cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginResetServicePrincipalProfile(String resourceGroupName, String resourceName, + ManagedClusterServicePrincipalProfile parameters, Context context); + + /** + * Reset the Service Principal Profile of a managed cluster. + * + * This action cannot be performed on a cluster that is not using a service principal. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The service principal profile to set on the managed cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void resetServicePrincipalProfile(String resourceGroupName, String resourceName, + ManagedClusterServicePrincipalProfile parameters); + + /** + * Reset the Service Principal Profile of a managed cluster. + * + * This action cannot be performed on a cluster that is not using a service principal. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The service principal profile to set on the managed cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void resetServicePrincipalProfile(String resourceGroupName, String resourceName, + ManagedClusterServicePrincipalProfile parameters, Context context); + + /** + * Reset the AAD Profile of a managed cluster. + * + * **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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The AAD profile to set on the Managed Cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginResetAADProfile(String resourceGroupName, String resourceName, + ManagedClusterAADProfile parameters); + + /** + * Reset the AAD Profile of a managed cluster. + * + * **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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The AAD profile to set on the Managed Cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginResetAADProfile(String resourceGroupName, String resourceName, + ManagedClusterAADProfile parameters, Context context); + + /** + * Reset the AAD Profile of a managed cluster. + * + * **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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The AAD profile to set on the Managed Cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void resetAADProfile(String resourceGroupName, String resourceName, ManagedClusterAADProfile parameters); + + /** + * Reset the AAD Profile of a managed cluster. + * + * **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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The AAD profile to set on the Managed Cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void resetAADProfile(String resourceGroupName, String resourceName, ManagedClusterAADProfile parameters, + Context context); + + /** + * Rotates the certificates of a managed cluster. + * + * See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about + * rotating managed cluster certificates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRotateClusterCertificates(String resourceGroupName, String resourceName); + + /** + * Rotates the certificates of a managed cluster. + * + * See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about + * rotating managed cluster certificates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRotateClusterCertificates(String resourceGroupName, String resourceName, + Context context); + + /** + * Rotates the certificates of a managed cluster. + * + * See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about + * rotating managed cluster certificates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void rotateClusterCertificates(String resourceGroupName, String resourceName); + + /** + * Rotates the certificates of a managed cluster. + * + * See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about + * rotating managed cluster certificates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void rotateClusterCertificates(String resourceGroupName, String resourceName, Context context); + + /** + * Aborts last operation running on managed cluster. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginAbortLatestOperation(String resourceGroupName, String resourceName); + + /** + * Aborts last operation running on managed cluster. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginAbortLatestOperation(String resourceGroupName, String resourceName, + Context context); + + /** + * Aborts last operation running on managed cluster. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void abortLatestOperation(String resourceGroupName, String resourceName); + + /** + * Aborts last operation running on managed cluster. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void abortLatestOperation(String resourceGroupName, String resourceName, Context context); + + /** + * Rotates the service account signing keys of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRotateServiceAccountSigningKeys(String resourceGroupName, + String resourceName); + + /** + * Rotates the service account signing keys of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRotateServiceAccountSigningKeys(String resourceGroupName, + String resourceName, Context context); + + /** + * Rotates the service account signing keys of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void rotateServiceAccountSigningKeys(String resourceGroupName, String resourceName); + + /** + * Rotates the service account signing keys of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void rotateServiceAccountSigningKeys(String resourceGroupName, String resourceName, Context context); + + /** + * Stops a Managed Cluster + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStop(String resourceGroupName, String resourceName); + + /** + * Stops a Managed Cluster + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStop(String resourceGroupName, String resourceName, Context context); + + /** + * Stops a Managed Cluster + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void stop(String resourceGroupName, String resourceName); + + /** + * Stops a Managed Cluster + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void stop(String resourceGroupName, String resourceName, Context context); + + /** + * Starts a previously stopped Managed Cluster + * + * See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting + * a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStart(String resourceGroupName, String resourceName); + + /** + * Starts a previously stopped Managed Cluster + * + * See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting + * a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStart(String resourceGroupName, String resourceName, Context context); + + /** + * Starts a previously stopped Managed Cluster + * + * See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting + * a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String resourceGroupName, String resourceName); + + /** + * Starts a previously stopped Managed Cluster + * + * See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting + * a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String resourceGroupName, String resourceName, Context context); + + /** + * Submits a command to run against the Managed Cluster. + * + * 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). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param requestPayload The run command request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RunCommandResultInner> beginRunCommand(String resourceGroupName, + String resourceName, RunCommandRequest requestPayload); + + /** + * Submits a command to run against the Managed Cluster. + * + * 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). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param requestPayload The run command request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RunCommandResultInner> beginRunCommand(String resourceGroupName, + String resourceName, RunCommandRequest requestPayload, Context context); + + /** + * Submits a command to run against the Managed Cluster. + * + * 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). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param requestPayload The run command request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RunCommandResultInner runCommand(String resourceGroupName, String resourceName, RunCommandRequest requestPayload); + + /** + * Submits a command to run against the Managed Cluster. + * + * 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). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param requestPayload The run command request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RunCommandResultInner runCommand(String resourceGroupName, String resourceName, RunCommandRequest requestPayload, + Context context); + + /** + * Gets the results of a command which has been run on the Managed Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param commandId Id of the command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the results of a command which has been run on the Managed Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedClustersGetCommandResultResponse getCommandResultWithResponse(String resourceGroupName, String resourceName, + String commandId, Context context); + + /** + * Gets the results of a command which has been run on the Managed Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param commandId Id of the command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the results of a command which has been run on the Managed Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RunCommandResultInner getCommandResult(String resourceGroupName, String resourceName, String commandId); + + /** + * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed + * cluster. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed + * cluster. + * + * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster + * as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listOutboundNetworkDependenciesEndpoints(String resourceGroupName, + String resourceName); + + /** + * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed + * cluster. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed + * cluster. + * + * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster + * as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listOutboundNetworkDependenciesEndpoints(String resourceGroupName, + String resourceName, Context context); + + /** + * Gets the upgrade profile of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upgrade profile of a managed cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getUpgradeProfileWithResponse(String resourceGroupName, + String resourceName, Context context); + + /** + * Gets the upgrade profile of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upgrade profile of a managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedClusterUpgradeProfileInner getUpgradeProfile(String resourceGroupName, String resourceName); + + /** + * Gets a mesh revision profile for a specified mesh in the specified location. + * + * Contains extra metadata on the revision, including supported revisions, cluster compatibility and available + * upgrades. + * + * @param location The name of the Azure region. + * @param mode The mode of the mesh. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a mesh revision profile for a specified mesh in the specified location. + * + * Contains extra metadata on the revision, including supported revisions, cluster compatibility and available + * upgrades along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getMeshRevisionProfileWithResponse(String location, String mode, + Context context); + + /** + * Gets a mesh revision profile for a specified mesh in the specified location. + * + * Contains extra metadata on the revision, including supported revisions, cluster compatibility and available + * upgrades. + * + * @param location The name of the Azure region. + * @param mode The mode of the mesh. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a mesh revision profile for a specified mesh in the specified location. + * + * Contains extra metadata on the revision, including supported revisions, cluster compatibility and available + * upgrades. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MeshRevisionProfileInner getMeshRevisionProfile(String location, String mode); + + /** + * Lists mesh revision profiles for all meshes in the specified location. + * + * Contains extra metadata on each revision, including supported revisions, cluster compatibility and available + * upgrades. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return holds an array of MeshRevisionsProfiles as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listMeshRevisionProfiles(String location); + + /** + * Lists mesh revision profiles for all meshes in the specified location. + * + * Contains extra metadata on each revision, including supported revisions, cluster compatibility and available + * upgrades. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return holds an array of MeshRevisionsProfiles as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listMeshRevisionProfiles(String location, Context context); + + /** + * Gets available upgrades for a service mesh in a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param mode The mode of the mesh. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return available upgrades for a service mesh in a cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getMeshUpgradeProfileWithResponse(String resourceGroupName, String resourceName, + String mode, Context context); + + /** + * Gets available upgrades for a service mesh in a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param mode The mode of the mesh. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return available upgrades for a service mesh in a cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MeshUpgradeProfileInner getMeshUpgradeProfile(String resourceGroupName, String resourceName, String mode); + + /** + * Lists available upgrades for all service meshes in a specific cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return holds an array of MeshUpgradeProfiles as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listMeshUpgradeProfiles(String resourceGroupName, String resourceName); + + /** + * Lists available upgrades for all service meshes in a specific cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return holds an array of MeshUpgradeProfiles as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listMeshUpgradeProfiles(String resourceGroupName, String resourceName, + Context context); + + /** + * Gets a list of supported Kubernetes versions in the specified subscription. + * + * Contains extra metadata on the version, including supported patch versions, capabilities, available upgrades, and + * details on preview status of the version. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of supported Kubernetes versions in the specified subscription. + * + * Contains extra metadata on the version, including supported patch versions, capabilities, available upgrades, and + * details on preview status of the version along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listKubernetesVersionsWithResponse(String location, Context context); + + /** + * Gets a list of supported Kubernetes versions in the specified subscription. + * + * Contains extra metadata on the version, including supported patch versions, capabilities, available upgrades, and + * details on preview status of the version. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of supported Kubernetes versions in the specified subscription. + * + * Contains extra metadata on the version, including supported patch versions, capabilities, available upgrades, and + * details on preview status of the version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + KubernetesVersionListResultInner listKubernetesVersions(String location); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/ManagedNamespacesClient.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/ManagedNamespacesClient.java new file mode 100644 index 000000000000..5749af1cb6ca --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/ManagedNamespacesClient.java @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerservice.generated.fluent.models.CredentialResultsInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedNamespaceInner; +import com.azure.resourcemanager.containerservice.generated.models.TagsObject; + +/** + * An instance of this class provides access to all the operations defined in ManagedNamespacesClient. + */ +public interface ManagedNamespacesClient { + /** + * Gets the specified namespace of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified namespace of a managed cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String resourceName, + String managedNamespaceName, Context context); + + /** + * Gets the specified namespace of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified namespace of a managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedNamespaceInner get(String resourceGroupName, String resourceName, String managedNamespaceName); + + /** + * Creates or updates a namespace managed by ARM for the specified managed cluster. Users can configure aspects like + * resource quotas, network ingress/egress policies, and more. See aka.ms/aks/managed-namespaces for more details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @param parameters The namespace to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of namespace managed by ARM. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ManagedNamespaceInner> beginCreateOrUpdate(String resourceGroupName, + String resourceName, String managedNamespaceName, ManagedNamespaceInner parameters); + + /** + * Creates or updates a namespace managed by ARM for the specified managed cluster. Users can configure aspects like + * resource quotas, network ingress/egress policies, and more. See aka.ms/aks/managed-namespaces for more details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @param parameters The namespace to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of namespace managed by ARM. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ManagedNamespaceInner> beginCreateOrUpdate(String resourceGroupName, + String resourceName, String managedNamespaceName, ManagedNamespaceInner parameters, Context context); + + /** + * Creates or updates a namespace managed by ARM for the specified managed cluster. Users can configure aspects like + * resource quotas, network ingress/egress policies, and more. See aka.ms/aks/managed-namespaces for more details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @param parameters The namespace to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace managed by ARM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedNamespaceInner createOrUpdate(String resourceGroupName, String resourceName, String managedNamespaceName, + ManagedNamespaceInner parameters); + + /** + * Creates or updates a namespace managed by ARM for the specified managed cluster. Users can configure aspects like + * resource quotas, network ingress/egress policies, and more. See aka.ms/aks/managed-namespaces for more details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @param parameters The namespace to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace managed by ARM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedNamespaceInner createOrUpdate(String resourceGroupName, String resourceName, String managedNamespaceName, + ManagedNamespaceInner parameters, Context context); + + /** + * Updates tags on a managed namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @param parameters Parameters supplied to the patch namespace operation, we only support patch tags for now. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace managed by ARM along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse(String resourceGroupName, String resourceName, + String managedNamespaceName, TagsObject parameters, Context context); + + /** + * Updates tags on a managed namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @param parameters Parameters supplied to the patch namespace operation, we only support patch tags for now. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace managed by ARM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedNamespaceInner update(String resourceGroupName, String resourceName, String managedNamespaceName, + TagsObject parameters); + + /** + * Deletes a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, + String managedNamespaceName); + + /** + * Deletes a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, + String managedNamespaceName, Context context); + + /** + * Deletes a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String resourceName, String managedNamespaceName); + + /** + * Deletes a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String resourceName, String managedNamespaceName, Context context); + + /** + * Gets a list of managed namespaces in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of managed namespaces in the specified managed cluster as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByManagedCluster(String resourceGroupName, String resourceName); + + /** + * Gets a list of managed namespaces in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of managed namespaces in the specified managed cluster as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByManagedCluster(String resourceGroupName, String resourceName, + Context context); + + /** + * Lists the credentials of a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list credential result response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listCredentialWithResponse(String resourceGroupName, String resourceName, + String managedNamespaceName, Context context); + + /** + * Lists the credentials of a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list credential result response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CredentialResultsInner listCredential(String resourceGroupName, String resourceName, String managedNamespaceName); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/OperationsClient.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/OperationsClient.java new file mode 100644 index 000000000000..93d18c9cacab --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/OperationsClient.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.fluent.models.OperationValueInner; + +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ +public interface OperationsClient { + /** + * Gets a list of operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets a list of operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/PrivateEndpointConnectionsClient.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/PrivateEndpointConnectionsClient.java new file mode 100644 index 000000000000..f29425a5432b --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/PrivateEndpointConnectionsClient.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateEndpointConnectionListResultInner; + +/** + * An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. + */ +public interface PrivateEndpointConnectionsClient { + /** + * Gets the specified private endpoint connection. + * + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection. + * + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String resourceName, + String privateEndpointConnectionName, Context context); + + /** + * Gets the specified private endpoint connection. + * + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection. + * + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner get(String resourceGroupName, String resourceName, + String privateEndpointConnectionName); + + /** + * Updates a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters The updated private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse(String resourceGroupName, String resourceName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters, Context context); + + /** + * Updates a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters The updated private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner update(String resourceGroupName, String resourceName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters); + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, + String privateEndpointConnectionName); + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, + String privateEndpointConnectionName, Context context); + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String resourceName, String privateEndpointConnectionName); + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context); + + /** + * Gets a list of private endpoint connections in the specified managed cluster. + * + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private endpoint connections in the specified managed cluster. + * + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(String resourceGroupName, String resourceName, + Context context); + + /** + * Gets a list of private endpoint connections in the specified managed cluster. + * + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private endpoint connections in the specified managed cluster. + * + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionListResultInner list(String resourceGroupName, String resourceName); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/PrivateLinkResourcesClient.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/PrivateLinkResourcesClient.java new file mode 100644 index 000000000000..9e73192dfef4 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/PrivateLinkResourcesClient.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateLinkResourcesListResultInner; + +/** + * An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. + */ +public interface PrivateLinkResourcesClient { + /** + * Gets a list of private link resources in the specified managed cluster. + * + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources in the specified managed cluster. + * + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(String resourceGroupName, String resourceName, + Context context); + + /** + * Gets a list of private link resources in the specified managed cluster. + * + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources in the specified managed cluster. + * + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkResourcesListResultInner list(String resourceGroupName, String resourceName); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/ResolvePrivateLinkServiceIdsClient.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/ResolvePrivateLinkServiceIdsClient.java new file mode 100644 index 000000000000..f1283fd7bed8 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/ResolvePrivateLinkServiceIdsClient.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateLinkResourceInner; + +/** + * An instance of this class provides access to all the operations defined in ResolvePrivateLinkServiceIdsClient. + */ +public interface ResolvePrivateLinkServiceIdsClient { + /** + * Gets the private link service ID for the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters required in order to resolve a private link service ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link service ID for the specified managed cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response pOSTWithResponse(String resourceGroupName, String resourceName, + PrivateLinkResourceInner parameters, Context context); + + /** + * Gets the private link service ID for the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters required in order to resolve a private link service ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link service ID for the specified managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkResourceInner pOST(String resourceGroupName, String resourceName, PrivateLinkResourceInner parameters); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/SnapshotsClient.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/SnapshotsClient.java new file mode 100644 index 000000000000..24b99a62ae8e --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/SnapshotsClient.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.fluent.models.SnapshotInner; +import com.azure.resourcemanager.containerservice.generated.models.TagsObject; + +/** + * An instance of this class provides access to all the operations defined in SnapshotsClient. + */ +public interface SnapshotsClient { + /** + * Gets a snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a snapshot along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String resourceName, + Context context); + + /** + * Gets a snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a snapshot. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SnapshotInner getByResourceGroup(String resourceGroupName, String resourceName); + + /** + * Creates or updates a snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The snapshot to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a node pool snapshot resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, String resourceName, + SnapshotInner parameters, Context context); + + /** + * Creates or updates a snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The snapshot to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a node pool snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SnapshotInner createOrUpdate(String resourceGroupName, String resourceName, SnapshotInner parameters); + + /** + * Updates tags on a snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update snapshot Tags operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a node pool snapshot resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse(String resourceGroupName, String resourceName, TagsObject parameters, + Context context); + + /** + * Updates tags on a snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update snapshot Tags operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a node pool snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SnapshotInner updateTags(String resourceGroupName, String resourceName, TagsObject parameters); + + /** + * Deletes a snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String resourceName, Context context); + + /** + * Deletes a snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String resourceName); + + /** + * Lists snapshots in the specified subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Snapshot list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists snapshots in the specified subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Snapshot list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets a list of snapshots in the specified subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of snapshots in the specified subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets a list of snapshots in the specified subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of snapshots in the specified subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/TrustedAccessRoleBindingsClient.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/TrustedAccessRoleBindingsClient.java new file mode 100644 index 000000000000..8e5dc431d3af --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/TrustedAccessRoleBindingsClient.java @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerservice.generated.fluent.models.TrustedAccessRoleBindingInner; + +/** + * An instance of this class provides access to all the operations defined in TrustedAccessRoleBindingsClient. + */ +public interface TrustedAccessRoleBindingsClient { + /** + * Get a trusted access role binding. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param trustedAccessRoleBindingName The name of trusted access role binding. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a trusted access role binding along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String resourceName, + String trustedAccessRoleBindingName, Context context); + + /** + * Get a trusted access role binding. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param trustedAccessRoleBindingName The name of trusted access role binding. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a trusted access role binding. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TrustedAccessRoleBindingInner get(String resourceGroupName, String resourceName, + String trustedAccessRoleBindingName); + + /** + * Create or update a trusted access role binding. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param trustedAccessRoleBindingName The name of trusted access role binding. + * @param trustedAccessRoleBinding A trusted access role binding. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of defines binding between a resource and role. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, TrustedAccessRoleBindingInner> beginCreateOrUpdate( + String resourceGroupName, String resourceName, String trustedAccessRoleBindingName, + TrustedAccessRoleBindingInner trustedAccessRoleBinding); + + /** + * Create or update a trusted access role binding. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param trustedAccessRoleBindingName The name of trusted access role binding. + * @param trustedAccessRoleBinding A trusted access role binding. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of defines binding between a resource and role. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, TrustedAccessRoleBindingInner> beginCreateOrUpdate( + String resourceGroupName, String resourceName, String trustedAccessRoleBindingName, + TrustedAccessRoleBindingInner trustedAccessRoleBinding, Context context); + + /** + * Create or update a trusted access role binding. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param trustedAccessRoleBindingName The name of trusted access role binding. + * @param trustedAccessRoleBinding A trusted access role binding. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines binding between a resource and role. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TrustedAccessRoleBindingInner createOrUpdate(String resourceGroupName, String resourceName, + String trustedAccessRoleBindingName, TrustedAccessRoleBindingInner trustedAccessRoleBinding); + + /** + * Create or update a trusted access role binding. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param trustedAccessRoleBindingName The name of trusted access role binding. + * @param trustedAccessRoleBinding A trusted access role binding. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines binding between a resource and role. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TrustedAccessRoleBindingInner createOrUpdate(String resourceGroupName, String resourceName, + String trustedAccessRoleBindingName, TrustedAccessRoleBindingInner trustedAccessRoleBinding, Context context); + + /** + * Delete a trusted access role binding. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param trustedAccessRoleBindingName The name of trusted access role binding. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, + String trustedAccessRoleBindingName); + + /** + * Delete a trusted access role binding. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param trustedAccessRoleBindingName The name of trusted access role binding. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, + String trustedAccessRoleBindingName, Context context); + + /** + * Delete a trusted access role binding. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param trustedAccessRoleBindingName The name of trusted access role binding. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String resourceName, String trustedAccessRoleBindingName); + + /** + * Delete a trusted access role binding. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param trustedAccessRoleBindingName The name of trusted access role binding. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String resourceName, String trustedAccessRoleBindingName, Context context); + + /** + * List trusted access role bindings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TrustedAccessRoleBinding list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String resourceName); + + /** + * List trusted access role bindings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TrustedAccessRoleBinding list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String resourceName, Context context); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/TrustedAccessRolesClient.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/TrustedAccessRolesClient.java new file mode 100644 index 000000000000..113075c7ae93 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/TrustedAccessRolesClient.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.fluent.models.TrustedAccessRoleInner; + +/** + * An instance of this class provides access to all the operations defined in TrustedAccessRolesClient. + */ +public interface TrustedAccessRolesClient { + /** + * List supported trusted access roles. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of trusted access roles as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location); + + /** + * List supported trusted access roles. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of trusted access roles as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location, Context context); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AccessProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AccessProfile.java new file mode 100644 index 000000000000..e0dc70ec9d90 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AccessProfile.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Profile for enabling a user to access a managed cluster. + */ +@Immutable +public final class AccessProfile implements JsonSerializable { + /* + * Base64-encoded Kubernetes configuration file. + */ + private byte[] kubeConfig; + + /** + * Creates an instance of AccessProfile class. + */ + private AccessProfile() { + } + + /** + * Get the kubeConfig property: Base64-encoded Kubernetes configuration file. + * + * @return the kubeConfig value. + */ + public byte[] kubeConfig() { + return CoreUtils.clone(this.kubeConfig); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBinaryField("kubeConfig", this.kubeConfig); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccessProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccessProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AccessProfile. + */ + public static AccessProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccessProfile deserializedAccessProfile = new AccessProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kubeConfig".equals(fieldName)) { + deserializedAccessProfile.kubeConfig = reader.getBinary(); + } else { + reader.skipChildren(); + } + } + + return deserializedAccessProfile; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AgentPoolAvailableVersionsInner.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AgentPoolAvailableVersionsInner.java new file mode 100644 index 000000000000..84c91d4aef17 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AgentPoolAvailableVersionsInner.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem; +import java.io.IOException; +import java.util.List; + +/** + * The list of available versions for an agent pool. + */ +@Immutable +public final class AgentPoolAvailableVersionsInner implements JsonSerializable { + /* + * The ID of the agent pool version list. + */ + private String id; + + /* + * The name of the agent pool version list. + */ + private String name; + + /* + * Type of the agent pool version list. + */ + private String type; + + /* + * Properties of agent pool available versions. + */ + private AgentPoolAvailableVersionsProperties innerProperties; + + /** + * Creates an instance of AgentPoolAvailableVersionsInner class. + */ + private AgentPoolAvailableVersionsInner() { + } + + /** + * Get the id property: The ID of the agent pool version list. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the agent pool version list. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: Type of the agent pool version list. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the innerProperties property: Properties of agent pool available versions. + * + * @return the innerProperties value. + */ + private AgentPoolAvailableVersionsProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the agentPoolVersions property: List of versions available for agent pool. + * + * @return the agentPoolVersions value. + */ + public List agentPoolVersions() { + return this.innerProperties() == null ? null : this.innerProperties().agentPoolVersions(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AgentPoolAvailableVersionsInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AgentPoolAvailableVersionsInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AgentPoolAvailableVersionsInner. + */ + public static AgentPoolAvailableVersionsInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AgentPoolAvailableVersionsInner deserializedAgentPoolAvailableVersionsInner + = new AgentPoolAvailableVersionsInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedAgentPoolAvailableVersionsInner.innerProperties + = AgentPoolAvailableVersionsProperties.fromJson(reader); + } else if ("id".equals(fieldName)) { + deserializedAgentPoolAvailableVersionsInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAgentPoolAvailableVersionsInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAgentPoolAvailableVersionsInner.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAgentPoolAvailableVersionsInner; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AgentPoolAvailableVersionsProperties.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AgentPoolAvailableVersionsProperties.java new file mode 100644 index 000000000000..c3c5f715af31 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AgentPoolAvailableVersionsProperties.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem; +import java.io.IOException; +import java.util.List; + +/** + * The list of available agent pool versions. + */ +@Immutable +public final class AgentPoolAvailableVersionsProperties + implements JsonSerializable { + /* + * List of versions available for agent pool. + */ + private List agentPoolVersions; + + /** + * Creates an instance of AgentPoolAvailableVersionsProperties class. + */ + private AgentPoolAvailableVersionsProperties() { + } + + /** + * Get the agentPoolVersions property: List of versions available for agent pool. + * + * @return the agentPoolVersions value. + */ + public List agentPoolVersions() { + return this.agentPoolVersions; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("agentPoolVersions", this.agentPoolVersions, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AgentPoolAvailableVersionsProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AgentPoolAvailableVersionsProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AgentPoolAvailableVersionsProperties. + */ + public static AgentPoolAvailableVersionsProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AgentPoolAvailableVersionsProperties deserializedAgentPoolAvailableVersionsProperties + = new AgentPoolAvailableVersionsProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("agentPoolVersions".equals(fieldName)) { + List agentPoolVersions + = reader.readArray( + reader1 -> AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem.fromJson(reader1)); + deserializedAgentPoolAvailableVersionsProperties.agentPoolVersions = agentPoolVersions; + } else { + reader.skipChildren(); + } + } + + return deserializedAgentPoolAvailableVersionsProperties; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AgentPoolInner.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AgentPoolInner.java new file mode 100644 index 000000000000..90189989ebfb --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AgentPoolInner.java @@ -0,0 +1,1495 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolGatewayProfile; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolMode; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolNetworkProfile; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolSecurityProfile; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolStatus; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolType; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolUpgradeSettings; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolWindowsProfile; +import com.azure.resourcemanager.containerservice.generated.models.CreationData; +import com.azure.resourcemanager.containerservice.generated.models.GPUInstanceProfile; +import com.azure.resourcemanager.containerservice.generated.models.GPUProfile; +import com.azure.resourcemanager.containerservice.generated.models.KubeletConfig; +import com.azure.resourcemanager.containerservice.generated.models.KubeletDiskType; +import com.azure.resourcemanager.containerservice.generated.models.LinuxOSConfig; +import com.azure.resourcemanager.containerservice.generated.models.LocalDNSProfile; +import com.azure.resourcemanager.containerservice.generated.models.OSDiskType; +import com.azure.resourcemanager.containerservice.generated.models.OSSKU; +import com.azure.resourcemanager.containerservice.generated.models.OSType; +import com.azure.resourcemanager.containerservice.generated.models.PodIPAllocationMode; +import com.azure.resourcemanager.containerservice.generated.models.PowerState; +import com.azure.resourcemanager.containerservice.generated.models.ScaleDownMode; +import com.azure.resourcemanager.containerservice.generated.models.ScaleSetEvictionPolicy; +import com.azure.resourcemanager.containerservice.generated.models.ScaleSetPriority; +import com.azure.resourcemanager.containerservice.generated.models.VirtualMachineNodes; +import com.azure.resourcemanager.containerservice.generated.models.VirtualMachinesProfile; +import com.azure.resourcemanager.containerservice.generated.models.WorkloadRuntime; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Agent Pool. + */ +@Fluent +public final class AgentPoolInner extends ProxyResource { + /* + * Properties of an agent pool. + */ + private ManagedClusterAgentPoolProfileProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of AgentPoolInner class. + */ + public AgentPoolInner() { + } + + /** + * Get the innerProperties property: Properties of an agent pool. + * + * @return the innerProperties value. + */ + private ManagedClusterAgentPoolProfileProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the eTag property: Unique read-only string used to implement optimistic concurrency. The eTag value will + * change when the resource is updated. Specify an if-match or if-none-match header with the eTag value for a + * subsequent request to enable optimistic concurrency per the normal eTag convention. + * + * @return the eTag value. + */ + public String eTag() { + return this.innerProperties() == null ? null : this.innerProperties().eTag(); + } + + /** + * Get the count property: 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. + * + * @return the count value. + */ + public Integer count() { + return this.innerProperties() == null ? null : this.innerProperties().count(); + } + + /** + * Set the count property: 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. + * + * @param count the count value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withCount(Integer count) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withCount(count); + return this; + } + + /** + * Get the vmSize property: The size of the agent pool VMs. 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. + * + * @return the vmSize value. + */ + public String vmSize() { + return this.innerProperties() == null ? null : this.innerProperties().vmSize(); + } + + /** + * Set the vmSize property: The size of the agent pool VMs. 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. + * + * @param vmSize the vmSize value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withVmSize(String vmSize) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withVmSize(vmSize); + return this; + } + + /** + * Get the osDiskSizeGB property: 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. + * + * @return the osDiskSizeGB value. + */ + public Integer osDiskSizeGB() { + return this.innerProperties() == null ? null : this.innerProperties().osDiskSizeGB(); + } + + /** + * Set the osDiskSizeGB property: 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. + * + * @param osDiskSizeGB the osDiskSizeGB value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withOsDiskSizeGB(Integer osDiskSizeGB) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withOsDiskSizeGB(osDiskSizeGB); + return this; + } + + /** + * Get the osDiskType property: The OS disk type to be used for machines in the agent pool. 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). + * + * @return the osDiskType value. + */ + public OSDiskType osDiskType() { + return this.innerProperties() == null ? null : this.innerProperties().osDiskType(); + } + + /** + * Set the osDiskType property: The OS disk type to be used for machines in the agent pool. 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). + * + * @param osDiskType the osDiskType value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withOsDiskType(OSDiskType osDiskType) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withOsDiskType(osDiskType); + return this; + } + + /** + * Get the kubeletDiskType property: Determines the placement of emptyDir volumes, container runtime data root, and + * Kubelet ephemeral storage. + * + * @return the kubeletDiskType value. + */ + public KubeletDiskType kubeletDiskType() { + return this.innerProperties() == null ? null : this.innerProperties().kubeletDiskType(); + } + + /** + * Set the kubeletDiskType property: Determines the placement of emptyDir volumes, container runtime data root, and + * Kubelet ephemeral storage. + * + * @param kubeletDiskType the kubeletDiskType value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withKubeletDiskType(KubeletDiskType kubeletDiskType) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withKubeletDiskType(kubeletDiskType); + return this; + } + + /** + * Get the workloadRuntime property: Determines the type of workload a node can run. + * + * @return the workloadRuntime value. + */ + public WorkloadRuntime workloadRuntime() { + return this.innerProperties() == null ? null : this.innerProperties().workloadRuntime(); + } + + /** + * Set the workloadRuntime property: Determines the type of workload a node can run. + * + * @param workloadRuntime the workloadRuntime value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withWorkloadRuntime(WorkloadRuntime workloadRuntime) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withWorkloadRuntime(workloadRuntime); + return this; + } + + /** + * Get the messageOfTheDay property: Message of the day for Linux nodes, base64-encoded. A base64-encoded string + * which will be written to /etc/motd after decoding. This allows customization of the message of the day for Linux + * nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be printed raw and not + * be executed as a script). + * + * @return the messageOfTheDay value. + */ + public String messageOfTheDay() { + return this.innerProperties() == null ? null : this.innerProperties().messageOfTheDay(); + } + + /** + * Set the messageOfTheDay property: Message of the day for Linux nodes, base64-encoded. A base64-encoded string + * which will be written to /etc/motd after decoding. This allows customization of the message of the day for Linux + * nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be printed raw and not + * be executed as a script). + * + * @param messageOfTheDay the messageOfTheDay value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withMessageOfTheDay(String messageOfTheDay) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withMessageOfTheDay(messageOfTheDay); + return this; + } + + /** + * Get the vnetSubnetID property: The ID of the subnet which agent pool nodes and optionally pods will join on + * startup. 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}. + * + * @return the vnetSubnetID value. + */ + public String vnetSubnetID() { + return this.innerProperties() == null ? null : this.innerProperties().vnetSubnetID(); + } + + /** + * Set the vnetSubnetID property: The ID of the subnet which agent pool nodes and optionally pods will join on + * startup. 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}. + * + * @param vnetSubnetID the vnetSubnetID value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withVnetSubnetID(String vnetSubnetID) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withVnetSubnetID(vnetSubnetID); + return this; + } + + /** + * Get the podSubnetID property: The ID of the subnet which pods will join when launched. 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}. + * + * @return the podSubnetID value. + */ + public String podSubnetID() { + return this.innerProperties() == null ? null : this.innerProperties().podSubnetID(); + } + + /** + * Set the podSubnetID property: The ID of the subnet which pods will join when launched. 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}. + * + * @param podSubnetID the podSubnetID value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withPodSubnetID(String podSubnetID) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withPodSubnetID(podSubnetID); + return this; + } + + /** + * Get the podIPAllocationMode property: Pod IP Allocation Mode. The IP allocation mode for pods in the agent pool. + * Must be used with podSubnetId. The default is 'DynamicIndividual'. + * + * @return the podIPAllocationMode value. + */ + public PodIPAllocationMode podIPAllocationMode() { + return this.innerProperties() == null ? null : this.innerProperties().podIPAllocationMode(); + } + + /** + * Set the podIPAllocationMode property: Pod IP Allocation Mode. The IP allocation mode for pods in the agent pool. + * Must be used with podSubnetId. The default is 'DynamicIndividual'. + * + * @param podIPAllocationMode the podIPAllocationMode value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withPodIPAllocationMode(PodIPAllocationMode podIPAllocationMode) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withPodIPAllocationMode(podIPAllocationMode); + return this; + } + + /** + * Get the maxPods property: The maximum number of pods that can run on a node. + * + * @return the maxPods value. + */ + public Integer maxPods() { + return this.innerProperties() == null ? null : this.innerProperties().maxPods(); + } + + /** + * Set the maxPods property: The maximum number of pods that can run on a node. + * + * @param maxPods the maxPods value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withMaxPods(Integer maxPods) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withMaxPods(maxPods); + return this; + } + + /** + * Get the osType property: The operating system type. The default is Linux. + * + * @return the osType value. + */ + public OSType osType() { + return this.innerProperties() == null ? null : this.innerProperties().osType(); + } + + /** + * Set the osType property: The operating system type. The default is Linux. + * + * @param osType the osType value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withOsType(OSType osType) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withOsType(osType); + return this; + } + + /** + * Get the osSKU property: 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. + * + * @return the osSKU value. + */ + public OSSKU osSKU() { + return this.innerProperties() == null ? null : this.innerProperties().osSKU(); + } + + /** + * Set the osSKU property: 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. + * + * @param osSKU the osSKU value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withOsSKU(OSSKU osSKU) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withOsSKU(osSKU); + return this; + } + + /** + * Get the maxCount property: The maximum number of nodes for auto-scaling. + * + * @return the maxCount value. + */ + public Integer maxCount() { + return this.innerProperties() == null ? null : this.innerProperties().maxCount(); + } + + /** + * Set the maxCount property: The maximum number of nodes for auto-scaling. + * + * @param maxCount the maxCount value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withMaxCount(Integer maxCount) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withMaxCount(maxCount); + return this; + } + + /** + * Get the minCount property: The minimum number of nodes for auto-scaling. + * + * @return the minCount value. + */ + public Integer minCount() { + return this.innerProperties() == null ? null : this.innerProperties().minCount(); + } + + /** + * Set the minCount property: The minimum number of nodes for auto-scaling. + * + * @param minCount the minCount value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withMinCount(Integer minCount) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withMinCount(minCount); + return this; + } + + /** + * Get the enableAutoScaling property: Whether to enable auto-scaler. + * + * @return the enableAutoScaling value. + */ + public Boolean enableAutoScaling() { + return this.innerProperties() == null ? null : this.innerProperties().enableAutoScaling(); + } + + /** + * Set the enableAutoScaling property: Whether to enable auto-scaler. + * + * @param enableAutoScaling the enableAutoScaling value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withEnableAutoScaling(Boolean enableAutoScaling) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withEnableAutoScaling(enableAutoScaling); + return this; + } + + /** + * Get the scaleDownMode property: The scale down mode to use when scaling the Agent Pool. This also effects the + * cluster autoscaler behavior. If not specified, it defaults to Delete. + * + * @return the scaleDownMode value. + */ + public ScaleDownMode scaleDownMode() { + return this.innerProperties() == null ? null : this.innerProperties().scaleDownMode(); + } + + /** + * Set the scaleDownMode property: The scale down mode to use when scaling the Agent Pool. This also effects the + * cluster autoscaler behavior. If not specified, it defaults to Delete. + * + * @param scaleDownMode the scaleDownMode value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withScaleDownMode(ScaleDownMode scaleDownMode) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withScaleDownMode(scaleDownMode); + return this; + } + + /** + * Get the type property: The type of Agent Pool. + * + * @return the type value. + */ + public AgentPoolType typePropertiesType() { + return this.innerProperties() == null ? null : this.innerProperties().type(); + } + + /** + * Set the type property: The type of Agent Pool. + * + * @param type the type value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withTypePropertiesType(AgentPoolType type) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withType(type); + return this; + } + + /** + * Get the mode property: The mode of an 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. + * + * @return the mode value. + */ + public AgentPoolMode mode() { + return this.innerProperties() == null ? null : this.innerProperties().mode(); + } + + /** + * Set the mode property: The mode of an 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. + * + * @param mode the mode value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withMode(AgentPoolMode mode) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withMode(mode); + return this; + } + + /** + * Get the orchestratorVersion property: The version of Kubernetes specified by the user. 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). + * + * @return the orchestratorVersion value. + */ + public String orchestratorVersion() { + return this.innerProperties() == null ? null : this.innerProperties().orchestratorVersion(); + } + + /** + * Set the orchestratorVersion property: The version of Kubernetes specified by the user. 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). + * + * @param orchestratorVersion the orchestratorVersion value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withOrchestratorVersion(String orchestratorVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withOrchestratorVersion(orchestratorVersion); + return this; + } + + /** + * Get the currentOrchestratorVersion property: The version of Kubernetes the Agent Pool is running. 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. + * + * @return the currentOrchestratorVersion value. + */ + public String currentOrchestratorVersion() { + return this.innerProperties() == null ? null : this.innerProperties().currentOrchestratorVersion(); + } + + /** + * Get the nodeImageVersion property: The version of node image. + * + * @return the nodeImageVersion value. + */ + public String nodeImageVersion() { + return this.innerProperties() == null ? null : this.innerProperties().nodeImageVersion(); + } + + /** + * Get the upgradeSettings property: Settings for upgrading the agentpool. + * + * @return the upgradeSettings value. + */ + public AgentPoolUpgradeSettings upgradeSettings() { + return this.innerProperties() == null ? null : this.innerProperties().upgradeSettings(); + } + + /** + * Set the upgradeSettings property: Settings for upgrading the agentpool. + * + * @param upgradeSettings the upgradeSettings value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withUpgradeSettings(AgentPoolUpgradeSettings upgradeSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withUpgradeSettings(upgradeSettings); + return this; + } + + /** + * Get the provisioningState property: The current deployment or provisioning state. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the powerState property: Whether the Agent Pool is running or stopped. 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. + * + * @return the powerState value. + */ + public PowerState powerState() { + return this.innerProperties() == null ? null : this.innerProperties().powerState(); + } + + /** + * Set the powerState property: Whether the Agent Pool is running or stopped. 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. + * + * @param powerState the powerState value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withPowerState(PowerState powerState) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withPowerState(powerState); + return this; + } + + /** + * Get the availabilityZones property: The list of Availability zones to use for nodes. This can only be specified + * if the AgentPoolType property is 'VirtualMachineScaleSets'. + * + * @return the availabilityZones value. + */ + public List availabilityZones() { + return this.innerProperties() == null ? null : this.innerProperties().availabilityZones(); + } + + /** + * Set the availabilityZones property: The list of Availability zones to use for nodes. This can only be specified + * if the AgentPoolType property is 'VirtualMachineScaleSets'. + * + * @param availabilityZones the availabilityZones value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withAvailabilityZones(List availabilityZones) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withAvailabilityZones(availabilityZones); + return this; + } + + /** + * Get the enableNodePublicIP property: Whether each node is allocated its own public IP. 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. + * + * @return the enableNodePublicIP value. + */ + public Boolean enableNodePublicIP() { + return this.innerProperties() == null ? null : this.innerProperties().enableNodePublicIP(); + } + + /** + * Set the enableNodePublicIP property: Whether each node is allocated its own public IP. 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. + * + * @param enableNodePublicIP the enableNodePublicIP value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withEnableNodePublicIP(Boolean enableNodePublicIP) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withEnableNodePublicIP(enableNodePublicIP); + return this; + } + + /** + * Get the nodePublicIPPrefixID property: The public IP prefix ID which VM nodes should use IPs from. This is of the + * form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + * + * @return the nodePublicIPPrefixID value. + */ + public String nodePublicIPPrefixID() { + return this.innerProperties() == null ? null : this.innerProperties().nodePublicIPPrefixID(); + } + + /** + * Set the nodePublicIPPrefixID property: The public IP prefix ID which VM nodes should use IPs from. This is of the + * form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + * + * @param nodePublicIPPrefixID the nodePublicIPPrefixID value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withNodePublicIPPrefixID(String nodePublicIPPrefixID) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withNodePublicIPPrefixID(nodePublicIPPrefixID); + return this; + } + + /** + * Get the scaleSetPriority property: The Virtual Machine Scale Set priority. + * + * @return the scaleSetPriority value. + */ + public ScaleSetPriority scaleSetPriority() { + return this.innerProperties() == null ? null : this.innerProperties().scaleSetPriority(); + } + + /** + * Set the scaleSetPriority property: The Virtual Machine Scale Set priority. + * + * @param scaleSetPriority the scaleSetPriority value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withScaleSetPriority(ScaleSetPriority scaleSetPriority) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withScaleSetPriority(scaleSetPriority); + return this; + } + + /** + * Get the scaleSetEvictionPolicy property: The Virtual Machine Scale Set eviction policy. 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). + * + * @return the scaleSetEvictionPolicy value. + */ + public ScaleSetEvictionPolicy scaleSetEvictionPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().scaleSetEvictionPolicy(); + } + + /** + * Set the scaleSetEvictionPolicy property: The Virtual Machine Scale Set eviction policy. 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). + * + * @param scaleSetEvictionPolicy the scaleSetEvictionPolicy value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withScaleSetEvictionPolicy(ScaleSetEvictionPolicy scaleSetEvictionPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withScaleSetEvictionPolicy(scaleSetEvictionPolicy); + return this; + } + + /** + * Get the spotMaxPrice property: The max price (in US Dollars) you are willing to pay for spot instances. Possible + * values are any decimal value greater than zero or -1 which indicates default price to be up-to on-demand. + * 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). + * + * @return the spotMaxPrice value. + */ + public Double spotMaxPrice() { + return this.innerProperties() == null ? null : this.innerProperties().spotMaxPrice(); + } + + /** + * Set the spotMaxPrice property: The max price (in US Dollars) you are willing to pay for spot instances. Possible + * values are any decimal value greater than zero or -1 which indicates default price to be up-to on-demand. + * 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). + * + * @param spotMaxPrice the spotMaxPrice value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withSpotMaxPrice(Double spotMaxPrice) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withSpotMaxPrice(spotMaxPrice); + return this; + } + + /** + * Get the tags property: The tags to be persisted on the agent pool virtual machine scale set. + * + * @return the tags value. + */ + public Map tags() { + return this.innerProperties() == null ? null : this.innerProperties().tags(); + } + + /** + * Set the tags property: The tags to be persisted on the agent pool virtual machine scale set. + * + * @param tags the tags value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withTags(Map tags) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withTags(tags); + return this; + } + + /** + * Get the nodeLabels property: The node labels to be persisted across all nodes in agent pool. + * + * @return the nodeLabels value. + */ + public Map nodeLabels() { + return this.innerProperties() == null ? null : this.innerProperties().nodeLabels(); + } + + /** + * Set the nodeLabels property: The node labels to be persisted across all nodes in agent pool. + * + * @param nodeLabels the nodeLabels value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withNodeLabels(Map nodeLabels) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withNodeLabels(nodeLabels); + return this; + } + + /** + * Get the nodeTaints property: The taints added to new nodes during node pool create and scale. For example, + * key=value:NoSchedule. + * + * @return the nodeTaints value. + */ + public List nodeTaints() { + return this.innerProperties() == null ? null : this.innerProperties().nodeTaints(); + } + + /** + * Set the nodeTaints property: The taints added to new nodes during node pool create and scale. For example, + * key=value:NoSchedule. + * + * @param nodeTaints the nodeTaints value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withNodeTaints(List nodeTaints) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withNodeTaints(nodeTaints); + return this; + } + + /** + * Get the proximityPlacementGroupID property: The ID for Proximity Placement Group. + * + * @return the proximityPlacementGroupID value. + */ + public String proximityPlacementGroupID() { + return this.innerProperties() == null ? null : this.innerProperties().proximityPlacementGroupID(); + } + + /** + * Set the proximityPlacementGroupID property: The ID for Proximity Placement Group. + * + * @param proximityPlacementGroupID the proximityPlacementGroupID value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withProximityPlacementGroupID(String proximityPlacementGroupID) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withProximityPlacementGroupID(proximityPlacementGroupID); + return this; + } + + /** + * Get the kubeletConfig property: The Kubelet configuration on the agent pool nodes. + * + * @return the kubeletConfig value. + */ + public KubeletConfig kubeletConfig() { + return this.innerProperties() == null ? null : this.innerProperties().kubeletConfig(); + } + + /** + * Set the kubeletConfig property: The Kubelet configuration on the agent pool nodes. + * + * @param kubeletConfig the kubeletConfig value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withKubeletConfig(KubeletConfig kubeletConfig) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withKubeletConfig(kubeletConfig); + return this; + } + + /** + * Get the linuxOSConfig property: The OS configuration of Linux agent nodes. + * + * @return the linuxOSConfig value. + */ + public LinuxOSConfig linuxOSConfig() { + return this.innerProperties() == null ? null : this.innerProperties().linuxOSConfig(); + } + + /** + * Set the linuxOSConfig property: The OS configuration of Linux agent nodes. + * + * @param linuxOSConfig the linuxOSConfig value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withLinuxOSConfig(LinuxOSConfig linuxOSConfig) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withLinuxOSConfig(linuxOSConfig); + return this; + } + + /** + * Get the enableEncryptionAtHost property: Whether to enable host based OS and data drive encryption. 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. + * + * @return the enableEncryptionAtHost value. + */ + public Boolean enableEncryptionAtHost() { + return this.innerProperties() == null ? null : this.innerProperties().enableEncryptionAtHost(); + } + + /** + * Set the enableEncryptionAtHost property: Whether to enable host based OS and data drive encryption. 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. + * + * @param enableEncryptionAtHost the enableEncryptionAtHost value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withEnableEncryptionAtHost(Boolean enableEncryptionAtHost) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withEnableEncryptionAtHost(enableEncryptionAtHost); + return this; + } + + /** + * Get the enableUltraSSD property: Whether to enable UltraSSD. + * + * @return the enableUltraSSD value. + */ + public Boolean enableUltraSSD() { + return this.innerProperties() == null ? null : this.innerProperties().enableUltraSSD(); + } + + /** + * Set the enableUltraSSD property: Whether to enable UltraSSD. + * + * @param enableUltraSSD the enableUltraSSD value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withEnableUltraSSD(Boolean enableUltraSSD) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withEnableUltraSSD(enableUltraSSD); + return this; + } + + /** + * Get the enableFIPS property: Whether to use a FIPS-enabled OS. 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. + * + * @return the enableFIPS value. + */ + public Boolean enableFIPS() { + return this.innerProperties() == null ? null : this.innerProperties().enableFIPS(); + } + + /** + * Set the enableFIPS property: Whether to use a FIPS-enabled OS. 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. + * + * @param enableFIPS the enableFIPS value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withEnableFIPS(Boolean enableFIPS) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withEnableFIPS(enableFIPS); + return this; + } + + /** + * Get the gpuInstanceProfile property: GPUInstanceProfile to be used to specify GPU MIG instance profile for + * supported GPU VM SKU. + * + * @return the gpuInstanceProfile value. + */ + public GPUInstanceProfile gpuInstanceProfile() { + return this.innerProperties() == null ? null : this.innerProperties().gpuInstanceProfile(); + } + + /** + * Set the gpuInstanceProfile property: GPUInstanceProfile to be used to specify GPU MIG instance profile for + * supported GPU VM SKU. + * + * @param gpuInstanceProfile the gpuInstanceProfile value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withGpuInstanceProfile(GPUInstanceProfile gpuInstanceProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withGpuInstanceProfile(gpuInstanceProfile); + return this; + } + + /** + * Get the creationData property: CreationData to be used to specify the source Snapshot ID if the node pool will be + * created/upgraded using a snapshot. + * + * @return the creationData value. + */ + public CreationData creationData() { + return this.innerProperties() == null ? null : this.innerProperties().creationData(); + } + + /** + * Set the creationData property: CreationData to be used to specify the source Snapshot ID if the node pool will be + * created/upgraded using a snapshot. + * + * @param creationData the creationData value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withCreationData(CreationData creationData) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withCreationData(creationData); + return this; + } + + /** + * Get the capacityReservationGroupID property: The fully qualified resource ID of the Capacity Reservation Group to + * provide virtual machines from a reserved group of Virtual Machines. This is of the form: + * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Compute/capacityreservationgroups/{capacityReservationGroupName}' + * Customers use it to create an agentpool with a specified CRG. For more information see [Capacity + * Reservation](https://learn.microsoft.com/en-us/azure/virtual-machines/capacity-reservation-overview). + * + * @return the capacityReservationGroupID value. + */ + public String capacityReservationGroupID() { + return this.innerProperties() == null ? null : this.innerProperties().capacityReservationGroupID(); + } + + /** + * Set the capacityReservationGroupID property: The fully qualified resource ID of the Capacity Reservation Group to + * provide virtual machines from a reserved group of Virtual Machines. This is of the form: + * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Compute/capacityreservationgroups/{capacityReservationGroupName}' + * Customers use it to create an agentpool with a specified CRG. For more information see [Capacity + * Reservation](https://learn.microsoft.com/en-us/azure/virtual-machines/capacity-reservation-overview). + * + * @param capacityReservationGroupID the capacityReservationGroupID value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withCapacityReservationGroupID(String capacityReservationGroupID) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withCapacityReservationGroupID(capacityReservationGroupID); + return this; + } + + /** + * Get the hostGroupID property: The fully qualified resource ID of the Dedicated Host Group to provision virtual + * machines from, used only in creation scenario and not allowed to changed once 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). + * + * @return the hostGroupID value. + */ + public String hostGroupID() { + return this.innerProperties() == null ? null : this.innerProperties().hostGroupID(); + } + + /** + * Set the hostGroupID property: The fully qualified resource ID of the Dedicated Host Group to provision virtual + * machines from, used only in creation scenario and not allowed to changed once 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). + * + * @param hostGroupID the hostGroupID value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withHostGroupID(String hostGroupID) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withHostGroupID(hostGroupID); + return this; + } + + /** + * Get the networkProfile property: Network-related settings of an agent pool. + * + * @return the networkProfile value. + */ + public AgentPoolNetworkProfile networkProfile() { + return this.innerProperties() == null ? null : this.innerProperties().networkProfile(); + } + + /** + * Set the networkProfile property: Network-related settings of an agent pool. + * + * @param networkProfile the networkProfile value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withNetworkProfile(AgentPoolNetworkProfile networkProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withNetworkProfile(networkProfile); + return this; + } + + /** + * Get the windowsProfile property: The Windows agent pool's specific profile. + * + * @return the windowsProfile value. + */ + public AgentPoolWindowsProfile windowsProfile() { + return this.innerProperties() == null ? null : this.innerProperties().windowsProfile(); + } + + /** + * Set the windowsProfile property: The Windows agent pool's specific profile. + * + * @param windowsProfile the windowsProfile value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withWindowsProfile(AgentPoolWindowsProfile windowsProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withWindowsProfile(windowsProfile); + return this; + } + + /** + * Get the securityProfile property: The security settings of an agent pool. + * + * @return the securityProfile value. + */ + public AgentPoolSecurityProfile securityProfile() { + return this.innerProperties() == null ? null : this.innerProperties().securityProfile(); + } + + /** + * Set the securityProfile property: The security settings of an agent pool. + * + * @param securityProfile the securityProfile value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withSecurityProfile(AgentPoolSecurityProfile securityProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withSecurityProfile(securityProfile); + return this; + } + + /** + * Get the gpuProfile property: GPU settings for the Agent Pool. + * + * @return the gpuProfile value. + */ + public GPUProfile gpuProfile() { + return this.innerProperties() == null ? null : this.innerProperties().gpuProfile(); + } + + /** + * Set the gpuProfile property: GPU settings for the Agent Pool. + * + * @param gpuProfile the gpuProfile value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withGpuProfile(GPUProfile gpuProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withGpuProfile(gpuProfile); + return this; + } + + /** + * Get the gatewayProfile property: Profile specific to a managed agent pool in Gateway mode. This field cannot be + * set if agent pool mode is not Gateway. + * + * @return the gatewayProfile value. + */ + public AgentPoolGatewayProfile gatewayProfile() { + return this.innerProperties() == null ? null : this.innerProperties().gatewayProfile(); + } + + /** + * Set the gatewayProfile property: Profile specific to a managed agent pool in Gateway mode. This field cannot be + * set if agent pool mode is not Gateway. + * + * @param gatewayProfile the gatewayProfile value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withGatewayProfile(AgentPoolGatewayProfile gatewayProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withGatewayProfile(gatewayProfile); + return this; + } + + /** + * Get the virtualMachinesProfile property: Specifications on VirtualMachines agent pool. + * + * @return the virtualMachinesProfile value. + */ + public VirtualMachinesProfile virtualMachinesProfile() { + return this.innerProperties() == null ? null : this.innerProperties().virtualMachinesProfile(); + } + + /** + * Set the virtualMachinesProfile property: Specifications on VirtualMachines agent pool. + * + * @param virtualMachinesProfile the virtualMachinesProfile value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withVirtualMachinesProfile(VirtualMachinesProfile virtualMachinesProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withVirtualMachinesProfile(virtualMachinesProfile); + return this; + } + + /** + * Get the virtualMachineNodesStatus property: The status of nodes in a VirtualMachines agent pool. + * + * @return the virtualMachineNodesStatus value. + */ + public List virtualMachineNodesStatus() { + return this.innerProperties() == null ? null : this.innerProperties().virtualMachineNodesStatus(); + } + + /** + * Set the virtualMachineNodesStatus property: The status of nodes in a VirtualMachines agent pool. + * + * @param virtualMachineNodesStatus the virtualMachineNodesStatus value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withVirtualMachineNodesStatus(List virtualMachineNodesStatus) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withVirtualMachineNodesStatus(virtualMachineNodesStatus); + return this; + } + + /** + * Get the status property: Contains read-only information about the Agent Pool. + * + * @return the status value. + */ + public AgentPoolStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Set the status property: Contains read-only information about the Agent Pool. + * + * @param status the status value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withStatus(AgentPoolStatus status) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withStatus(status); + return this; + } + + /** + * Get the localDNSProfile property: Configures the per-node local DNS, with VnetDNS and KubeDNS overrides. LocalDNS + * helps improve performance and reliability of DNS resolution in an AKS cluster. For more details see + * aka.ms/aks/localdns. + * + * @return the localDNSProfile value. + */ + public LocalDNSProfile localDNSProfile() { + return this.innerProperties() == null ? null : this.innerProperties().localDNSProfile(); + } + + /** + * Set the localDNSProfile property: Configures the per-node local DNS, with VnetDNS and KubeDNS overrides. LocalDNS + * helps improve performance and reliability of DNS resolution in an AKS cluster. For more details see + * aka.ms/aks/localdns. + * + * @param localDNSProfile the localDNSProfile value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withLocalDNSProfile(LocalDNSProfile localDNSProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withLocalDNSProfile(localDNSProfile); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AgentPoolInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AgentPoolInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AgentPoolInner. + */ + public static AgentPoolInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AgentPoolInner deserializedAgentPoolInner = new AgentPoolInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAgentPoolInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAgentPoolInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAgentPoolInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedAgentPoolInner.innerProperties + = ManagedClusterAgentPoolProfileProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAgentPoolInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAgentPoolInner; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AgentPoolUpgradeProfileInner.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AgentPoolUpgradeProfileInner.java new file mode 100644 index 000000000000..ebe546f2e73e --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AgentPoolUpgradeProfileInner.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolUpgradeProfilePropertiesUpgradesItem; +import com.azure.resourcemanager.containerservice.generated.models.OSType; +import java.io.IOException; +import java.util.List; + +/** + * The list of available upgrades for an agent pool. + */ +@Immutable +public final class AgentPoolUpgradeProfileInner extends ProxyResource { + /* + * The properties of the agent pool upgrade profile. + */ + private AgentPoolUpgradeProfileProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of AgentPoolUpgradeProfileInner class. + */ + private AgentPoolUpgradeProfileInner() { + } + + /** + * Get the innerProperties property: The properties of the agent pool upgrade profile. + * + * @return the innerProperties value. + */ + private AgentPoolUpgradeProfileProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the kubernetesVersion property: The Kubernetes version (major.minor.patch). + * + * @return the kubernetesVersion value. + */ + public String kubernetesVersion() { + return this.innerProperties() == null ? null : this.innerProperties().kubernetesVersion(); + } + + /** + * Get the osType property: The operating system type. The default is Linux. + * + * @return the osType value. + */ + public OSType osType() { + return this.innerProperties() == null ? null : this.innerProperties().osType(); + } + + /** + * Get the upgrades property: List of orchestrator types and versions available for upgrade. + * + * @return the upgrades value. + */ + public List upgrades() { + return this.innerProperties() == null ? null : this.innerProperties().upgrades(); + } + + /** + * Get the latestNodeImageVersion property: The latest AKS supported node image version. + * + * @return the latestNodeImageVersion value. + */ + public String latestNodeImageVersion() { + return this.innerProperties() == null ? null : this.innerProperties().latestNodeImageVersion(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AgentPoolUpgradeProfileInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AgentPoolUpgradeProfileInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AgentPoolUpgradeProfileInner. + */ + public static AgentPoolUpgradeProfileInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AgentPoolUpgradeProfileInner deserializedAgentPoolUpgradeProfileInner = new AgentPoolUpgradeProfileInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAgentPoolUpgradeProfileInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAgentPoolUpgradeProfileInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAgentPoolUpgradeProfileInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedAgentPoolUpgradeProfileInner.innerProperties + = AgentPoolUpgradeProfileProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAgentPoolUpgradeProfileInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAgentPoolUpgradeProfileInner; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AgentPoolUpgradeProfileProperties.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AgentPoolUpgradeProfileProperties.java new file mode 100644 index 000000000000..3dd6cb25c443 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AgentPoolUpgradeProfileProperties.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolUpgradeProfilePropertiesUpgradesItem; +import com.azure.resourcemanager.containerservice.generated.models.OSType; +import java.io.IOException; +import java.util.List; + +/** + * The list of available upgrade versions. + */ +@Immutable +public final class AgentPoolUpgradeProfileProperties implements JsonSerializable { + /* + * The Kubernetes version (major.minor.patch). + */ + private String kubernetesVersion; + + /* + * The operating system type. The default is Linux. + */ + private OSType osType; + + /* + * List of orchestrator types and versions available for upgrade. + */ + private List upgrades; + + /* + * The latest AKS supported node image version. + */ + private String latestNodeImageVersion; + + /** + * Creates an instance of AgentPoolUpgradeProfileProperties class. + */ + private AgentPoolUpgradeProfileProperties() { + } + + /** + * Get the kubernetesVersion property: The Kubernetes version (major.minor.patch). + * + * @return the kubernetesVersion value. + */ + public String kubernetesVersion() { + return this.kubernetesVersion; + } + + /** + * Get the osType property: The operating system type. The default is Linux. + * + * @return the osType value. + */ + public OSType osType() { + return this.osType; + } + + /** + * Get the upgrades property: List of orchestrator types and versions available for upgrade. + * + * @return the upgrades value. + */ + public List upgrades() { + return this.upgrades; + } + + /** + * Get the latestNodeImageVersion property: The latest AKS supported node image version. + * + * @return the latestNodeImageVersion value. + */ + public String latestNodeImageVersion() { + return this.latestNodeImageVersion; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kubernetesVersion", this.kubernetesVersion); + jsonWriter.writeStringField("osType", this.osType == null ? null : this.osType.toString()); + jsonWriter.writeArrayField("upgrades", this.upgrades, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("latestNodeImageVersion", this.latestNodeImageVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AgentPoolUpgradeProfileProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AgentPoolUpgradeProfileProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AgentPoolUpgradeProfileProperties. + */ + public static AgentPoolUpgradeProfileProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AgentPoolUpgradeProfileProperties deserializedAgentPoolUpgradeProfileProperties + = new AgentPoolUpgradeProfileProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kubernetesVersion".equals(fieldName)) { + deserializedAgentPoolUpgradeProfileProperties.kubernetesVersion = reader.getString(); + } else if ("osType".equals(fieldName)) { + deserializedAgentPoolUpgradeProfileProperties.osType = OSType.fromString(reader.getString()); + } else if ("upgrades".equals(fieldName)) { + List upgrades + = reader.readArray(reader1 -> AgentPoolUpgradeProfilePropertiesUpgradesItem.fromJson(reader1)); + deserializedAgentPoolUpgradeProfileProperties.upgrades = upgrades; + } else if ("latestNodeImageVersion".equals(fieldName)) { + deserializedAgentPoolUpgradeProfileProperties.latestNodeImageVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAgentPoolUpgradeProfileProperties; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/CommandResultProperties.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/CommandResultProperties.java new file mode 100644 index 000000000000..5d846ca0ea24 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/CommandResultProperties.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * The results of a run command. + */ +@Immutable +public final class CommandResultProperties implements JsonSerializable { + /* + * provisioning State + */ + private String provisioningState; + + /* + * The exit code of the command + */ + private Integer exitCode; + + /* + * The time when the command started. + */ + private OffsetDateTime startedAt; + + /* + * The time when the command finished. + */ + private OffsetDateTime finishedAt; + + /* + * The command output. + */ + private String logs; + + /* + * An explanation of why provisioningState is set to failed (if so). + */ + private String reason; + + /** + * Creates an instance of CommandResultProperties class. + */ + private CommandResultProperties() { + } + + /** + * Get the provisioningState property: provisioning State. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the exitCode property: The exit code of the command. + * + * @return the exitCode value. + */ + public Integer exitCode() { + return this.exitCode; + } + + /** + * Get the startedAt property: The time when the command started. + * + * @return the startedAt value. + */ + public OffsetDateTime startedAt() { + return this.startedAt; + } + + /** + * Get the finishedAt property: The time when the command finished. + * + * @return the finishedAt value. + */ + public OffsetDateTime finishedAt() { + return this.finishedAt; + } + + /** + * Get the logs property: The command output. + * + * @return the logs value. + */ + public String logs() { + return this.logs; + } + + /** + * Get the reason property: An explanation of why provisioningState is set to failed (if so). + * + * @return the reason value. + */ + public String reason() { + return this.reason; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CommandResultProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CommandResultProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the CommandResultProperties. + */ + public static CommandResultProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CommandResultProperties deserializedCommandResultProperties = new CommandResultProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedCommandResultProperties.provisioningState = reader.getString(); + } else if ("exitCode".equals(fieldName)) { + deserializedCommandResultProperties.exitCode = reader.getNullable(JsonReader::getInt); + } else if ("startedAt".equals(fieldName)) { + deserializedCommandResultProperties.startedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("finishedAt".equals(fieldName)) { + deserializedCommandResultProperties.finishedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("logs".equals(fieldName)) { + deserializedCommandResultProperties.logs = reader.getString(); + } else if ("reason".equals(fieldName)) { + deserializedCommandResultProperties.reason = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCommandResultProperties; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/CredentialResultsInner.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/CredentialResultsInner.java new file mode 100644 index 000000000000..95bbf7769493 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/CredentialResultsInner.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerservice.generated.models.CredentialResult; +import java.io.IOException; +import java.util.List; + +/** + * The list credential result response. + */ +@Immutable +public final class CredentialResultsInner implements JsonSerializable { + /* + * Base64-encoded Kubernetes configuration file. + */ + private List kubeconfigs; + + /** + * Creates an instance of CredentialResultsInner class. + */ + private CredentialResultsInner() { + } + + /** + * Get the kubeconfigs property: Base64-encoded Kubernetes configuration file. + * + * @return the kubeconfigs value. + */ + public List kubeconfigs() { + return this.kubeconfigs; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CredentialResultsInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CredentialResultsInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the CredentialResultsInner. + */ + public static CredentialResultsInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CredentialResultsInner deserializedCredentialResultsInner = new CredentialResultsInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kubeconfigs".equals(fieldName)) { + List kubeconfigs + = reader.readArray(reader1 -> CredentialResult.fromJson(reader1)); + deserializedCredentialResultsInner.kubeconfigs = kubeconfigs; + } else { + reader.skipChildren(); + } + } + + return deserializedCredentialResultsInner; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/KubernetesVersionListResultInner.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/KubernetesVersionListResultInner.java new file mode 100644 index 000000000000..897790c0dfae --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/KubernetesVersionListResultInner.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerservice.generated.models.KubernetesVersion; +import java.io.IOException; +import java.util.List; + +/** + * Hold values properties, which is array of KubernetesVersion. + */ +@Immutable +public final class KubernetesVersionListResultInner implements JsonSerializable { + /* + * Array of AKS supported Kubernetes versions. + */ + private List values; + + /** + * Creates an instance of KubernetesVersionListResultInner class. + */ + private KubernetesVersionListResultInner() { + } + + /** + * Get the values property: Array of AKS supported Kubernetes versions. + * + * @return the values value. + */ + public List values() { + return this.values; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("values", this.values, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KubernetesVersionListResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KubernetesVersionListResultInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the KubernetesVersionListResultInner. + */ + public static KubernetesVersionListResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KubernetesVersionListResultInner deserializedKubernetesVersionListResultInner + = new KubernetesVersionListResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("values".equals(fieldName)) { + List values = reader.readArray(reader1 -> KubernetesVersion.fromJson(reader1)); + deserializedKubernetesVersionListResultInner.values = values; + } else { + reader.skipChildren(); + } + } + + return deserializedKubernetesVersionListResultInner; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/MachineInner.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/MachineInner.java new file mode 100644 index 000000000000..7aa3941c9c2e --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/MachineInner.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerservice.generated.models.MachineProperties; +import java.io.IOException; +import java.util.List; + +/** + * A machine. Contains details about the underlying virtual machine. A machine may be visible here but not in kubectl + * get nodes; if so it may be because the machine has not been registered with the Kubernetes API Server yet. + */ +@Immutable +public final class MachineInner extends ProxyResource { + /* + * The properties of the machine + */ + private MachineProperties properties; + + /* + * The Availability zone in which machine is located. + */ + private List zones; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of MachineInner class. + */ + private MachineInner() { + } + + /** + * Get the properties property: The properties of the machine. + * + * @return the properties value. + */ + public MachineProperties properties() { + return this.properties; + } + + /** + * Get the zones property: The Availability zone in which machine is located. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MachineInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MachineInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MachineInner. + */ + public static MachineInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MachineInner deserializedMachineInner = new MachineInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMachineInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedMachineInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedMachineInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedMachineInner.properties = MachineProperties.fromJson(reader); + } else if ("zones".equals(fieldName)) { + List zones = reader.readArray(reader1 -> reader1.getString()); + deserializedMachineInner.zones = zones; + } else if ("systemData".equals(fieldName)) { + deserializedMachineInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMachineInner; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/MaintenanceConfigurationInner.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/MaintenanceConfigurationInner.java new file mode 100644 index 000000000000..1412cfca4033 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/MaintenanceConfigurationInner.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerservice.generated.models.MaintenanceWindow; +import com.azure.resourcemanager.containerservice.generated.models.TimeInWeek; +import com.azure.resourcemanager.containerservice.generated.models.TimeSpan; +import java.io.IOException; +import java.util.List; + +/** + * Planned maintenance configuration, used to configure when updates can be deployed to a Managed Cluster. See [planned + * maintenance](https://docs.microsoft.com/azure/aks/planned-maintenance) for more information about planned + * maintenance. + */ +@Fluent +public final class MaintenanceConfigurationInner extends ProxyResource { + /* + * Properties of a default maintenance configuration. + */ + private MaintenanceConfigurationProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of MaintenanceConfigurationInner class. + */ + public MaintenanceConfigurationInner() { + } + + /** + * Get the innerProperties property: Properties of a default maintenance configuration. + * + * @return the innerProperties value. + */ + private MaintenanceConfigurationProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the timeInWeek property: Time slots during the week when planned maintenance is allowed to proceed. If two + * array entries specify the same day of the week, the applied configuration is the union of times in both entries. + * + * @return the timeInWeek value. + */ + public List timeInWeek() { + return this.innerProperties() == null ? null : this.innerProperties().timeInWeek(); + } + + /** + * Set the timeInWeek property: Time slots during the week when planned maintenance is allowed to proceed. If two + * array entries specify the same day of the week, the applied configuration is the union of times in both entries. + * + * @param timeInWeek the timeInWeek value to set. + * @return the MaintenanceConfigurationInner object itself. + */ + public MaintenanceConfigurationInner withTimeInWeek(List timeInWeek) { + if (this.innerProperties() == null) { + this.innerProperties = new MaintenanceConfigurationProperties(); + } + this.innerProperties().withTimeInWeek(timeInWeek); + return this; + } + + /** + * Get the notAllowedTime property: Time slots on which upgrade is not allowed. + * + * @return the notAllowedTime value. + */ + public List notAllowedTime() { + return this.innerProperties() == null ? null : this.innerProperties().notAllowedTime(); + } + + /** + * Set the notAllowedTime property: Time slots on which upgrade is not allowed. + * + * @param notAllowedTime the notAllowedTime value to set. + * @return the MaintenanceConfigurationInner object itself. + */ + public MaintenanceConfigurationInner withNotAllowedTime(List notAllowedTime) { + if (this.innerProperties() == null) { + this.innerProperties = new MaintenanceConfigurationProperties(); + } + this.innerProperties().withNotAllowedTime(notAllowedTime); + return this; + } + + /** + * Get the maintenanceWindow property: Maintenance window for the maintenance configuration. + * + * @return the maintenanceWindow value. + */ + public MaintenanceWindow maintenanceWindow() { + return this.innerProperties() == null ? null : this.innerProperties().maintenanceWindow(); + } + + /** + * Set the maintenanceWindow property: Maintenance window for the maintenance configuration. + * + * @param maintenanceWindow the maintenanceWindow value to set. + * @return the MaintenanceConfigurationInner object itself. + */ + public MaintenanceConfigurationInner withMaintenanceWindow(MaintenanceWindow maintenanceWindow) { + if (this.innerProperties() == null) { + this.innerProperties = new MaintenanceConfigurationProperties(); + } + this.innerProperties().withMaintenanceWindow(maintenanceWindow); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MaintenanceConfigurationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MaintenanceConfigurationInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MaintenanceConfigurationInner. + */ + public static MaintenanceConfigurationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MaintenanceConfigurationInner deserializedMaintenanceConfigurationInner + = new MaintenanceConfigurationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMaintenanceConfigurationInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedMaintenanceConfigurationInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedMaintenanceConfigurationInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedMaintenanceConfigurationInner.innerProperties + = MaintenanceConfigurationProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedMaintenanceConfigurationInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMaintenanceConfigurationInner; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/MaintenanceConfigurationProperties.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/MaintenanceConfigurationProperties.java new file mode 100644 index 000000000000..1b0e1febd90a --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/MaintenanceConfigurationProperties.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerservice.generated.models.MaintenanceWindow; +import com.azure.resourcemanager.containerservice.generated.models.TimeInWeek; +import com.azure.resourcemanager.containerservice.generated.models.TimeSpan; +import java.io.IOException; +import java.util.List; + +/** + * Properties used to configure planned maintenance for a Managed Cluster. + */ +@Fluent +public final class MaintenanceConfigurationProperties implements JsonSerializable { + /* + * Time slots during the week when planned maintenance is allowed to proceed. If two array entries specify the same + * day of the week, the applied configuration is the union of times in both entries. + */ + private List timeInWeek; + + /* + * Time slots on which upgrade is not allowed. + */ + private List notAllowedTime; + + /* + * Maintenance window for the maintenance configuration. + */ + private MaintenanceWindow maintenanceWindow; + + /** + * Creates an instance of MaintenanceConfigurationProperties class. + */ + public MaintenanceConfigurationProperties() { + } + + /** + * Get the timeInWeek property: Time slots during the week when planned maintenance is allowed to proceed. If two + * array entries specify the same day of the week, the applied configuration is the union of times in both entries. + * + * @return the timeInWeek value. + */ + public List timeInWeek() { + return this.timeInWeek; + } + + /** + * Set the timeInWeek property: Time slots during the week when planned maintenance is allowed to proceed. If two + * array entries specify the same day of the week, the applied configuration is the union of times in both entries. + * + * @param timeInWeek the timeInWeek value to set. + * @return the MaintenanceConfigurationProperties object itself. + */ + public MaintenanceConfigurationProperties withTimeInWeek(List timeInWeek) { + this.timeInWeek = timeInWeek; + return this; + } + + /** + * Get the notAllowedTime property: Time slots on which upgrade is not allowed. + * + * @return the notAllowedTime value. + */ + public List notAllowedTime() { + return this.notAllowedTime; + } + + /** + * Set the notAllowedTime property: Time slots on which upgrade is not allowed. + * + * @param notAllowedTime the notAllowedTime value to set. + * @return the MaintenanceConfigurationProperties object itself. + */ + public MaintenanceConfigurationProperties withNotAllowedTime(List notAllowedTime) { + this.notAllowedTime = notAllowedTime; + return this; + } + + /** + * Get the maintenanceWindow property: Maintenance window for the maintenance configuration. + * + * @return the maintenanceWindow value. + */ + public MaintenanceWindow maintenanceWindow() { + return this.maintenanceWindow; + } + + /** + * Set the maintenanceWindow property: Maintenance window for the maintenance configuration. + * + * @param maintenanceWindow the maintenanceWindow value to set. + * @return the MaintenanceConfigurationProperties object itself. + */ + public MaintenanceConfigurationProperties withMaintenanceWindow(MaintenanceWindow maintenanceWindow) { + this.maintenanceWindow = maintenanceWindow; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("timeInWeek", this.timeInWeek, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("notAllowedTime", this.notAllowedTime, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("maintenanceWindow", this.maintenanceWindow); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MaintenanceConfigurationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MaintenanceConfigurationProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MaintenanceConfigurationProperties. + */ + public static MaintenanceConfigurationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MaintenanceConfigurationProperties deserializedMaintenanceConfigurationProperties + = new MaintenanceConfigurationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("timeInWeek".equals(fieldName)) { + List timeInWeek = reader.readArray(reader1 -> TimeInWeek.fromJson(reader1)); + deserializedMaintenanceConfigurationProperties.timeInWeek = timeInWeek; + } else if ("notAllowedTime".equals(fieldName)) { + List notAllowedTime = reader.readArray(reader1 -> TimeSpan.fromJson(reader1)); + deserializedMaintenanceConfigurationProperties.notAllowedTime = notAllowedTime; + } else if ("maintenanceWindow".equals(fieldName)) { + deserializedMaintenanceConfigurationProperties.maintenanceWindow + = MaintenanceWindow.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMaintenanceConfigurationProperties; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterAccessProfileInner.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterAccessProfileInner.java new file mode 100644 index 000000000000..3c1fd35afed4 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterAccessProfileInner.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Managed cluster Access Profile. + */ +@Immutable +public final class ManagedClusterAccessProfileInner extends Resource { + private static final byte[] EMPTY_BYTE_ARRAY = new byte[0]; + + /* + * AccessProfile of a managed cluster. + */ + private AccessProfile innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ManagedClusterAccessProfileInner class. + */ + private ManagedClusterAccessProfileInner() { + } + + /** + * Get the innerProperties property: AccessProfile of a managed cluster. + * + * @return the innerProperties value. + */ + private AccessProfile innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the kubeConfig property: Base64-encoded Kubernetes configuration file. + * + * @return the kubeConfig value. + */ + public byte[] kubeConfig() { + return this.innerProperties() == null ? EMPTY_BYTE_ARRAY : this.innerProperties().kubeConfig(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterAccessProfileInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterAccessProfileInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ManagedClusterAccessProfileInner. + */ + public static ManagedClusterAccessProfileInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterAccessProfileInner deserializedManagedClusterAccessProfileInner + = new ManagedClusterAccessProfileInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedManagedClusterAccessProfileInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedManagedClusterAccessProfileInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedManagedClusterAccessProfileInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedManagedClusterAccessProfileInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedManagedClusterAccessProfileInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedManagedClusterAccessProfileInner.innerProperties = AccessProfile.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedManagedClusterAccessProfileInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterAccessProfileInner; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterAgentPoolProfileProperties.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterAgentPoolProfileProperties.java new file mode 100644 index 000000000000..a519ada76b2b --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterAgentPoolProfileProperties.java @@ -0,0 +1,1846 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolGatewayProfile; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolMode; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolNetworkProfile; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolSecurityProfile; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolStatus; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolType; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolUpgradeSettings; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolWindowsProfile; +import com.azure.resourcemanager.containerservice.generated.models.CreationData; +import com.azure.resourcemanager.containerservice.generated.models.GPUInstanceProfile; +import com.azure.resourcemanager.containerservice.generated.models.GPUProfile; +import com.azure.resourcemanager.containerservice.generated.models.KubeletConfig; +import com.azure.resourcemanager.containerservice.generated.models.KubeletDiskType; +import com.azure.resourcemanager.containerservice.generated.models.LinuxOSConfig; +import com.azure.resourcemanager.containerservice.generated.models.LocalDNSProfile; +import com.azure.resourcemanager.containerservice.generated.models.OSDiskType; +import com.azure.resourcemanager.containerservice.generated.models.OSSKU; +import com.azure.resourcemanager.containerservice.generated.models.OSType; +import com.azure.resourcemanager.containerservice.generated.models.PodIPAllocationMode; +import com.azure.resourcemanager.containerservice.generated.models.PowerState; +import com.azure.resourcemanager.containerservice.generated.models.ScaleDownMode; +import com.azure.resourcemanager.containerservice.generated.models.ScaleSetEvictionPolicy; +import com.azure.resourcemanager.containerservice.generated.models.ScaleSetPriority; +import com.azure.resourcemanager.containerservice.generated.models.VirtualMachineNodes; +import com.azure.resourcemanager.containerservice.generated.models.VirtualMachinesProfile; +import com.azure.resourcemanager.containerservice.generated.models.WorkloadRuntime; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Properties for the container service agent pool profile. + */ +@Fluent +public class ManagedClusterAgentPoolProfileProperties + implements JsonSerializable { + /* + * Unique read-only string used to implement optimistic concurrency. The eTag value will change when the resource is + * updated. Specify an if-match or if-none-match header with the eTag value for a subsequent request to enable + * optimistic concurrency per the normal eTag convention. + */ + private String eTag; + + /* + * 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. + */ + private Integer count; + + /* + * The size of the agent pool VMs. 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 + */ + private String vmSize; + + /* + * 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. + */ + private Integer osDiskSizeGB; + + /* + * The OS disk type to be used for machines in the agent pool. 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). + */ + private OSDiskType osDiskType; + + /* + * Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. + */ + private KubeletDiskType kubeletDiskType; + + /* + * Determines the type of workload a node can run. + */ + private WorkloadRuntime workloadRuntime; + + /* + * Message of the day for Linux nodes, base64-encoded. A base64-encoded string which will be written to /etc/motd + * after decoding. This allows customization of the message of the day for Linux nodes. It must not be specified for + * Windows nodes. It must be a static string (i.e., will be printed raw and not be executed as a script). + */ + private String messageOfTheDay; + + /* + * The ID of the subnet which agent pool nodes and optionally pods will join on startup. 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} + */ + private String vnetSubnetID; + + /* + * The ID of the subnet which pods will join when launched. 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} + */ + private String podSubnetID; + + /* + * Pod IP Allocation Mode. The IP allocation mode for pods in the agent pool. Must be used with podSubnetId. The + * default is 'DynamicIndividual'. + */ + private PodIPAllocationMode podIPAllocationMode; + + /* + * The maximum number of pods that can run on a node. + */ + private Integer maxPods; + + /* + * The operating system type. The default is Linux. + */ + private OSType osType; + + /* + * 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. + */ + private OSSKU osSKU; + + /* + * The maximum number of nodes for auto-scaling + */ + private Integer maxCount; + + /* + * The minimum number of nodes for auto-scaling + */ + private Integer minCount; + + /* + * Whether to enable auto-scaler + */ + private Boolean enableAutoScaling; + + /* + * The scale down mode to use when scaling the Agent Pool. This also effects the cluster autoscaler behavior. If not + * specified, it defaults to Delete. + */ + private ScaleDownMode scaleDownMode; + + /* + * The type of Agent Pool. + */ + private AgentPoolType type; + + /* + * The mode of an 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 + */ + private AgentPoolMode mode; + + /* + * The version of Kubernetes specified by the user. Both patch version (e.g. 1.20.13) and + * (e.g. 1.20) are supported. When is specified, the latest supported GA patch version + * is chosen automatically. Updating the cluster with the same 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). + */ + private String orchestratorVersion; + + /* + * The version of Kubernetes the Agent Pool is running. If orchestratorVersion is a fully specified version + * , this field will be exactly equal to it. If orchestratorVersion is , this field + * will contain the full version being used. + */ + private String currentOrchestratorVersion; + + /* + * The version of node image + */ + private String nodeImageVersion; + + /* + * Settings for upgrading the agentpool + */ + private AgentPoolUpgradeSettings upgradeSettings; + + /* + * The current deployment or provisioning state. + */ + private String provisioningState; + + /* + * Whether the Agent Pool is running or stopped. 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 + */ + private PowerState powerState; + + /* + * The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is + * 'VirtualMachineScaleSets'. + */ + private List availabilityZones; + + /* + * Whether each node is allocated its own public IP. 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. + */ + private Boolean enableNodePublicIP; + + /* + * The public IP prefix ID which VM nodes should use IPs from. This is of the form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{ + * publicIPPrefixName} + */ + private String nodePublicIPPrefixID; + + /* + * The Virtual Machine Scale Set priority. + */ + private ScaleSetPriority scaleSetPriority; + + /* + * The Virtual Machine Scale Set eviction policy. 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) + */ + private ScaleSetEvictionPolicy scaleSetEvictionPolicy; + + /* + * The max price (in US Dollars) you are willing to pay for spot instances. Possible values are any decimal value + * greater than zero or -1 which indicates default price to be up-to on-demand. 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) + */ + private Double spotMaxPrice; + + /* + * The tags to be persisted on the agent pool virtual machine scale set. + */ + private Map tags; + + /* + * The node labels to be persisted across all nodes in agent pool. + */ + private Map nodeLabels; + + /* + * The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. + */ + private List nodeTaints; + + /* + * The ID for Proximity Placement Group. + */ + private String proximityPlacementGroupID; + + /* + * The Kubelet configuration on the agent pool nodes. + */ + private KubeletConfig kubeletConfig; + + /* + * The OS configuration of Linux agent nodes. + */ + private LinuxOSConfig linuxOSConfig; + + /* + * Whether to enable host based OS and data drive encryption. 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 + */ + private Boolean enableEncryptionAtHost; + + /* + * Whether to enable UltraSSD + */ + private Boolean enableUltraSSD; + + /* + * Whether to use a FIPS-enabled OS. 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. + */ + private Boolean enableFIPS; + + /* + * GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. + */ + private GPUInstanceProfile gpuInstanceProfile; + + /* + * CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a + * snapshot. + */ + private CreationData creationData; + + /* + * The fully qualified resource ID of the Capacity Reservation Group to provide virtual machines from a reserved + * group of Virtual Machines. This is of the form: + * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Compute/ + * capacityreservationgroups/{capacityReservationGroupName}' Customers use it to create an agentpool with a + * specified CRG. For more information see [Capacity + * Reservation](https://learn.microsoft.com/en-us/azure/virtual-machines/capacity-reservation-overview) + */ + private String capacityReservationGroupID; + + /* + * The fully qualified resource ID of the Dedicated Host Group to provision virtual machines from, used only in + * creation scenario and not allowed to changed once 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). + */ + private String hostGroupID; + + /* + * Network-related settings of an agent pool. + */ + private AgentPoolNetworkProfile networkProfile; + + /* + * The Windows agent pool's specific profile. + */ + private AgentPoolWindowsProfile windowsProfile; + + /* + * The security settings of an agent pool. + */ + private AgentPoolSecurityProfile securityProfile; + + /* + * GPU settings for the Agent Pool. + */ + private GPUProfile gpuProfile; + + /* + * Profile specific to a managed agent pool in Gateway mode. This field cannot be set if agent pool mode is not + * Gateway. + */ + private AgentPoolGatewayProfile gatewayProfile; + + /* + * Specifications on VirtualMachines agent pool. + */ + private VirtualMachinesProfile virtualMachinesProfile; + + /* + * The status of nodes in a VirtualMachines agent pool. + */ + private List virtualMachineNodesStatus; + + /* + * Contains read-only information about the Agent Pool. + */ + private AgentPoolStatus status; + + /* + * Configures the per-node local DNS, with VnetDNS and KubeDNS overrides. LocalDNS helps improve performance and + * reliability of DNS resolution in an AKS cluster. For more details see aka.ms/aks/localdns. + */ + private LocalDNSProfile localDNSProfile; + + /** + * Creates an instance of ManagedClusterAgentPoolProfileProperties class. + */ + public ManagedClusterAgentPoolProfileProperties() { + } + + /** + * Get the eTag property: Unique read-only string used to implement optimistic concurrency. The eTag value will + * change when the resource is updated. Specify an if-match or if-none-match header with the eTag value for a + * subsequent request to enable optimistic concurrency per the normal eTag convention. + * + * @return the eTag value. + */ + public String eTag() { + return this.eTag; + } + + /** + * Set the eTag property: Unique read-only string used to implement optimistic concurrency. The eTag value will + * change when the resource is updated. Specify an if-match or if-none-match header with the eTag value for a + * subsequent request to enable optimistic concurrency per the normal eTag convention. + * + * @param eTag the eTag value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + ManagedClusterAgentPoolProfileProperties withETag(String eTag) { + this.eTag = eTag; + return this; + } + + /** + * Get the count property: 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. + * + * @return the count value. + */ + public Integer count() { + return this.count; + } + + /** + * Set the count property: 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. + * + * @param count the count value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withCount(Integer count) { + this.count = count; + return this; + } + + /** + * Get the vmSize property: The size of the agent pool VMs. 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. + * + * @return the vmSize value. + */ + public String vmSize() { + return this.vmSize; + } + + /** + * Set the vmSize property: The size of the agent pool VMs. 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. + * + * @param vmSize the vmSize value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withVmSize(String vmSize) { + this.vmSize = vmSize; + return this; + } + + /** + * Get the osDiskSizeGB property: 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. + * + * @return the osDiskSizeGB value. + */ + public Integer osDiskSizeGB() { + return this.osDiskSizeGB; + } + + /** + * Set the osDiskSizeGB property: 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. + * + * @param osDiskSizeGB the osDiskSizeGB value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withOsDiskSizeGB(Integer osDiskSizeGB) { + this.osDiskSizeGB = osDiskSizeGB; + return this; + } + + /** + * Get the osDiskType property: The OS disk type to be used for machines in the agent pool. 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). + * + * @return the osDiskType value. + */ + public OSDiskType osDiskType() { + return this.osDiskType; + } + + /** + * Set the osDiskType property: The OS disk type to be used for machines in the agent pool. 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). + * + * @param osDiskType the osDiskType value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withOsDiskType(OSDiskType osDiskType) { + this.osDiskType = osDiskType; + return this; + } + + /** + * Get the kubeletDiskType property: Determines the placement of emptyDir volumes, container runtime data root, and + * Kubelet ephemeral storage. + * + * @return the kubeletDiskType value. + */ + public KubeletDiskType kubeletDiskType() { + return this.kubeletDiskType; + } + + /** + * Set the kubeletDiskType property: Determines the placement of emptyDir volumes, container runtime data root, and + * Kubelet ephemeral storage. + * + * @param kubeletDiskType the kubeletDiskType value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withKubeletDiskType(KubeletDiskType kubeletDiskType) { + this.kubeletDiskType = kubeletDiskType; + return this; + } + + /** + * Get the workloadRuntime property: Determines the type of workload a node can run. + * + * @return the workloadRuntime value. + */ + public WorkloadRuntime workloadRuntime() { + return this.workloadRuntime; + } + + /** + * Set the workloadRuntime property: Determines the type of workload a node can run. + * + * @param workloadRuntime the workloadRuntime value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withWorkloadRuntime(WorkloadRuntime workloadRuntime) { + this.workloadRuntime = workloadRuntime; + return this; + } + + /** + * Get the messageOfTheDay property: Message of the day for Linux nodes, base64-encoded. A base64-encoded string + * which will be written to /etc/motd after decoding. This allows customization of the message of the day for Linux + * nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be printed raw and not + * be executed as a script). + * + * @return the messageOfTheDay value. + */ + public String messageOfTheDay() { + return this.messageOfTheDay; + } + + /** + * Set the messageOfTheDay property: Message of the day for Linux nodes, base64-encoded. A base64-encoded string + * which will be written to /etc/motd after decoding. This allows customization of the message of the day for Linux + * nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be printed raw and not + * be executed as a script). + * + * @param messageOfTheDay the messageOfTheDay value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withMessageOfTheDay(String messageOfTheDay) { + this.messageOfTheDay = messageOfTheDay; + return this; + } + + /** + * Get the vnetSubnetID property: The ID of the subnet which agent pool nodes and optionally pods will join on + * startup. 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}. + * + * @return the vnetSubnetID value. + */ + public String vnetSubnetID() { + return this.vnetSubnetID; + } + + /** + * Set the vnetSubnetID property: The ID of the subnet which agent pool nodes and optionally pods will join on + * startup. 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}. + * + * @param vnetSubnetID the vnetSubnetID value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withVnetSubnetID(String vnetSubnetID) { + this.vnetSubnetID = vnetSubnetID; + return this; + } + + /** + * Get the podSubnetID property: The ID of the subnet which pods will join when launched. 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}. + * + * @return the podSubnetID value. + */ + public String podSubnetID() { + return this.podSubnetID; + } + + /** + * Set the podSubnetID property: The ID of the subnet which pods will join when launched. 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}. + * + * @param podSubnetID the podSubnetID value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withPodSubnetID(String podSubnetID) { + this.podSubnetID = podSubnetID; + return this; + } + + /** + * Get the podIPAllocationMode property: Pod IP Allocation Mode. The IP allocation mode for pods in the agent pool. + * Must be used with podSubnetId. The default is 'DynamicIndividual'. + * + * @return the podIPAllocationMode value. + */ + public PodIPAllocationMode podIPAllocationMode() { + return this.podIPAllocationMode; + } + + /** + * Set the podIPAllocationMode property: Pod IP Allocation Mode. The IP allocation mode for pods in the agent pool. + * Must be used with podSubnetId. The default is 'DynamicIndividual'. + * + * @param podIPAllocationMode the podIPAllocationMode value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withPodIPAllocationMode(PodIPAllocationMode podIPAllocationMode) { + this.podIPAllocationMode = podIPAllocationMode; + return this; + } + + /** + * Get the maxPods property: The maximum number of pods that can run on a node. + * + * @return the maxPods value. + */ + public Integer maxPods() { + return this.maxPods; + } + + /** + * Set the maxPods property: The maximum number of pods that can run on a node. + * + * @param maxPods the maxPods value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withMaxPods(Integer maxPods) { + this.maxPods = maxPods; + return this; + } + + /** + * Get the osType property: The operating system type. The default is Linux. + * + * @return the osType value. + */ + public OSType osType() { + return this.osType; + } + + /** + * Set the osType property: The operating system type. The default is Linux. + * + * @param osType the osType value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withOsType(OSType osType) { + this.osType = osType; + return this; + } + + /** + * Get the osSKU property: 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. + * + * @return the osSKU value. + */ + public OSSKU osSKU() { + return this.osSKU; + } + + /** + * Set the osSKU property: 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. + * + * @param osSKU the osSKU value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withOsSKU(OSSKU osSKU) { + this.osSKU = osSKU; + return this; + } + + /** + * Get the maxCount property: The maximum number of nodes for auto-scaling. + * + * @return the maxCount value. + */ + public Integer maxCount() { + return this.maxCount; + } + + /** + * Set the maxCount property: The maximum number of nodes for auto-scaling. + * + * @param maxCount the maxCount value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withMaxCount(Integer maxCount) { + this.maxCount = maxCount; + return this; + } + + /** + * Get the minCount property: The minimum number of nodes for auto-scaling. + * + * @return the minCount value. + */ + public Integer minCount() { + return this.minCount; + } + + /** + * Set the minCount property: The minimum number of nodes for auto-scaling. + * + * @param minCount the minCount value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withMinCount(Integer minCount) { + this.minCount = minCount; + return this; + } + + /** + * Get the enableAutoScaling property: Whether to enable auto-scaler. + * + * @return the enableAutoScaling value. + */ + public Boolean enableAutoScaling() { + return this.enableAutoScaling; + } + + /** + * Set the enableAutoScaling property: Whether to enable auto-scaler. + * + * @param enableAutoScaling the enableAutoScaling value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withEnableAutoScaling(Boolean enableAutoScaling) { + this.enableAutoScaling = enableAutoScaling; + return this; + } + + /** + * Get the scaleDownMode property: The scale down mode to use when scaling the Agent Pool. This also effects the + * cluster autoscaler behavior. If not specified, it defaults to Delete. + * + * @return the scaleDownMode value. + */ + public ScaleDownMode scaleDownMode() { + return this.scaleDownMode; + } + + /** + * Set the scaleDownMode property: The scale down mode to use when scaling the Agent Pool. This also effects the + * cluster autoscaler behavior. If not specified, it defaults to Delete. + * + * @param scaleDownMode the scaleDownMode value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withScaleDownMode(ScaleDownMode scaleDownMode) { + this.scaleDownMode = scaleDownMode; + return this; + } + + /** + * Get the type property: The type of Agent Pool. + * + * @return the type value. + */ + public AgentPoolType type() { + return this.type; + } + + /** + * Set the type property: The type of Agent Pool. + * + * @param type the type value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withType(AgentPoolType type) { + this.type = type; + return this; + } + + /** + * Get the mode property: The mode of an 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. + * + * @return the mode value. + */ + public AgentPoolMode mode() { + return this.mode; + } + + /** + * Set the mode property: The mode of an 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. + * + * @param mode the mode value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withMode(AgentPoolMode mode) { + this.mode = mode; + return this; + } + + /** + * Get the orchestratorVersion property: The version of Kubernetes specified by the user. 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). + * + * @return the orchestratorVersion value. + */ + public String orchestratorVersion() { + return this.orchestratorVersion; + } + + /** + * Set the orchestratorVersion property: The version of Kubernetes specified by the user. 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). + * + * @param orchestratorVersion the orchestratorVersion value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withOrchestratorVersion(String orchestratorVersion) { + this.orchestratorVersion = orchestratorVersion; + return this; + } + + /** + * Get the currentOrchestratorVersion property: The version of Kubernetes the Agent Pool is running. 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. + * + * @return the currentOrchestratorVersion value. + */ + public String currentOrchestratorVersion() { + return this.currentOrchestratorVersion; + } + + /** + * Set the currentOrchestratorVersion property: The version of Kubernetes the Agent Pool is running. 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. + * + * @param currentOrchestratorVersion the currentOrchestratorVersion value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + ManagedClusterAgentPoolProfileProperties withCurrentOrchestratorVersion(String currentOrchestratorVersion) { + this.currentOrchestratorVersion = currentOrchestratorVersion; + return this; + } + + /** + * Get the nodeImageVersion property: The version of node image. + * + * @return the nodeImageVersion value. + */ + public String nodeImageVersion() { + return this.nodeImageVersion; + } + + /** + * Set the nodeImageVersion property: The version of node image. + * + * @param nodeImageVersion the nodeImageVersion value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + ManagedClusterAgentPoolProfileProperties withNodeImageVersion(String nodeImageVersion) { + this.nodeImageVersion = nodeImageVersion; + return this; + } + + /** + * Get the upgradeSettings property: Settings for upgrading the agentpool. + * + * @return the upgradeSettings value. + */ + public AgentPoolUpgradeSettings upgradeSettings() { + return this.upgradeSettings; + } + + /** + * Set the upgradeSettings property: Settings for upgrading the agentpool. + * + * @param upgradeSettings the upgradeSettings value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withUpgradeSettings(AgentPoolUpgradeSettings upgradeSettings) { + this.upgradeSettings = upgradeSettings; + return this; + } + + /** + * Get the provisioningState property: The current deployment or provisioning state. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: The current deployment or provisioning state. + * + * @param provisioningState the provisioningState value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + ManagedClusterAgentPoolProfileProperties withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the powerState property: Whether the Agent Pool is running or stopped. 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. + * + * @return the powerState value. + */ + public PowerState powerState() { + return this.powerState; + } + + /** + * Set the powerState property: Whether the Agent Pool is running or stopped. 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. + * + * @param powerState the powerState value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withPowerState(PowerState powerState) { + this.powerState = powerState; + return this; + } + + /** + * Get the availabilityZones property: The list of Availability zones to use for nodes. This can only be specified + * if the AgentPoolType property is 'VirtualMachineScaleSets'. + * + * @return the availabilityZones value. + */ + public List availabilityZones() { + return this.availabilityZones; + } + + /** + * Set the availabilityZones property: The list of Availability zones to use for nodes. This can only be specified + * if the AgentPoolType property is 'VirtualMachineScaleSets'. + * + * @param availabilityZones the availabilityZones value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withAvailabilityZones(List availabilityZones) { + this.availabilityZones = availabilityZones; + return this; + } + + /** + * Get the enableNodePublicIP property: Whether each node is allocated its own public IP. 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. + * + * @return the enableNodePublicIP value. + */ + public Boolean enableNodePublicIP() { + return this.enableNodePublicIP; + } + + /** + * Set the enableNodePublicIP property: Whether each node is allocated its own public IP. 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. + * + * @param enableNodePublicIP the enableNodePublicIP value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withEnableNodePublicIP(Boolean enableNodePublicIP) { + this.enableNodePublicIP = enableNodePublicIP; + return this; + } + + /** + * Get the nodePublicIPPrefixID property: The public IP prefix ID which VM nodes should use IPs from. This is of the + * form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + * + * @return the nodePublicIPPrefixID value. + */ + public String nodePublicIPPrefixID() { + return this.nodePublicIPPrefixID; + } + + /** + * Set the nodePublicIPPrefixID property: The public IP prefix ID which VM nodes should use IPs from. This is of the + * form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + * + * @param nodePublicIPPrefixID the nodePublicIPPrefixID value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withNodePublicIPPrefixID(String nodePublicIPPrefixID) { + this.nodePublicIPPrefixID = nodePublicIPPrefixID; + return this; + } + + /** + * Get the scaleSetPriority property: The Virtual Machine Scale Set priority. + * + * @return the scaleSetPriority value. + */ + public ScaleSetPriority scaleSetPriority() { + return this.scaleSetPriority; + } + + /** + * Set the scaleSetPriority property: The Virtual Machine Scale Set priority. + * + * @param scaleSetPriority the scaleSetPriority value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withScaleSetPriority(ScaleSetPriority scaleSetPriority) { + this.scaleSetPriority = scaleSetPriority; + return this; + } + + /** + * Get the scaleSetEvictionPolicy property: The Virtual Machine Scale Set eviction policy. 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). + * + * @return the scaleSetEvictionPolicy value. + */ + public ScaleSetEvictionPolicy scaleSetEvictionPolicy() { + return this.scaleSetEvictionPolicy; + } + + /** + * Set the scaleSetEvictionPolicy property: The Virtual Machine Scale Set eviction policy. 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). + * + * @param scaleSetEvictionPolicy the scaleSetEvictionPolicy value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties + withScaleSetEvictionPolicy(ScaleSetEvictionPolicy scaleSetEvictionPolicy) { + this.scaleSetEvictionPolicy = scaleSetEvictionPolicy; + return this; + } + + /** + * Get the spotMaxPrice property: The max price (in US Dollars) you are willing to pay for spot instances. Possible + * values are any decimal value greater than zero or -1 which indicates default price to be up-to on-demand. + * 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). + * + * @return the spotMaxPrice value. + */ + public Double spotMaxPrice() { + return this.spotMaxPrice; + } + + /** + * Set the spotMaxPrice property: The max price (in US Dollars) you are willing to pay for spot instances. Possible + * values are any decimal value greater than zero or -1 which indicates default price to be up-to on-demand. + * 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). + * + * @param spotMaxPrice the spotMaxPrice value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withSpotMaxPrice(Double spotMaxPrice) { + this.spotMaxPrice = spotMaxPrice; + return this; + } + + /** + * Get the tags property: The tags to be persisted on the agent pool virtual machine scale set. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The tags to be persisted on the agent pool virtual machine scale set. + * + * @param tags the tags value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the nodeLabels property: The node labels to be persisted across all nodes in agent pool. + * + * @return the nodeLabels value. + */ + public Map nodeLabels() { + return this.nodeLabels; + } + + /** + * Set the nodeLabels property: The node labels to be persisted across all nodes in agent pool. + * + * @param nodeLabels the nodeLabels value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withNodeLabels(Map nodeLabels) { + this.nodeLabels = nodeLabels; + return this; + } + + /** + * Get the nodeTaints property: The taints added to new nodes during node pool create and scale. For example, + * key=value:NoSchedule. + * + * @return the nodeTaints value. + */ + public List nodeTaints() { + return this.nodeTaints; + } + + /** + * Set the nodeTaints property: The taints added to new nodes during node pool create and scale. For example, + * key=value:NoSchedule. + * + * @param nodeTaints the nodeTaints value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withNodeTaints(List nodeTaints) { + this.nodeTaints = nodeTaints; + return this; + } + + /** + * Get the proximityPlacementGroupID property: The ID for Proximity Placement Group. + * + * @return the proximityPlacementGroupID value. + */ + public String proximityPlacementGroupID() { + return this.proximityPlacementGroupID; + } + + /** + * Set the proximityPlacementGroupID property: The ID for Proximity Placement Group. + * + * @param proximityPlacementGroupID the proximityPlacementGroupID value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withProximityPlacementGroupID(String proximityPlacementGroupID) { + this.proximityPlacementGroupID = proximityPlacementGroupID; + return this; + } + + /** + * Get the kubeletConfig property: The Kubelet configuration on the agent pool nodes. + * + * @return the kubeletConfig value. + */ + public KubeletConfig kubeletConfig() { + return this.kubeletConfig; + } + + /** + * Set the kubeletConfig property: The Kubelet configuration on the agent pool nodes. + * + * @param kubeletConfig the kubeletConfig value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withKubeletConfig(KubeletConfig kubeletConfig) { + this.kubeletConfig = kubeletConfig; + return this; + } + + /** + * Get the linuxOSConfig property: The OS configuration of Linux agent nodes. + * + * @return the linuxOSConfig value. + */ + public LinuxOSConfig linuxOSConfig() { + return this.linuxOSConfig; + } + + /** + * Set the linuxOSConfig property: The OS configuration of Linux agent nodes. + * + * @param linuxOSConfig the linuxOSConfig value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withLinuxOSConfig(LinuxOSConfig linuxOSConfig) { + this.linuxOSConfig = linuxOSConfig; + return this; + } + + /** + * Get the enableEncryptionAtHost property: Whether to enable host based OS and data drive encryption. 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. + * + * @return the enableEncryptionAtHost value. + */ + public Boolean enableEncryptionAtHost() { + return this.enableEncryptionAtHost; + } + + /** + * Set the enableEncryptionAtHost property: Whether to enable host based OS and data drive encryption. 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. + * + * @param enableEncryptionAtHost the enableEncryptionAtHost value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withEnableEncryptionAtHost(Boolean enableEncryptionAtHost) { + this.enableEncryptionAtHost = enableEncryptionAtHost; + return this; + } + + /** + * Get the enableUltraSSD property: Whether to enable UltraSSD. + * + * @return the enableUltraSSD value. + */ + public Boolean enableUltraSSD() { + return this.enableUltraSSD; + } + + /** + * Set the enableUltraSSD property: Whether to enable UltraSSD. + * + * @param enableUltraSSD the enableUltraSSD value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withEnableUltraSSD(Boolean enableUltraSSD) { + this.enableUltraSSD = enableUltraSSD; + return this; + } + + /** + * Get the enableFIPS property: Whether to use a FIPS-enabled OS. 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. + * + * @return the enableFIPS value. + */ + public Boolean enableFIPS() { + return this.enableFIPS; + } + + /** + * Set the enableFIPS property: Whether to use a FIPS-enabled OS. 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. + * + * @param enableFIPS the enableFIPS value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withEnableFIPS(Boolean enableFIPS) { + this.enableFIPS = enableFIPS; + return this; + } + + /** + * Get the gpuInstanceProfile property: GPUInstanceProfile to be used to specify GPU MIG instance profile for + * supported GPU VM SKU. + * + * @return the gpuInstanceProfile value. + */ + public GPUInstanceProfile gpuInstanceProfile() { + return this.gpuInstanceProfile; + } + + /** + * Set the gpuInstanceProfile property: GPUInstanceProfile to be used to specify GPU MIG instance profile for + * supported GPU VM SKU. + * + * @param gpuInstanceProfile the gpuInstanceProfile value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withGpuInstanceProfile(GPUInstanceProfile gpuInstanceProfile) { + this.gpuInstanceProfile = gpuInstanceProfile; + return this; + } + + /** + * Get the creationData property: CreationData to be used to specify the source Snapshot ID if the node pool will be + * created/upgraded using a snapshot. + * + * @return the creationData value. + */ + public CreationData creationData() { + return this.creationData; + } + + /** + * Set the creationData property: CreationData to be used to specify the source Snapshot ID if the node pool will be + * created/upgraded using a snapshot. + * + * @param creationData the creationData value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withCreationData(CreationData creationData) { + this.creationData = creationData; + return this; + } + + /** + * Get the capacityReservationGroupID property: The fully qualified resource ID of the Capacity Reservation Group to + * provide virtual machines from a reserved group of Virtual Machines. This is of the form: + * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Compute/capacityreservationgroups/{capacityReservationGroupName}' + * Customers use it to create an agentpool with a specified CRG. For more information see [Capacity + * Reservation](https://learn.microsoft.com/en-us/azure/virtual-machines/capacity-reservation-overview). + * + * @return the capacityReservationGroupID value. + */ + public String capacityReservationGroupID() { + return this.capacityReservationGroupID; + } + + /** + * Set the capacityReservationGroupID property: The fully qualified resource ID of the Capacity Reservation Group to + * provide virtual machines from a reserved group of Virtual Machines. This is of the form: + * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Compute/capacityreservationgroups/{capacityReservationGroupName}' + * Customers use it to create an agentpool with a specified CRG. For more information see [Capacity + * Reservation](https://learn.microsoft.com/en-us/azure/virtual-machines/capacity-reservation-overview). + * + * @param capacityReservationGroupID the capacityReservationGroupID value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withCapacityReservationGroupID(String capacityReservationGroupID) { + this.capacityReservationGroupID = capacityReservationGroupID; + return this; + } + + /** + * Get the hostGroupID property: The fully qualified resource ID of the Dedicated Host Group to provision virtual + * machines from, used only in creation scenario and not allowed to changed once 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). + * + * @return the hostGroupID value. + */ + public String hostGroupID() { + return this.hostGroupID; + } + + /** + * Set the hostGroupID property: The fully qualified resource ID of the Dedicated Host Group to provision virtual + * machines from, used only in creation scenario and not allowed to changed once 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). + * + * @param hostGroupID the hostGroupID value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withHostGroupID(String hostGroupID) { + this.hostGroupID = hostGroupID; + return this; + } + + /** + * Get the networkProfile property: Network-related settings of an agent pool. + * + * @return the networkProfile value. + */ + public AgentPoolNetworkProfile networkProfile() { + return this.networkProfile; + } + + /** + * Set the networkProfile property: Network-related settings of an agent pool. + * + * @param networkProfile the networkProfile value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withNetworkProfile(AgentPoolNetworkProfile networkProfile) { + this.networkProfile = networkProfile; + return this; + } + + /** + * Get the windowsProfile property: The Windows agent pool's specific profile. + * + * @return the windowsProfile value. + */ + public AgentPoolWindowsProfile windowsProfile() { + return this.windowsProfile; + } + + /** + * Set the windowsProfile property: The Windows agent pool's specific profile. + * + * @param windowsProfile the windowsProfile value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withWindowsProfile(AgentPoolWindowsProfile windowsProfile) { + this.windowsProfile = windowsProfile; + return this; + } + + /** + * Get the securityProfile property: The security settings of an agent pool. + * + * @return the securityProfile value. + */ + public AgentPoolSecurityProfile securityProfile() { + return this.securityProfile; + } + + /** + * Set the securityProfile property: The security settings of an agent pool. + * + * @param securityProfile the securityProfile value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withSecurityProfile(AgentPoolSecurityProfile securityProfile) { + this.securityProfile = securityProfile; + return this; + } + + /** + * Get the gpuProfile property: GPU settings for the Agent Pool. + * + * @return the gpuProfile value. + */ + public GPUProfile gpuProfile() { + return this.gpuProfile; + } + + /** + * Set the gpuProfile property: GPU settings for the Agent Pool. + * + * @param gpuProfile the gpuProfile value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withGpuProfile(GPUProfile gpuProfile) { + this.gpuProfile = gpuProfile; + return this; + } + + /** + * Get the gatewayProfile property: Profile specific to a managed agent pool in Gateway mode. This field cannot be + * set if agent pool mode is not Gateway. + * + * @return the gatewayProfile value. + */ + public AgentPoolGatewayProfile gatewayProfile() { + return this.gatewayProfile; + } + + /** + * Set the gatewayProfile property: Profile specific to a managed agent pool in Gateway mode. This field cannot be + * set if agent pool mode is not Gateway. + * + * @param gatewayProfile the gatewayProfile value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withGatewayProfile(AgentPoolGatewayProfile gatewayProfile) { + this.gatewayProfile = gatewayProfile; + return this; + } + + /** + * Get the virtualMachinesProfile property: Specifications on VirtualMachines agent pool. + * + * @return the virtualMachinesProfile value. + */ + public VirtualMachinesProfile virtualMachinesProfile() { + return this.virtualMachinesProfile; + } + + /** + * Set the virtualMachinesProfile property: Specifications on VirtualMachines agent pool. + * + * @param virtualMachinesProfile the virtualMachinesProfile value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties + withVirtualMachinesProfile(VirtualMachinesProfile virtualMachinesProfile) { + this.virtualMachinesProfile = virtualMachinesProfile; + return this; + } + + /** + * Get the virtualMachineNodesStatus property: The status of nodes in a VirtualMachines agent pool. + * + * @return the virtualMachineNodesStatus value. + */ + public List virtualMachineNodesStatus() { + return this.virtualMachineNodesStatus; + } + + /** + * Set the virtualMachineNodesStatus property: The status of nodes in a VirtualMachines agent pool. + * + * @param virtualMachineNodesStatus the virtualMachineNodesStatus value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties + withVirtualMachineNodesStatus(List virtualMachineNodesStatus) { + this.virtualMachineNodesStatus = virtualMachineNodesStatus; + return this; + } + + /** + * Get the status property: Contains read-only information about the Agent Pool. + * + * @return the status value. + */ + public AgentPoolStatus status() { + return this.status; + } + + /** + * Set the status property: Contains read-only information about the Agent Pool. + * + * @param status the status value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withStatus(AgentPoolStatus status) { + this.status = status; + return this; + } + + /** + * Get the localDNSProfile property: Configures the per-node local DNS, with VnetDNS and KubeDNS overrides. LocalDNS + * helps improve performance and reliability of DNS resolution in an AKS cluster. For more details see + * aka.ms/aks/localdns. + * + * @return the localDNSProfile value. + */ + public LocalDNSProfile localDNSProfile() { + return this.localDNSProfile; + } + + /** + * Set the localDNSProfile property: Configures the per-node local DNS, with VnetDNS and KubeDNS overrides. LocalDNS + * helps improve performance and reliability of DNS resolution in an AKS cluster. For more details see + * aka.ms/aks/localdns. + * + * @param localDNSProfile the localDNSProfile value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withLocalDNSProfile(LocalDNSProfile localDNSProfile) { + this.localDNSProfile = localDNSProfile; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("count", this.count); + jsonWriter.writeStringField("vmSize", this.vmSize); + jsonWriter.writeNumberField("osDiskSizeGB", this.osDiskSizeGB); + jsonWriter.writeStringField("osDiskType", this.osDiskType == null ? null : this.osDiskType.toString()); + jsonWriter.writeStringField("kubeletDiskType", + this.kubeletDiskType == null ? null : this.kubeletDiskType.toString()); + jsonWriter.writeStringField("workloadRuntime", + this.workloadRuntime == null ? null : this.workloadRuntime.toString()); + jsonWriter.writeStringField("messageOfTheDay", this.messageOfTheDay); + jsonWriter.writeStringField("vnetSubnetID", this.vnetSubnetID); + jsonWriter.writeStringField("podSubnetID", this.podSubnetID); + jsonWriter.writeStringField("podIPAllocationMode", + this.podIPAllocationMode == null ? null : this.podIPAllocationMode.toString()); + jsonWriter.writeNumberField("maxPods", this.maxPods); + jsonWriter.writeStringField("osType", this.osType == null ? null : this.osType.toString()); + jsonWriter.writeStringField("osSKU", this.osSKU == null ? null : this.osSKU.toString()); + jsonWriter.writeNumberField("maxCount", this.maxCount); + jsonWriter.writeNumberField("minCount", this.minCount); + jsonWriter.writeBooleanField("enableAutoScaling", this.enableAutoScaling); + jsonWriter.writeStringField("scaleDownMode", this.scaleDownMode == null ? null : this.scaleDownMode.toString()); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + jsonWriter.writeStringField("orchestratorVersion", this.orchestratorVersion); + jsonWriter.writeJsonField("upgradeSettings", this.upgradeSettings); + jsonWriter.writeJsonField("powerState", this.powerState); + jsonWriter.writeArrayField("availabilityZones", this.availabilityZones, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("enableNodePublicIP", this.enableNodePublicIP); + jsonWriter.writeStringField("nodePublicIPPrefixID", this.nodePublicIPPrefixID); + jsonWriter.writeStringField("scaleSetPriority", + this.scaleSetPriority == null ? null : this.scaleSetPriority.toString()); + jsonWriter.writeStringField("scaleSetEvictionPolicy", + this.scaleSetEvictionPolicy == null ? null : this.scaleSetEvictionPolicy.toString()); + jsonWriter.writeNumberField("spotMaxPrice", this.spotMaxPrice); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("nodeLabels", this.nodeLabels, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("nodeTaints", this.nodeTaints, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("proximityPlacementGroupID", this.proximityPlacementGroupID); + jsonWriter.writeJsonField("kubeletConfig", this.kubeletConfig); + jsonWriter.writeJsonField("linuxOSConfig", this.linuxOSConfig); + jsonWriter.writeBooleanField("enableEncryptionAtHost", this.enableEncryptionAtHost); + jsonWriter.writeBooleanField("enableUltraSSD", this.enableUltraSSD); + jsonWriter.writeBooleanField("enableFIPS", this.enableFIPS); + jsonWriter.writeStringField("gpuInstanceProfile", + this.gpuInstanceProfile == null ? null : this.gpuInstanceProfile.toString()); + jsonWriter.writeJsonField("creationData", this.creationData); + jsonWriter.writeStringField("capacityReservationGroupID", this.capacityReservationGroupID); + jsonWriter.writeStringField("hostGroupID", this.hostGroupID); + jsonWriter.writeJsonField("networkProfile", this.networkProfile); + jsonWriter.writeJsonField("windowsProfile", this.windowsProfile); + jsonWriter.writeJsonField("securityProfile", this.securityProfile); + jsonWriter.writeJsonField("gpuProfile", this.gpuProfile); + jsonWriter.writeJsonField("gatewayProfile", this.gatewayProfile); + jsonWriter.writeJsonField("virtualMachinesProfile", this.virtualMachinesProfile); + jsonWriter.writeArrayField("virtualMachineNodesStatus", this.virtualMachineNodesStatus, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("status", this.status); + jsonWriter.writeJsonField("localDNSProfile", this.localDNSProfile); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterAgentPoolProfileProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterAgentPoolProfileProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedClusterAgentPoolProfileProperties. + */ + public static ManagedClusterAgentPoolProfileProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterAgentPoolProfileProperties deserializedManagedClusterAgentPoolProfileProperties + = new ManagedClusterAgentPoolProfileProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("eTag".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.eTag = reader.getString(); + } else if ("count".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.count = reader.getNullable(JsonReader::getInt); + } else if ("vmSize".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.vmSize = reader.getString(); + } else if ("osDiskSizeGB".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.osDiskSizeGB + = reader.getNullable(JsonReader::getInt); + } else if ("osDiskType".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.osDiskType + = OSDiskType.fromString(reader.getString()); + } else if ("kubeletDiskType".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.kubeletDiskType + = KubeletDiskType.fromString(reader.getString()); + } else if ("workloadRuntime".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.workloadRuntime + = WorkloadRuntime.fromString(reader.getString()); + } else if ("messageOfTheDay".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.messageOfTheDay = reader.getString(); + } else if ("vnetSubnetID".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.vnetSubnetID = reader.getString(); + } else if ("podSubnetID".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.podSubnetID = reader.getString(); + } else if ("podIPAllocationMode".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.podIPAllocationMode + = PodIPAllocationMode.fromString(reader.getString()); + } else if ("maxPods".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.maxPods + = reader.getNullable(JsonReader::getInt); + } else if ("osType".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.osType = OSType.fromString(reader.getString()); + } else if ("osSKU".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.osSKU = OSSKU.fromString(reader.getString()); + } else if ("maxCount".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.maxCount + = reader.getNullable(JsonReader::getInt); + } else if ("minCount".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.minCount + = reader.getNullable(JsonReader::getInt); + } else if ("enableAutoScaling".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.enableAutoScaling + = reader.getNullable(JsonReader::getBoolean); + } else if ("scaleDownMode".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.scaleDownMode + = ScaleDownMode.fromString(reader.getString()); + } else if ("type".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.type + = AgentPoolType.fromString(reader.getString()); + } else if ("mode".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.mode + = AgentPoolMode.fromString(reader.getString()); + } else if ("orchestratorVersion".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.orchestratorVersion = reader.getString(); + } else if ("currentOrchestratorVersion".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.currentOrchestratorVersion + = reader.getString(); + } else if ("nodeImageVersion".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.nodeImageVersion = reader.getString(); + } else if ("upgradeSettings".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.upgradeSettings + = AgentPoolUpgradeSettings.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.provisioningState = reader.getString(); + } else if ("powerState".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.powerState = PowerState.fromJson(reader); + } else if ("availabilityZones".equals(fieldName)) { + List availabilityZones = reader.readArray(reader1 -> reader1.getString()); + deserializedManagedClusterAgentPoolProfileProperties.availabilityZones = availabilityZones; + } else if ("enableNodePublicIP".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.enableNodePublicIP + = reader.getNullable(JsonReader::getBoolean); + } else if ("nodePublicIPPrefixID".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.nodePublicIPPrefixID = reader.getString(); + } else if ("scaleSetPriority".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.scaleSetPriority + = ScaleSetPriority.fromString(reader.getString()); + } else if ("scaleSetEvictionPolicy".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.scaleSetEvictionPolicy + = ScaleSetEvictionPolicy.fromString(reader.getString()); + } else if ("spotMaxPrice".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.spotMaxPrice + = reader.getNullable(JsonReader::getDouble); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedManagedClusterAgentPoolProfileProperties.tags = tags; + } else if ("nodeLabels".equals(fieldName)) { + Map nodeLabels = reader.readMap(reader1 -> reader1.getString()); + deserializedManagedClusterAgentPoolProfileProperties.nodeLabels = nodeLabels; + } else if ("nodeTaints".equals(fieldName)) { + List nodeTaints = reader.readArray(reader1 -> reader1.getString()); + deserializedManagedClusterAgentPoolProfileProperties.nodeTaints = nodeTaints; + } else if ("proximityPlacementGroupID".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.proximityPlacementGroupID = reader.getString(); + } else if ("kubeletConfig".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.kubeletConfig = KubeletConfig.fromJson(reader); + } else if ("linuxOSConfig".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.linuxOSConfig = LinuxOSConfig.fromJson(reader); + } else if ("enableEncryptionAtHost".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.enableEncryptionAtHost + = reader.getNullable(JsonReader::getBoolean); + } else if ("enableUltraSSD".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.enableUltraSSD + = reader.getNullable(JsonReader::getBoolean); + } else if ("enableFIPS".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.enableFIPS + = reader.getNullable(JsonReader::getBoolean); + } else if ("gpuInstanceProfile".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.gpuInstanceProfile + = GPUInstanceProfile.fromString(reader.getString()); + } else if ("creationData".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.creationData = CreationData.fromJson(reader); + } else if ("capacityReservationGroupID".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.capacityReservationGroupID + = reader.getString(); + } else if ("hostGroupID".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.hostGroupID = reader.getString(); + } else if ("networkProfile".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.networkProfile + = AgentPoolNetworkProfile.fromJson(reader); + } else if ("windowsProfile".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.windowsProfile + = AgentPoolWindowsProfile.fromJson(reader); + } else if ("securityProfile".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.securityProfile + = AgentPoolSecurityProfile.fromJson(reader); + } else if ("gpuProfile".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.gpuProfile = GPUProfile.fromJson(reader); + } else if ("gatewayProfile".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.gatewayProfile + = AgentPoolGatewayProfile.fromJson(reader); + } else if ("virtualMachinesProfile".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.virtualMachinesProfile + = VirtualMachinesProfile.fromJson(reader); + } else if ("virtualMachineNodesStatus".equals(fieldName)) { + List virtualMachineNodesStatus + = reader.readArray(reader1 -> VirtualMachineNodes.fromJson(reader1)); + deserializedManagedClusterAgentPoolProfileProperties.virtualMachineNodesStatus + = virtualMachineNodesStatus; + } else if ("status".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.status = AgentPoolStatus.fromJson(reader); + } else if ("localDNSProfile".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfileProperties.localDNSProfile + = LocalDNSProfile.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterAgentPoolProfileProperties; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterInner.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterInner.java new file mode 100644 index 000000000000..cca0842671d3 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterInner.java @@ -0,0 +1,1318 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerservice.generated.models.ClusterUpgradeSettings; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServiceLinuxProfile; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServiceNetworkProfile; +import com.azure.resourcemanager.containerservice.generated.models.ExtendedLocation; +import com.azure.resourcemanager.containerservice.generated.models.KubernetesSupportPlan; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAADProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAIToolchainOperatorProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAddonProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAgentPoolProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterApiServerAccessProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAutoUpgradeProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAzureMonitorProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterBootstrapProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterHttpProxyConfig; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterIdentity; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterIngressProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterMetricsProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterNodeProvisioningProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterNodeResourceGroupProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterOIDCIssuerProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterPodIdentityProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterPropertiesAutoScalerProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSKU; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSecurityProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterServicePrincipalProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterStatus; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterStorageProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterWindowsProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterWorkloadAutoScalerProfile; +import com.azure.resourcemanager.containerservice.generated.models.PowerState; +import com.azure.resourcemanager.containerservice.generated.models.PublicNetworkAccess; +import com.azure.resourcemanager.containerservice.generated.models.ServiceMeshProfile; +import com.azure.resourcemanager.containerservice.generated.models.UserAssignedIdentity; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Managed cluster. + */ +@Fluent +public final class ManagedClusterInner extends Resource { + /* + * Properties of a managed cluster. + */ + private ManagedClusterProperties innerProperties; + + /* + * If eTag is provided in the response body, it may also be provided as a header per the normal etag convention. + * Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity + * tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section + * 14.27) header fields. + */ + private String eTag; + + /* + * The managed cluster SKU. + */ + private ManagedClusterSKU sku; + + /* + * The extended location of the Virtual Machine. + */ + private ExtendedLocation extendedLocation; + + /* + * The identity of the managed cluster, if configured. + */ + private ManagedClusterIdentity identity; + + /* + * This is primarily used to expose different UI experiences in the portal for different kinds + */ + private String kind; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ManagedClusterInner class. + */ + public ManagedClusterInner() { + } + + /** + * Get the innerProperties property: Properties of a managed cluster. + * + * @return the innerProperties value. + */ + private ManagedClusterProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the eTag property: If eTag is provided in the response body, it may also be provided as a header per the + * normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. + * HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), + * and If-Range (section 14.27) header fields. + * + * @return the eTag value. + */ + public String eTag() { + return this.eTag; + } + + /** + * Get the sku property: The managed cluster SKU. + * + * @return the sku value. + */ + public ManagedClusterSKU sku() { + return this.sku; + } + + /** + * Set the sku property: The managed cluster SKU. + * + * @param sku the sku value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withSku(ManagedClusterSKU sku) { + this.sku = sku; + return this; + } + + /** + * Get the extendedLocation property: The extended location of the Virtual Machine. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: The extended location of the Virtual Machine. + * + * @param extendedLocation the extendedLocation value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the identity property: The identity of the managed cluster, if configured. + * + * @return the identity value. + */ + public ManagedClusterIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the managed cluster, if configured. + * + * @param identity the identity value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withIdentity(ManagedClusterIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the kind property: This is primarily used to expose different UI experiences in the portal for different + * kinds. + * + * @return the kind value. + */ + public String kind() { + return this.kind; + } + + /** + * Set the kind property: This is primarily used to expose different UI experiences in the portal for different + * kinds. + * + * @param kind the kind value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withKind(String kind) { + this.kind = kind; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: The current provisioning state. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the powerState property: The Power State of the cluster. + * + * @return the powerState value. + */ + public PowerState powerState() { + return this.innerProperties() == null ? null : this.innerProperties().powerState(); + } + + /** + * Get the maxAgentPools property: The max number of agent pools for the managed cluster. + * + * @return the maxAgentPools value. + */ + public Integer maxAgentPools() { + return this.innerProperties() == null ? null : this.innerProperties().maxAgentPools(); + } + + /** + * Get the kubernetesVersion property: The version of Kubernetes specified by the user. 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. + * + * @return the kubernetesVersion value. + */ + public String kubernetesVersion() { + return this.innerProperties() == null ? null : this.innerProperties().kubernetesVersion(); + } + + /** + * Set the kubernetesVersion property: The version of Kubernetes specified by the user. 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. + * + * @param kubernetesVersion the kubernetesVersion value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withKubernetesVersion(String kubernetesVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withKubernetesVersion(kubernetesVersion); + return this; + } + + /** + * Get the currentKubernetesVersion property: The version of Kubernetes the Managed Cluster is running. 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. + * + * @return the currentKubernetesVersion value. + */ + public String currentKubernetesVersion() { + return this.innerProperties() == null ? null : this.innerProperties().currentKubernetesVersion(); + } + + /** + * Get the dnsPrefix property: The DNS prefix of the Managed Cluster. This cannot be updated once the Managed + * Cluster has been created. + * + * @return the dnsPrefix value. + */ + public String dnsPrefix() { + return this.innerProperties() == null ? null : this.innerProperties().dnsPrefix(); + } + + /** + * Set the dnsPrefix property: The DNS prefix of the Managed Cluster. This cannot be updated once the Managed + * Cluster has been created. + * + * @param dnsPrefix the dnsPrefix value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withDnsPrefix(String dnsPrefix) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withDnsPrefix(dnsPrefix); + return this; + } + + /** + * Get the fqdnSubdomain property: The FQDN subdomain of the private cluster with custom private dns zone. This + * cannot be updated once the Managed Cluster has been created. + * + * @return the fqdnSubdomain value. + */ + public String fqdnSubdomain() { + return this.innerProperties() == null ? null : this.innerProperties().fqdnSubdomain(); + } + + /** + * Set the fqdnSubdomain property: The FQDN subdomain of the private cluster with custom private dns zone. This + * cannot be updated once the Managed Cluster has been created. + * + * @param fqdnSubdomain the fqdnSubdomain value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withFqdnSubdomain(String fqdnSubdomain) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withFqdnSubdomain(fqdnSubdomain); + return this; + } + + /** + * Get the fqdn property: The FQDN of the master pool. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.innerProperties() == null ? null : this.innerProperties().fqdn(); + } + + /** + * Get the privateFQDN property: The FQDN of private cluster. + * + * @return the privateFQDN value. + */ + public String privateFQDN() { + return this.innerProperties() == null ? null : this.innerProperties().privateFQDN(); + } + + /** + * Get the azurePortalFQDN property: The special FQDN used by the Azure Portal to access the Managed Cluster. This + * FQDN is for use only by the Azure Portal and should not be used by other clients. 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. + * + * @return the azurePortalFQDN value. + */ + public String azurePortalFQDN() { + return this.innerProperties() == null ? null : this.innerProperties().azurePortalFQDN(); + } + + /** + * Get the agentPoolProfiles property: The agent pool properties. + * + * @return the agentPoolProfiles value. + */ + public List agentPoolProfiles() { + return this.innerProperties() == null ? null : this.innerProperties().agentPoolProfiles(); + } + + /** + * Set the agentPoolProfiles property: The agent pool properties. + * + * @param agentPoolProfiles the agentPoolProfiles value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withAgentPoolProfiles(List agentPoolProfiles) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withAgentPoolProfiles(agentPoolProfiles); + return this; + } + + /** + * Get the linuxProfile property: The profile for Linux VMs in the Managed Cluster. + * + * @return the linuxProfile value. + */ + public ContainerServiceLinuxProfile linuxProfile() { + return this.innerProperties() == null ? null : this.innerProperties().linuxProfile(); + } + + /** + * Set the linuxProfile property: The profile for Linux VMs in the Managed Cluster. + * + * @param linuxProfile the linuxProfile value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withLinuxProfile(ContainerServiceLinuxProfile linuxProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withLinuxProfile(linuxProfile); + return this; + } + + /** + * Get the windowsProfile property: The profile for Windows VMs in the Managed Cluster. + * + * @return the windowsProfile value. + */ + public ManagedClusterWindowsProfile windowsProfile() { + return this.innerProperties() == null ? null : this.innerProperties().windowsProfile(); + } + + /** + * Set the windowsProfile property: The profile for Windows VMs in the Managed Cluster. + * + * @param windowsProfile the windowsProfile value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withWindowsProfile(ManagedClusterWindowsProfile windowsProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withWindowsProfile(windowsProfile); + return this; + } + + /** + * Get the servicePrincipalProfile property: Information about a service principal identity for the cluster to use + * for manipulating Azure APIs. + * + * @return the servicePrincipalProfile value. + */ + public ManagedClusterServicePrincipalProfile servicePrincipalProfile() { + return this.innerProperties() == null ? null : this.innerProperties().servicePrincipalProfile(); + } + + /** + * Set the servicePrincipalProfile property: Information about a service principal identity for the cluster to use + * for manipulating Azure APIs. + * + * @param servicePrincipalProfile the servicePrincipalProfile value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner + withServicePrincipalProfile(ManagedClusterServicePrincipalProfile servicePrincipalProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withServicePrincipalProfile(servicePrincipalProfile); + return this; + } + + /** + * Get the addonProfiles property: The profile of managed cluster add-on. + * + * @return the addonProfiles value. + */ + public Map addonProfiles() { + return this.innerProperties() == null ? null : this.innerProperties().addonProfiles(); + } + + /** + * Set the addonProfiles property: The profile of managed cluster add-on. + * + * @param addonProfiles the addonProfiles value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withAddonProfiles(Map addonProfiles) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withAddonProfiles(addonProfiles); + return this; + } + + /** + * Get the podIdentityProfile property: The pod identity profile of the Managed Cluster. See [use AAD pod + * identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity) for more details on AAD pod identity + * integration. + * + * @return the podIdentityProfile value. + */ + public ManagedClusterPodIdentityProfile podIdentityProfile() { + return this.innerProperties() == null ? null : this.innerProperties().podIdentityProfile(); + } + + /** + * Set the podIdentityProfile property: The pod identity profile of the Managed Cluster. See [use AAD pod + * identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity) for more details on AAD pod identity + * integration. + * + * @param podIdentityProfile the podIdentityProfile value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withPodIdentityProfile(ManagedClusterPodIdentityProfile podIdentityProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withPodIdentityProfile(podIdentityProfile); + return this; + } + + /** + * Get the oidcIssuerProfile property: The OIDC issuer profile of the Managed Cluster. + * + * @return the oidcIssuerProfile value. + */ + public ManagedClusterOIDCIssuerProfile oidcIssuerProfile() { + return this.innerProperties() == null ? null : this.innerProperties().oidcIssuerProfile(); + } + + /** + * Set the oidcIssuerProfile property: The OIDC issuer profile of the Managed Cluster. + * + * @param oidcIssuerProfile the oidcIssuerProfile value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withOidcIssuerProfile(ManagedClusterOIDCIssuerProfile oidcIssuerProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withOidcIssuerProfile(oidcIssuerProfile); + return this; + } + + /** + * Get the nodeResourceGroup property: The name of the resource group containing agent pool nodes. + * + * @return the nodeResourceGroup value. + */ + public String nodeResourceGroup() { + return this.innerProperties() == null ? null : this.innerProperties().nodeResourceGroup(); + } + + /** + * Set the nodeResourceGroup property: The name of the resource group containing agent pool nodes. + * + * @param nodeResourceGroup the nodeResourceGroup value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withNodeResourceGroup(String nodeResourceGroup) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withNodeResourceGroup(nodeResourceGroup); + return this; + } + + /** + * Get the nodeResourceGroupProfile property: Profile of the node resource group configuration. + * + * @return the nodeResourceGroupProfile value. + */ + public ManagedClusterNodeResourceGroupProfile nodeResourceGroupProfile() { + return this.innerProperties() == null ? null : this.innerProperties().nodeResourceGroupProfile(); + } + + /** + * Set the nodeResourceGroupProfile property: Profile of the node resource group configuration. + * + * @param nodeResourceGroupProfile the nodeResourceGroupProfile value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner + withNodeResourceGroupProfile(ManagedClusterNodeResourceGroupProfile nodeResourceGroupProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withNodeResourceGroupProfile(nodeResourceGroupProfile); + return this; + } + + /** + * Get the enableRBAC property: Whether to enable Kubernetes Role-Based Access Control. + * + * @return the enableRBAC value. + */ + public Boolean enableRBAC() { + return this.innerProperties() == null ? null : this.innerProperties().enableRBAC(); + } + + /** + * Set the enableRBAC property: Whether to enable Kubernetes Role-Based Access Control. + * + * @param enableRBAC the enableRBAC value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withEnableRBAC(Boolean enableRBAC) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withEnableRBAC(enableRBAC); + return this; + } + + /** + * Get the supportPlan property: The support plan for the Managed Cluster. If unspecified, the default is + * 'KubernetesOfficial'. + * + * @return the supportPlan value. + */ + public KubernetesSupportPlan supportPlan() { + return this.innerProperties() == null ? null : this.innerProperties().supportPlan(); + } + + /** + * Set the supportPlan property: The support plan for the Managed Cluster. If unspecified, the default is + * 'KubernetesOfficial'. + * + * @param supportPlan the supportPlan value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withSupportPlan(KubernetesSupportPlan supportPlan) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withSupportPlan(supportPlan); + return this; + } + + /** + * Get the networkProfile property: The network configuration profile. + * + * @return the networkProfile value. + */ + public ContainerServiceNetworkProfile networkProfile() { + return this.innerProperties() == null ? null : this.innerProperties().networkProfile(); + } + + /** + * Set the networkProfile property: The network configuration profile. + * + * @param networkProfile the networkProfile value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withNetworkProfile(ContainerServiceNetworkProfile networkProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withNetworkProfile(networkProfile); + return this; + } + + /** + * Get the aadProfile property: The Azure Active Directory configuration. + * + * @return the aadProfile value. + */ + public ManagedClusterAADProfile aadProfile() { + return this.innerProperties() == null ? null : this.innerProperties().aadProfile(); + } + + /** + * Set the aadProfile property: The Azure Active Directory configuration. + * + * @param aadProfile the aadProfile value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withAadProfile(ManagedClusterAADProfile aadProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withAadProfile(aadProfile); + return this; + } + + /** + * Get the autoUpgradeProfile property: The auto upgrade configuration. + * + * @return the autoUpgradeProfile value. + */ + public ManagedClusterAutoUpgradeProfile autoUpgradeProfile() { + return this.innerProperties() == null ? null : this.innerProperties().autoUpgradeProfile(); + } + + /** + * Set the autoUpgradeProfile property: The auto upgrade configuration. + * + * @param autoUpgradeProfile the autoUpgradeProfile value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withAutoUpgradeProfile(ManagedClusterAutoUpgradeProfile autoUpgradeProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withAutoUpgradeProfile(autoUpgradeProfile); + return this; + } + + /** + * Get the upgradeSettings property: Settings for upgrading a cluster. + * + * @return the upgradeSettings value. + */ + public ClusterUpgradeSettings upgradeSettings() { + return this.innerProperties() == null ? null : this.innerProperties().upgradeSettings(); + } + + /** + * Set the upgradeSettings property: Settings for upgrading a cluster. + * + * @param upgradeSettings the upgradeSettings value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withUpgradeSettings(ClusterUpgradeSettings upgradeSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withUpgradeSettings(upgradeSettings); + return this; + } + + /** + * Get the autoScalerProfile property: Parameters to be applied to the cluster-autoscaler when enabled. + * + * @return the autoScalerProfile value. + */ + public ManagedClusterPropertiesAutoScalerProfile autoScalerProfile() { + return this.innerProperties() == null ? null : this.innerProperties().autoScalerProfile(); + } + + /** + * Set the autoScalerProfile property: Parameters to be applied to the cluster-autoscaler when enabled. + * + * @param autoScalerProfile the autoScalerProfile value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withAutoScalerProfile(ManagedClusterPropertiesAutoScalerProfile autoScalerProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withAutoScalerProfile(autoScalerProfile); + return this; + } + + /** + * Get the apiServerAccessProfile property: The access profile for managed cluster API server. + * + * @return the apiServerAccessProfile value. + */ + public ManagedClusterApiServerAccessProfile apiServerAccessProfile() { + return this.innerProperties() == null ? null : this.innerProperties().apiServerAccessProfile(); + } + + /** + * Set the apiServerAccessProfile property: The access profile for managed cluster API server. + * + * @param apiServerAccessProfile the apiServerAccessProfile value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withApiServerAccessProfile(ManagedClusterApiServerAccessProfile apiServerAccessProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withApiServerAccessProfile(apiServerAccessProfile); + return this; + } + + /** + * Get the diskEncryptionSetID property: The Resource ID of the disk encryption set to use for enabling encryption + * at rest. This is of the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. + * + * @return the diskEncryptionSetID value. + */ + public String diskEncryptionSetID() { + return this.innerProperties() == null ? null : this.innerProperties().diskEncryptionSetID(); + } + + /** + * Set the diskEncryptionSetID property: The Resource ID of the disk encryption set to use for enabling encryption + * at rest. This is of the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. + * + * @param diskEncryptionSetID the diskEncryptionSetID value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withDiskEncryptionSetID(String diskEncryptionSetID) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withDiskEncryptionSetID(diskEncryptionSetID); + return this; + } + + /** + * Get the identityProfile property: The user identity associated with the managed cluster. This identity will be + * used by the kubelet. Only one user assigned identity is allowed. The only accepted key is "kubeletidentity", with + * value of "resourceId": + * "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}". + * + * @return the identityProfile value. + */ + public Map identityProfile() { + return this.innerProperties() == null ? null : this.innerProperties().identityProfile(); + } + + /** + * Set the identityProfile property: The user identity associated with the managed cluster. This identity will be + * used by the kubelet. Only one user assigned identity is allowed. The only accepted key is "kubeletidentity", with + * value of "resourceId": + * "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}". + * + * @param identityProfile the identityProfile value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withIdentityProfile(Map identityProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withIdentityProfile(identityProfile); + return this; + } + + /** + * Get the privateLinkResources property: Private link resources associated with the cluster. + * + * @return the privateLinkResources value. + */ + public List privateLinkResources() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkResources(); + } + + /** + * Set the privateLinkResources property: Private link resources associated with the cluster. + * + * @param privateLinkResources the privateLinkResources value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withPrivateLinkResources(List privateLinkResources) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withPrivateLinkResources(privateLinkResources); + return this; + } + + /** + * Get the disableLocalAccounts property: If local accounts should be disabled on the Managed 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). + * + * @return the disableLocalAccounts value. + */ + public Boolean disableLocalAccounts() { + return this.innerProperties() == null ? null : this.innerProperties().disableLocalAccounts(); + } + + /** + * Set the disableLocalAccounts property: If local accounts should be disabled on the Managed 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). + * + * @param disableLocalAccounts the disableLocalAccounts value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withDisableLocalAccounts(Boolean disableLocalAccounts) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withDisableLocalAccounts(disableLocalAccounts); + return this; + } + + /** + * Get the httpProxyConfig property: Configurations for provisioning the cluster with HTTP proxy servers. + * + * @return the httpProxyConfig value. + */ + public ManagedClusterHttpProxyConfig httpProxyConfig() { + return this.innerProperties() == null ? null : this.innerProperties().httpProxyConfig(); + } + + /** + * Set the httpProxyConfig property: Configurations for provisioning the cluster with HTTP proxy servers. + * + * @param httpProxyConfig the httpProxyConfig value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withHttpProxyConfig(ManagedClusterHttpProxyConfig httpProxyConfig) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withHttpProxyConfig(httpProxyConfig); + return this; + } + + /** + * Get the securityProfile property: Security profile for the managed cluster. + * + * @return the securityProfile value. + */ + public ManagedClusterSecurityProfile securityProfile() { + return this.innerProperties() == null ? null : this.innerProperties().securityProfile(); + } + + /** + * Set the securityProfile property: Security profile for the managed cluster. + * + * @param securityProfile the securityProfile value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withSecurityProfile(ManagedClusterSecurityProfile securityProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withSecurityProfile(securityProfile); + return this; + } + + /** + * Get the storageProfile property: Storage profile for the managed cluster. + * + * @return the storageProfile value. + */ + public ManagedClusterStorageProfile storageProfile() { + return this.innerProperties() == null ? null : this.innerProperties().storageProfile(); + } + + /** + * Set the storageProfile property: Storage profile for the managed cluster. + * + * @param storageProfile the storageProfile value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withStorageProfile(ManagedClusterStorageProfile storageProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withStorageProfile(storageProfile); + return this; + } + + /** + * Get the ingressProfile property: Ingress profile for the managed cluster. + * + * @return the ingressProfile value. + */ + public ManagedClusterIngressProfile ingressProfile() { + return this.innerProperties() == null ? null : this.innerProperties().ingressProfile(); + } + + /** + * Set the ingressProfile property: Ingress profile for the managed cluster. + * + * @param ingressProfile the ingressProfile value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withIngressProfile(ManagedClusterIngressProfile ingressProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withIngressProfile(ingressProfile); + return this; + } + + /** + * Get the publicNetworkAccess property: PublicNetworkAccess of the managedCluster. Allow or deny public network + * access for AKS. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccess(); + } + + /** + * Set the publicNetworkAccess property: PublicNetworkAccess of the managedCluster. Allow or deny public network + * access for AKS. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); + return this; + } + + /** + * Get the workloadAutoScalerProfile property: Workload Auto-scaler profile for the managed cluster. + * + * @return the workloadAutoScalerProfile value. + */ + public ManagedClusterWorkloadAutoScalerProfile workloadAutoScalerProfile() { + return this.innerProperties() == null ? null : this.innerProperties().workloadAutoScalerProfile(); + } + + /** + * Set the workloadAutoScalerProfile property: Workload Auto-scaler profile for the managed cluster. + * + * @param workloadAutoScalerProfile the workloadAutoScalerProfile value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner + withWorkloadAutoScalerProfile(ManagedClusterWorkloadAutoScalerProfile workloadAutoScalerProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withWorkloadAutoScalerProfile(workloadAutoScalerProfile); + return this; + } + + /** + * Get the azureMonitorProfile property: Azure Monitor addon profiles for monitoring the managed cluster. + * + * @return the azureMonitorProfile value. + */ + public ManagedClusterAzureMonitorProfile azureMonitorProfile() { + return this.innerProperties() == null ? null : this.innerProperties().azureMonitorProfile(); + } + + /** + * Set the azureMonitorProfile property: Azure Monitor addon profiles for monitoring the managed cluster. + * + * @param azureMonitorProfile the azureMonitorProfile value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withAzureMonitorProfile(ManagedClusterAzureMonitorProfile azureMonitorProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withAzureMonitorProfile(azureMonitorProfile); + return this; + } + + /** + * Get the serviceMeshProfile property: Service mesh profile for a managed cluster. + * + * @return the serviceMeshProfile value. + */ + public ServiceMeshProfile serviceMeshProfile() { + return this.innerProperties() == null ? null : this.innerProperties().serviceMeshProfile(); + } + + /** + * Set the serviceMeshProfile property: Service mesh profile for a managed cluster. + * + * @param serviceMeshProfile the serviceMeshProfile value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withServiceMeshProfile(ServiceMeshProfile serviceMeshProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withServiceMeshProfile(serviceMeshProfile); + return this; + } + + /** + * Get the resourceUID property: The resourceUID uniquely identifies ManagedClusters that reuse ARM ResourceIds + * (i.e: create, delete, create sequence). + * + * @return the resourceUID value. + */ + public String resourceUID() { + return this.innerProperties() == null ? null : this.innerProperties().resourceUID(); + } + + /** + * Get the metricsProfile property: Optional cluster metrics configuration. + * + * @return the metricsProfile value. + */ + public ManagedClusterMetricsProfile metricsProfile() { + return this.innerProperties() == null ? null : this.innerProperties().metricsProfile(); + } + + /** + * Set the metricsProfile property: Optional cluster metrics configuration. + * + * @param metricsProfile the metricsProfile value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withMetricsProfile(ManagedClusterMetricsProfile metricsProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withMetricsProfile(metricsProfile); + return this; + } + + /** + * Get the nodeProvisioningProfile property: Node provisioning settings that apply to the whole cluster. + * + * @return the nodeProvisioningProfile value. + */ + public ManagedClusterNodeProvisioningProfile nodeProvisioningProfile() { + return this.innerProperties() == null ? null : this.innerProperties().nodeProvisioningProfile(); + } + + /** + * Set the nodeProvisioningProfile property: Node provisioning settings that apply to the whole cluster. + * + * @param nodeProvisioningProfile the nodeProvisioningProfile value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner + withNodeProvisioningProfile(ManagedClusterNodeProvisioningProfile nodeProvisioningProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withNodeProvisioningProfile(nodeProvisioningProfile); + return this; + } + + /** + * Get the bootstrapProfile property: Profile of the cluster bootstrap configuration. + * + * @return the bootstrapProfile value. + */ + public ManagedClusterBootstrapProfile bootstrapProfile() { + return this.innerProperties() == null ? null : this.innerProperties().bootstrapProfile(); + } + + /** + * Set the bootstrapProfile property: Profile of the cluster bootstrap configuration. + * + * @param bootstrapProfile the bootstrapProfile value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withBootstrapProfile(ManagedClusterBootstrapProfile bootstrapProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withBootstrapProfile(bootstrapProfile); + return this; + } + + /** + * Get the aiToolchainOperatorProfile property: AI toolchain operator settings that apply to the whole cluster. + * + * @return the aiToolchainOperatorProfile value. + */ + public ManagedClusterAIToolchainOperatorProfile aiToolchainOperatorProfile() { + return this.innerProperties() == null ? null : this.innerProperties().aiToolchainOperatorProfile(); + } + + /** + * Set the aiToolchainOperatorProfile property: AI toolchain operator settings that apply to the whole cluster. + * + * @param aiToolchainOperatorProfile the aiToolchainOperatorProfile value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner + withAiToolchainOperatorProfile(ManagedClusterAIToolchainOperatorProfile aiToolchainOperatorProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withAiToolchainOperatorProfile(aiToolchainOperatorProfile); + return this; + } + + /** + * Get the status property: Contains read-only information about the Managed Cluster. + * + * @return the status value. + */ + public ManagedClusterStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Set the status property: Contains read-only information about the Managed Cluster. + * + * @param status the status value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withStatus(ManagedClusterStatus status) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withStatus(status); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("sku", this.sku); + jsonWriter.writeJsonField("extendedLocation", this.extendedLocation); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeStringField("kind", this.kind); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ManagedClusterInner. + */ + public static ManagedClusterInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterInner deserializedManagedClusterInner = new ManagedClusterInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedManagedClusterInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedManagedClusterInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedManagedClusterInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedManagedClusterInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedManagedClusterInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedManagedClusterInner.innerProperties = ManagedClusterProperties.fromJson(reader); + } else if ("eTag".equals(fieldName)) { + deserializedManagedClusterInner.eTag = reader.getString(); + } else if ("sku".equals(fieldName)) { + deserializedManagedClusterInner.sku = ManagedClusterSKU.fromJson(reader); + } else if ("extendedLocation".equals(fieldName)) { + deserializedManagedClusterInner.extendedLocation = ExtendedLocation.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedManagedClusterInner.identity = ManagedClusterIdentity.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedManagedClusterInner.kind = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedManagedClusterInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterInner; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterProperties.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterProperties.java new file mode 100644 index 000000000000..aa5ee6b87bd3 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterProperties.java @@ -0,0 +1,1362 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerservice.generated.models.ClusterUpgradeSettings; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServiceLinuxProfile; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServiceNetworkProfile; +import com.azure.resourcemanager.containerservice.generated.models.KubernetesSupportPlan; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAADProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAIToolchainOperatorProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAddonProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAgentPoolProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterApiServerAccessProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAutoUpgradeProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAzureMonitorProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterBootstrapProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterHttpProxyConfig; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterIngressProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterMetricsProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterNodeProvisioningProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterNodeResourceGroupProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterOIDCIssuerProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterPodIdentityProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterPropertiesAutoScalerProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSecurityProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterServicePrincipalProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterStatus; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterStorageProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterWindowsProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterWorkloadAutoScalerProfile; +import com.azure.resourcemanager.containerservice.generated.models.PowerState; +import com.azure.resourcemanager.containerservice.generated.models.PublicNetworkAccess; +import com.azure.resourcemanager.containerservice.generated.models.ServiceMeshProfile; +import com.azure.resourcemanager.containerservice.generated.models.UserAssignedIdentity; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Properties of the managed cluster. + */ +@Fluent +public final class ManagedClusterProperties implements JsonSerializable { + /* + * The current provisioning state. + */ + private String provisioningState; + + /* + * The Power State of the cluster. + */ + private PowerState powerState; + + /* + * The max number of agent pools for the managed cluster. + */ + private Integer maxAgentPools; + + /* + * The version of Kubernetes specified by the user. Both patch version (e.g. 1.20.13) and + * (e.g. 1.20) are supported. When is specified, the latest supported GA patch version + * is chosen automatically. Updating the cluster with the same 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. + */ + private String kubernetesVersion; + + /* + * The version of Kubernetes the Managed Cluster is running. If kubernetesVersion was a fully specified version + * , this field will be exactly equal to it. If kubernetesVersion was , this field + * will contain the full version being used. + */ + private String currentKubernetesVersion; + + /* + * The DNS prefix of the Managed Cluster. This cannot be updated once the Managed Cluster has been created. + */ + private String dnsPrefix; + + /* + * The FQDN subdomain of the private cluster with custom private dns zone. This cannot be updated once the Managed + * Cluster has been created. + */ + private String fqdnSubdomain; + + /* + * The FQDN of the master pool. + */ + private String fqdn; + + /* + * The FQDN of private cluster. + */ + private String privateFQDN; + + /* + * The special FQDN used by the Azure Portal to access the Managed Cluster. This FQDN is for use only by the Azure + * Portal and should not be used by other clients. 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. + */ + private String azurePortalFQDN; + + /* + * The agent pool properties. + */ + private List agentPoolProfiles; + + /* + * The profile for Linux VMs in the Managed Cluster. + */ + private ContainerServiceLinuxProfile linuxProfile; + + /* + * The profile for Windows VMs in the Managed Cluster. + */ + private ManagedClusterWindowsProfile windowsProfile; + + /* + * Information about a service principal identity for the cluster to use for manipulating Azure APIs. + */ + private ManagedClusterServicePrincipalProfile servicePrincipalProfile; + + /* + * The profile of managed cluster add-on. + */ + private Map addonProfiles; + + /* + * The pod identity profile of the Managed Cluster. See [use AAD pod + * identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity) for more details on AAD pod identity + * integration. + */ + private ManagedClusterPodIdentityProfile podIdentityProfile; + + /* + * The OIDC issuer profile of the Managed Cluster. + */ + private ManagedClusterOIDCIssuerProfile oidcIssuerProfile; + + /* + * The name of the resource group containing agent pool nodes. + */ + private String nodeResourceGroup; + + /* + * Profile of the node resource group configuration. + */ + private ManagedClusterNodeResourceGroupProfile nodeResourceGroupProfile; + + /* + * Whether to enable Kubernetes Role-Based Access Control. + */ + private Boolean enableRBAC; + + /* + * The support plan for the Managed Cluster. If unspecified, the default is 'KubernetesOfficial'. + */ + private KubernetesSupportPlan supportPlan; + + /* + * The network configuration profile. + */ + private ContainerServiceNetworkProfile networkProfile; + + /* + * The Azure Active Directory configuration. + */ + private ManagedClusterAADProfile aadProfile; + + /* + * The auto upgrade configuration. + */ + private ManagedClusterAutoUpgradeProfile autoUpgradeProfile; + + /* + * Settings for upgrading a cluster. + */ + private ClusterUpgradeSettings upgradeSettings; + + /* + * Parameters to be applied to the cluster-autoscaler when enabled + */ + private ManagedClusterPropertiesAutoScalerProfile autoScalerProfile; + + /* + * The access profile for managed cluster API server. + */ + private ManagedClusterApiServerAccessProfile apiServerAccessProfile; + + /* + * The Resource ID of the disk encryption set to use for enabling encryption at rest. This is of the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/ + * diskEncryptionSets/{encryptionSetName}' + */ + private String diskEncryptionSetID; + + /* + * The user identity associated with the managed cluster. This identity will be used by the kubelet. Only one user + * assigned identity is allowed. The only accepted key is "kubeletidentity", with value of "resourceId": + * "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}". + */ + private Map identityProfile; + + /* + * Private link resources associated with the cluster. + */ + private List privateLinkResources; + + /* + * If local accounts should be disabled on the Managed 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). + */ + private Boolean disableLocalAccounts; + + /* + * Configurations for provisioning the cluster with HTTP proxy servers. + */ + private ManagedClusterHttpProxyConfig httpProxyConfig; + + /* + * Security profile for the managed cluster. + */ + private ManagedClusterSecurityProfile securityProfile; + + /* + * Storage profile for the managed cluster. + */ + private ManagedClusterStorageProfile storageProfile; + + /* + * Ingress profile for the managed cluster. + */ + private ManagedClusterIngressProfile ingressProfile; + + /* + * PublicNetworkAccess of the managedCluster. Allow or deny public network access for AKS + */ + private PublicNetworkAccess publicNetworkAccess; + + /* + * Workload Auto-scaler profile for the managed cluster. + */ + private ManagedClusterWorkloadAutoScalerProfile workloadAutoScalerProfile; + + /* + * Azure Monitor addon profiles for monitoring the managed cluster. + */ + private ManagedClusterAzureMonitorProfile azureMonitorProfile; + + /* + * Service mesh profile for a managed cluster. + */ + private ServiceMeshProfile serviceMeshProfile; + + /* + * The resourceUID uniquely identifies ManagedClusters that reuse ARM ResourceIds (i.e: create, delete, create + * sequence) + */ + private String resourceUID; + + /* + * Optional cluster metrics configuration. + */ + private ManagedClusterMetricsProfile metricsProfile; + + /* + * Node provisioning settings that apply to the whole cluster. + */ + private ManagedClusterNodeProvisioningProfile nodeProvisioningProfile; + + /* + * Profile of the cluster bootstrap configuration. + */ + private ManagedClusterBootstrapProfile bootstrapProfile; + + /* + * AI toolchain operator settings that apply to the whole cluster. + */ + private ManagedClusterAIToolchainOperatorProfile aiToolchainOperatorProfile; + + /* + * Contains read-only information about the Managed Cluster. + */ + private ManagedClusterStatus status; + + /** + * Creates an instance of ManagedClusterProperties class. + */ + public ManagedClusterProperties() { + } + + /** + * Get the provisioningState property: The current provisioning state. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the powerState property: The Power State of the cluster. + * + * @return the powerState value. + */ + public PowerState powerState() { + return this.powerState; + } + + /** + * Get the maxAgentPools property: The max number of agent pools for the managed cluster. + * + * @return the maxAgentPools value. + */ + public Integer maxAgentPools() { + return this.maxAgentPools; + } + + /** + * Get the kubernetesVersion property: The version of Kubernetes specified by the user. 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. + * + * @return the kubernetesVersion value. + */ + public String kubernetesVersion() { + return this.kubernetesVersion; + } + + /** + * Set the kubernetesVersion property: The version of Kubernetes specified by the user. 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. + * + * @param kubernetesVersion the kubernetesVersion value to set. + * @return the ManagedClusterProperties object itself. + */ + public ManagedClusterProperties withKubernetesVersion(String kubernetesVersion) { + this.kubernetesVersion = kubernetesVersion; + return this; + } + + /** + * Get the currentKubernetesVersion property: The version of Kubernetes the Managed Cluster is running. 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. + * + * @return the currentKubernetesVersion value. + */ + public String currentKubernetesVersion() { + return this.currentKubernetesVersion; + } + + /** + * Get the dnsPrefix property: The DNS prefix of the Managed Cluster. This cannot be updated once the Managed + * Cluster has been created. + * + * @return the dnsPrefix value. + */ + public String dnsPrefix() { + return this.dnsPrefix; + } + + /** + * Set the dnsPrefix property: The DNS prefix of the Managed Cluster. This cannot be updated once the Managed + * Cluster has been created. + * + * @param dnsPrefix the dnsPrefix value to set. + * @return the ManagedClusterProperties object itself. + */ + public ManagedClusterProperties withDnsPrefix(String dnsPrefix) { + this.dnsPrefix = dnsPrefix; + return this; + } + + /** + * Get the fqdnSubdomain property: The FQDN subdomain of the private cluster with custom private dns zone. This + * cannot be updated once the Managed Cluster has been created. + * + * @return the fqdnSubdomain value. + */ + public String fqdnSubdomain() { + return this.fqdnSubdomain; + } + + /** + * Set the fqdnSubdomain property: The FQDN subdomain of the private cluster with custom private dns zone. This + * cannot be updated once the Managed Cluster has been created. + * + * @param fqdnSubdomain the fqdnSubdomain value to set. + * @return the ManagedClusterProperties object itself. + */ + public ManagedClusterProperties withFqdnSubdomain(String fqdnSubdomain) { + this.fqdnSubdomain = fqdnSubdomain; + return this; + } + + /** + * Get the fqdn property: The FQDN of the master pool. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Get the privateFQDN property: The FQDN of private cluster. + * + * @return the privateFQDN value. + */ + public String privateFQDN() { + return this.privateFQDN; + } + + /** + * Get the azurePortalFQDN property: The special FQDN used by the Azure Portal to access the Managed Cluster. This + * FQDN is for use only by the Azure Portal and should not be used by other clients. 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. + * + * @return the azurePortalFQDN value. + */ + public String azurePortalFQDN() { + return this.azurePortalFQDN; + } + + /** + * Get the agentPoolProfiles property: The agent pool properties. + * + * @return the agentPoolProfiles value. + */ + public List agentPoolProfiles() { + return this.agentPoolProfiles; + } + + /** + * Set the agentPoolProfiles property: The agent pool properties. + * + * @param agentPoolProfiles the agentPoolProfiles value to set. + * @return the ManagedClusterProperties object itself. + */ + public ManagedClusterProperties withAgentPoolProfiles(List agentPoolProfiles) { + this.agentPoolProfiles = agentPoolProfiles; + return this; + } + + /** + * Get the linuxProfile property: The profile for Linux VMs in the Managed Cluster. + * + * @return the linuxProfile value. + */ + public ContainerServiceLinuxProfile linuxProfile() { + return this.linuxProfile; + } + + /** + * Set the linuxProfile property: The profile for Linux VMs in the Managed Cluster. + * + * @param linuxProfile the linuxProfile value to set. + * @return the ManagedClusterProperties object itself. + */ + public ManagedClusterProperties withLinuxProfile(ContainerServiceLinuxProfile linuxProfile) { + this.linuxProfile = linuxProfile; + return this; + } + + /** + * Get the windowsProfile property: The profile for Windows VMs in the Managed Cluster. + * + * @return the windowsProfile value. + */ + public ManagedClusterWindowsProfile windowsProfile() { + return this.windowsProfile; + } + + /** + * Set the windowsProfile property: The profile for Windows VMs in the Managed Cluster. + * + * @param windowsProfile the windowsProfile value to set. + * @return the ManagedClusterProperties object itself. + */ + public ManagedClusterProperties withWindowsProfile(ManagedClusterWindowsProfile windowsProfile) { + this.windowsProfile = windowsProfile; + return this; + } + + /** + * Get the servicePrincipalProfile property: Information about a service principal identity for the cluster to use + * for manipulating Azure APIs. + * + * @return the servicePrincipalProfile value. + */ + public ManagedClusterServicePrincipalProfile servicePrincipalProfile() { + return this.servicePrincipalProfile; + } + + /** + * Set the servicePrincipalProfile property: Information about a service principal identity for the cluster to use + * for manipulating Azure APIs. + * + * @param servicePrincipalProfile the servicePrincipalProfile value to set. + * @return the ManagedClusterProperties object itself. + */ + public ManagedClusterProperties + withServicePrincipalProfile(ManagedClusterServicePrincipalProfile servicePrincipalProfile) { + this.servicePrincipalProfile = servicePrincipalProfile; + return this; + } + + /** + * Get the addonProfiles property: The profile of managed cluster add-on. + * + * @return the addonProfiles value. + */ + public Map addonProfiles() { + return this.addonProfiles; + } + + /** + * Set the addonProfiles property: The profile of managed cluster add-on. + * + * @param addonProfiles the addonProfiles value to set. + * @return the ManagedClusterProperties object itself. + */ + public ManagedClusterProperties withAddonProfiles(Map addonProfiles) { + this.addonProfiles = addonProfiles; + return this; + } + + /** + * Get the podIdentityProfile property: The pod identity profile of the Managed Cluster. See [use AAD pod + * identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity) for more details on AAD pod identity + * integration. + * + * @return the podIdentityProfile value. + */ + public ManagedClusterPodIdentityProfile podIdentityProfile() { + return this.podIdentityProfile; + } + + /** + * Set the podIdentityProfile property: The pod identity profile of the Managed Cluster. See [use AAD pod + * identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity) for more details on AAD pod identity + * integration. + * + * @param podIdentityProfile the podIdentityProfile value to set. + * @return the ManagedClusterProperties object itself. + */ + public ManagedClusterProperties withPodIdentityProfile(ManagedClusterPodIdentityProfile podIdentityProfile) { + this.podIdentityProfile = podIdentityProfile; + return this; + } + + /** + * Get the oidcIssuerProfile property: The OIDC issuer profile of the Managed Cluster. + * + * @return the oidcIssuerProfile value. + */ + public ManagedClusterOIDCIssuerProfile oidcIssuerProfile() { + return this.oidcIssuerProfile; + } + + /** + * Set the oidcIssuerProfile property: The OIDC issuer profile of the Managed Cluster. + * + * @param oidcIssuerProfile the oidcIssuerProfile value to set. + * @return the ManagedClusterProperties object itself. + */ + public ManagedClusterProperties withOidcIssuerProfile(ManagedClusterOIDCIssuerProfile oidcIssuerProfile) { + this.oidcIssuerProfile = oidcIssuerProfile; + return this; + } + + /** + * Get the nodeResourceGroup property: The name of the resource group containing agent pool nodes. + * + * @return the nodeResourceGroup value. + */ + public String nodeResourceGroup() { + return this.nodeResourceGroup; + } + + /** + * Set the nodeResourceGroup property: The name of the resource group containing agent pool nodes. + * + * @param nodeResourceGroup the nodeResourceGroup value to set. + * @return the ManagedClusterProperties object itself. + */ + public ManagedClusterProperties withNodeResourceGroup(String nodeResourceGroup) { + this.nodeResourceGroup = nodeResourceGroup; + return this; + } + + /** + * Get the nodeResourceGroupProfile property: Profile of the node resource group configuration. + * + * @return the nodeResourceGroupProfile value. + */ + public ManagedClusterNodeResourceGroupProfile nodeResourceGroupProfile() { + return this.nodeResourceGroupProfile; + } + + /** + * Set the nodeResourceGroupProfile property: Profile of the node resource group configuration. + * + * @param nodeResourceGroupProfile the nodeResourceGroupProfile value to set. + * @return the ManagedClusterProperties object itself. + */ + public ManagedClusterProperties + withNodeResourceGroupProfile(ManagedClusterNodeResourceGroupProfile nodeResourceGroupProfile) { + this.nodeResourceGroupProfile = nodeResourceGroupProfile; + return this; + } + + /** + * Get the enableRBAC property: Whether to enable Kubernetes Role-Based Access Control. + * + * @return the enableRBAC value. + */ + public Boolean enableRBAC() { + return this.enableRBAC; + } + + /** + * Set the enableRBAC property: Whether to enable Kubernetes Role-Based Access Control. + * + * @param enableRBAC the enableRBAC value to set. + * @return the ManagedClusterProperties object itself. + */ + public ManagedClusterProperties withEnableRBAC(Boolean enableRBAC) { + this.enableRBAC = enableRBAC; + return this; + } + + /** + * Get the supportPlan property: The support plan for the Managed Cluster. If unspecified, the default is + * 'KubernetesOfficial'. + * + * @return the supportPlan value. + */ + public KubernetesSupportPlan supportPlan() { + return this.supportPlan; + } + + /** + * Set the supportPlan property: The support plan for the Managed Cluster. If unspecified, the default is + * 'KubernetesOfficial'. + * + * @param supportPlan the supportPlan value to set. + * @return the ManagedClusterProperties object itself. + */ + public ManagedClusterProperties withSupportPlan(KubernetesSupportPlan supportPlan) { + this.supportPlan = supportPlan; + return this; + } + + /** + * Get the networkProfile property: The network configuration profile. + * + * @return the networkProfile value. + */ + public ContainerServiceNetworkProfile networkProfile() { + return this.networkProfile; + } + + /** + * Set the networkProfile property: The network configuration profile. + * + * @param networkProfile the networkProfile value to set. + * @return the ManagedClusterProperties object itself. + */ + public ManagedClusterProperties withNetworkProfile(ContainerServiceNetworkProfile networkProfile) { + this.networkProfile = networkProfile; + return this; + } + + /** + * Get the aadProfile property: The Azure Active Directory configuration. + * + * @return the aadProfile value. + */ + public ManagedClusterAADProfile aadProfile() { + return this.aadProfile; + } + + /** + * Set the aadProfile property: The Azure Active Directory configuration. + * + * @param aadProfile the aadProfile value to set. + * @return the ManagedClusterProperties object itself. + */ + public ManagedClusterProperties withAadProfile(ManagedClusterAADProfile aadProfile) { + this.aadProfile = aadProfile; + return this; + } + + /** + * Get the autoUpgradeProfile property: The auto upgrade configuration. + * + * @return the autoUpgradeProfile value. + */ + public ManagedClusterAutoUpgradeProfile autoUpgradeProfile() { + return this.autoUpgradeProfile; + } + + /** + * Set the autoUpgradeProfile property: The auto upgrade configuration. + * + * @param autoUpgradeProfile the autoUpgradeProfile value to set. + * @return the ManagedClusterProperties object itself. + */ + public ManagedClusterProperties withAutoUpgradeProfile(ManagedClusterAutoUpgradeProfile autoUpgradeProfile) { + this.autoUpgradeProfile = autoUpgradeProfile; + return this; + } + + /** + * Get the upgradeSettings property: Settings for upgrading a cluster. + * + * @return the upgradeSettings value. + */ + public ClusterUpgradeSettings upgradeSettings() { + return this.upgradeSettings; + } + + /** + * Set the upgradeSettings property: Settings for upgrading a cluster. + * + * @param upgradeSettings the upgradeSettings value to set. + * @return the ManagedClusterProperties object itself. + */ + public ManagedClusterProperties withUpgradeSettings(ClusterUpgradeSettings upgradeSettings) { + this.upgradeSettings = upgradeSettings; + return this; + } + + /** + * Get the autoScalerProfile property: Parameters to be applied to the cluster-autoscaler when enabled. + * + * @return the autoScalerProfile value. + */ + public ManagedClusterPropertiesAutoScalerProfile autoScalerProfile() { + return this.autoScalerProfile; + } + + /** + * Set the autoScalerProfile property: Parameters to be applied to the cluster-autoscaler when enabled. + * + * @param autoScalerProfile the autoScalerProfile value to set. + * @return the ManagedClusterProperties object itself. + */ + public ManagedClusterProperties withAutoScalerProfile(ManagedClusterPropertiesAutoScalerProfile autoScalerProfile) { + this.autoScalerProfile = autoScalerProfile; + return this; + } + + /** + * Get the apiServerAccessProfile property: The access profile for managed cluster API server. + * + * @return the apiServerAccessProfile value. + */ + public ManagedClusterApiServerAccessProfile apiServerAccessProfile() { + return this.apiServerAccessProfile; + } + + /** + * Set the apiServerAccessProfile property: The access profile for managed cluster API server. + * + * @param apiServerAccessProfile the apiServerAccessProfile value to set. + * @return the ManagedClusterProperties object itself. + */ + public ManagedClusterProperties + withApiServerAccessProfile(ManagedClusterApiServerAccessProfile apiServerAccessProfile) { + this.apiServerAccessProfile = apiServerAccessProfile; + return this; + } + + /** + * Get the diskEncryptionSetID property: The Resource ID of the disk encryption set to use for enabling encryption + * at rest. This is of the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. + * + * @return the diskEncryptionSetID value. + */ + public String diskEncryptionSetID() { + return this.diskEncryptionSetID; + } + + /** + * Set the diskEncryptionSetID property: The Resource ID of the disk encryption set to use for enabling encryption + * at rest. This is of the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. + * + * @param diskEncryptionSetID the diskEncryptionSetID value to set. + * @return the ManagedClusterProperties object itself. + */ + public ManagedClusterProperties withDiskEncryptionSetID(String diskEncryptionSetID) { + this.diskEncryptionSetID = diskEncryptionSetID; + return this; + } + + /** + * Get the identityProfile property: The user identity associated with the managed cluster. This identity will be + * used by the kubelet. Only one user assigned identity is allowed. The only accepted key is "kubeletidentity", with + * value of "resourceId": + * "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}". + * + * @return the identityProfile value. + */ + public Map identityProfile() { + return this.identityProfile; + } + + /** + * Set the identityProfile property: The user identity associated with the managed cluster. This identity will be + * used by the kubelet. Only one user assigned identity is allowed. The only accepted key is "kubeletidentity", with + * value of "resourceId": + * "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}". + * + * @param identityProfile the identityProfile value to set. + * @return the ManagedClusterProperties object itself. + */ + public ManagedClusterProperties withIdentityProfile(Map identityProfile) { + this.identityProfile = identityProfile; + return this; + } + + /** + * Get the privateLinkResources property: Private link resources associated with the cluster. + * + * @return the privateLinkResources value. + */ + public List privateLinkResources() { + return this.privateLinkResources; + } + + /** + * Set the privateLinkResources property: Private link resources associated with the cluster. + * + * @param privateLinkResources the privateLinkResources value to set. + * @return the ManagedClusterProperties object itself. + */ + public ManagedClusterProperties withPrivateLinkResources(List privateLinkResources) { + this.privateLinkResources = privateLinkResources; + return this; + } + + /** + * Get the disableLocalAccounts property: If local accounts should be disabled on the Managed 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). + * + * @return the disableLocalAccounts value. + */ + public Boolean disableLocalAccounts() { + return this.disableLocalAccounts; + } + + /** + * Set the disableLocalAccounts property: If local accounts should be disabled on the Managed 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). + * + * @param disableLocalAccounts the disableLocalAccounts value to set. + * @return the ManagedClusterProperties object itself. + */ + public ManagedClusterProperties withDisableLocalAccounts(Boolean disableLocalAccounts) { + this.disableLocalAccounts = disableLocalAccounts; + return this; + } + + /** + * Get the httpProxyConfig property: Configurations for provisioning the cluster with HTTP proxy servers. + * + * @return the httpProxyConfig value. + */ + public ManagedClusterHttpProxyConfig httpProxyConfig() { + return this.httpProxyConfig; + } + + /** + * Set the httpProxyConfig property: Configurations for provisioning the cluster with HTTP proxy servers. + * + * @param httpProxyConfig the httpProxyConfig value to set. + * @return the ManagedClusterProperties object itself. + */ + public ManagedClusterProperties withHttpProxyConfig(ManagedClusterHttpProxyConfig httpProxyConfig) { + this.httpProxyConfig = httpProxyConfig; + return this; + } + + /** + * Get the securityProfile property: Security profile for the managed cluster. + * + * @return the securityProfile value. + */ + public ManagedClusterSecurityProfile securityProfile() { + return this.securityProfile; + } + + /** + * Set the securityProfile property: Security profile for the managed cluster. + * + * @param securityProfile the securityProfile value to set. + * @return the ManagedClusterProperties object itself. + */ + public ManagedClusterProperties withSecurityProfile(ManagedClusterSecurityProfile securityProfile) { + this.securityProfile = securityProfile; + return this; + } + + /** + * Get the storageProfile property: Storage profile for the managed cluster. + * + * @return the storageProfile value. + */ + public ManagedClusterStorageProfile storageProfile() { + return this.storageProfile; + } + + /** + * Set the storageProfile property: Storage profile for the managed cluster. + * + * @param storageProfile the storageProfile value to set. + * @return the ManagedClusterProperties object itself. + */ + public ManagedClusterProperties withStorageProfile(ManagedClusterStorageProfile storageProfile) { + this.storageProfile = storageProfile; + return this; + } + + /** + * Get the ingressProfile property: Ingress profile for the managed cluster. + * + * @return the ingressProfile value. + */ + public ManagedClusterIngressProfile ingressProfile() { + return this.ingressProfile; + } + + /** + * Set the ingressProfile property: Ingress profile for the managed cluster. + * + * @param ingressProfile the ingressProfile value to set. + * @return the ManagedClusterProperties object itself. + */ + public ManagedClusterProperties withIngressProfile(ManagedClusterIngressProfile ingressProfile) { + this.ingressProfile = ingressProfile; + return this; + } + + /** + * Get the publicNetworkAccess property: PublicNetworkAccess of the managedCluster. Allow or deny public network + * access for AKS. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: PublicNetworkAccess of the managedCluster. Allow or deny public network + * access for AKS. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the ManagedClusterProperties object itself. + */ + public ManagedClusterProperties withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Get the workloadAutoScalerProfile property: Workload Auto-scaler profile for the managed cluster. + * + * @return the workloadAutoScalerProfile value. + */ + public ManagedClusterWorkloadAutoScalerProfile workloadAutoScalerProfile() { + return this.workloadAutoScalerProfile; + } + + /** + * Set the workloadAutoScalerProfile property: Workload Auto-scaler profile for the managed cluster. + * + * @param workloadAutoScalerProfile the workloadAutoScalerProfile value to set. + * @return the ManagedClusterProperties object itself. + */ + public ManagedClusterProperties + withWorkloadAutoScalerProfile(ManagedClusterWorkloadAutoScalerProfile workloadAutoScalerProfile) { + this.workloadAutoScalerProfile = workloadAutoScalerProfile; + return this; + } + + /** + * Get the azureMonitorProfile property: Azure Monitor addon profiles for monitoring the managed cluster. + * + * @return the azureMonitorProfile value. + */ + public ManagedClusterAzureMonitorProfile azureMonitorProfile() { + return this.azureMonitorProfile; + } + + /** + * Set the azureMonitorProfile property: Azure Monitor addon profiles for monitoring the managed cluster. + * + * @param azureMonitorProfile the azureMonitorProfile value to set. + * @return the ManagedClusterProperties object itself. + */ + public ManagedClusterProperties withAzureMonitorProfile(ManagedClusterAzureMonitorProfile azureMonitorProfile) { + this.azureMonitorProfile = azureMonitorProfile; + return this; + } + + /** + * Get the serviceMeshProfile property: Service mesh profile for a managed cluster. + * + * @return the serviceMeshProfile value. + */ + public ServiceMeshProfile serviceMeshProfile() { + return this.serviceMeshProfile; + } + + /** + * Set the serviceMeshProfile property: Service mesh profile for a managed cluster. + * + * @param serviceMeshProfile the serviceMeshProfile value to set. + * @return the ManagedClusterProperties object itself. + */ + public ManagedClusterProperties withServiceMeshProfile(ServiceMeshProfile serviceMeshProfile) { + this.serviceMeshProfile = serviceMeshProfile; + return this; + } + + /** + * Get the resourceUID property: The resourceUID uniquely identifies ManagedClusters that reuse ARM ResourceIds + * (i.e: create, delete, create sequence). + * + * @return the resourceUID value. + */ + public String resourceUID() { + return this.resourceUID; + } + + /** + * Get the metricsProfile property: Optional cluster metrics configuration. + * + * @return the metricsProfile value. + */ + public ManagedClusterMetricsProfile metricsProfile() { + return this.metricsProfile; + } + + /** + * Set the metricsProfile property: Optional cluster metrics configuration. + * + * @param metricsProfile the metricsProfile value to set. + * @return the ManagedClusterProperties object itself. + */ + public ManagedClusterProperties withMetricsProfile(ManagedClusterMetricsProfile metricsProfile) { + this.metricsProfile = metricsProfile; + return this; + } + + /** + * Get the nodeProvisioningProfile property: Node provisioning settings that apply to the whole cluster. + * + * @return the nodeProvisioningProfile value. + */ + public ManagedClusterNodeProvisioningProfile nodeProvisioningProfile() { + return this.nodeProvisioningProfile; + } + + /** + * Set the nodeProvisioningProfile property: Node provisioning settings that apply to the whole cluster. + * + * @param nodeProvisioningProfile the nodeProvisioningProfile value to set. + * @return the ManagedClusterProperties object itself. + */ + public ManagedClusterProperties + withNodeProvisioningProfile(ManagedClusterNodeProvisioningProfile nodeProvisioningProfile) { + this.nodeProvisioningProfile = nodeProvisioningProfile; + return this; + } + + /** + * Get the bootstrapProfile property: Profile of the cluster bootstrap configuration. + * + * @return the bootstrapProfile value. + */ + public ManagedClusterBootstrapProfile bootstrapProfile() { + return this.bootstrapProfile; + } + + /** + * Set the bootstrapProfile property: Profile of the cluster bootstrap configuration. + * + * @param bootstrapProfile the bootstrapProfile value to set. + * @return the ManagedClusterProperties object itself. + */ + public ManagedClusterProperties withBootstrapProfile(ManagedClusterBootstrapProfile bootstrapProfile) { + this.bootstrapProfile = bootstrapProfile; + return this; + } + + /** + * Get the aiToolchainOperatorProfile property: AI toolchain operator settings that apply to the whole cluster. + * + * @return the aiToolchainOperatorProfile value. + */ + public ManagedClusterAIToolchainOperatorProfile aiToolchainOperatorProfile() { + return this.aiToolchainOperatorProfile; + } + + /** + * Set the aiToolchainOperatorProfile property: AI toolchain operator settings that apply to the whole cluster. + * + * @param aiToolchainOperatorProfile the aiToolchainOperatorProfile value to set. + * @return the ManagedClusterProperties object itself. + */ + public ManagedClusterProperties + withAiToolchainOperatorProfile(ManagedClusterAIToolchainOperatorProfile aiToolchainOperatorProfile) { + this.aiToolchainOperatorProfile = aiToolchainOperatorProfile; + return this; + } + + /** + * Get the status property: Contains read-only information about the Managed Cluster. + * + * @return the status value. + */ + public ManagedClusterStatus status() { + return this.status; + } + + /** + * Set the status property: Contains read-only information about the Managed Cluster. + * + * @param status the status value to set. + * @return the ManagedClusterProperties object itself. + */ + public ManagedClusterProperties withStatus(ManagedClusterStatus status) { + this.status = status; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kubernetesVersion", this.kubernetesVersion); + jsonWriter.writeStringField("dnsPrefix", this.dnsPrefix); + jsonWriter.writeStringField("fqdnSubdomain", this.fqdnSubdomain); + jsonWriter.writeArrayField("agentPoolProfiles", this.agentPoolProfiles, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("linuxProfile", this.linuxProfile); + jsonWriter.writeJsonField("windowsProfile", this.windowsProfile); + jsonWriter.writeJsonField("servicePrincipalProfile", this.servicePrincipalProfile); + jsonWriter.writeMapField("addonProfiles", this.addonProfiles, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("podIdentityProfile", this.podIdentityProfile); + jsonWriter.writeJsonField("oidcIssuerProfile", this.oidcIssuerProfile); + jsonWriter.writeStringField("nodeResourceGroup", this.nodeResourceGroup); + jsonWriter.writeJsonField("nodeResourceGroupProfile", this.nodeResourceGroupProfile); + jsonWriter.writeBooleanField("enableRBAC", this.enableRBAC); + jsonWriter.writeStringField("supportPlan", this.supportPlan == null ? null : this.supportPlan.toString()); + jsonWriter.writeJsonField("networkProfile", this.networkProfile); + jsonWriter.writeJsonField("aadProfile", this.aadProfile); + jsonWriter.writeJsonField("autoUpgradeProfile", this.autoUpgradeProfile); + jsonWriter.writeJsonField("upgradeSettings", this.upgradeSettings); + jsonWriter.writeJsonField("autoScalerProfile", this.autoScalerProfile); + jsonWriter.writeJsonField("apiServerAccessProfile", this.apiServerAccessProfile); + jsonWriter.writeStringField("diskEncryptionSetID", this.diskEncryptionSetID); + jsonWriter.writeMapField("identityProfile", this.identityProfile, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("privateLinkResources", this.privateLinkResources, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("disableLocalAccounts", this.disableLocalAccounts); + jsonWriter.writeJsonField("httpProxyConfig", this.httpProxyConfig); + jsonWriter.writeJsonField("securityProfile", this.securityProfile); + jsonWriter.writeJsonField("storageProfile", this.storageProfile); + jsonWriter.writeJsonField("ingressProfile", this.ingressProfile); + jsonWriter.writeStringField("publicNetworkAccess", + this.publicNetworkAccess == null ? null : this.publicNetworkAccess.toString()); + jsonWriter.writeJsonField("workloadAutoScalerProfile", this.workloadAutoScalerProfile); + jsonWriter.writeJsonField("azureMonitorProfile", this.azureMonitorProfile); + jsonWriter.writeJsonField("serviceMeshProfile", this.serviceMeshProfile); + jsonWriter.writeJsonField("metricsProfile", this.metricsProfile); + jsonWriter.writeJsonField("nodeProvisioningProfile", this.nodeProvisioningProfile); + jsonWriter.writeJsonField("bootstrapProfile", this.bootstrapProfile); + jsonWriter.writeJsonField("aiToolchainOperatorProfile", this.aiToolchainOperatorProfile); + jsonWriter.writeJsonField("status", this.status); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedClusterProperties. + */ + public static ManagedClusterProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterProperties deserializedManagedClusterProperties = new ManagedClusterProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedManagedClusterProperties.provisioningState = reader.getString(); + } else if ("powerState".equals(fieldName)) { + deserializedManagedClusterProperties.powerState = PowerState.fromJson(reader); + } else if ("maxAgentPools".equals(fieldName)) { + deserializedManagedClusterProperties.maxAgentPools = reader.getNullable(JsonReader::getInt); + } else if ("kubernetesVersion".equals(fieldName)) { + deserializedManagedClusterProperties.kubernetesVersion = reader.getString(); + } else if ("currentKubernetesVersion".equals(fieldName)) { + deserializedManagedClusterProperties.currentKubernetesVersion = reader.getString(); + } else if ("dnsPrefix".equals(fieldName)) { + deserializedManagedClusterProperties.dnsPrefix = reader.getString(); + } else if ("fqdnSubdomain".equals(fieldName)) { + deserializedManagedClusterProperties.fqdnSubdomain = reader.getString(); + } else if ("fqdn".equals(fieldName)) { + deserializedManagedClusterProperties.fqdn = reader.getString(); + } else if ("privateFQDN".equals(fieldName)) { + deserializedManagedClusterProperties.privateFQDN = reader.getString(); + } else if ("azurePortalFQDN".equals(fieldName)) { + deserializedManagedClusterProperties.azurePortalFQDN = reader.getString(); + } else if ("agentPoolProfiles".equals(fieldName)) { + List agentPoolProfiles + = reader.readArray(reader1 -> ManagedClusterAgentPoolProfile.fromJson(reader1)); + deserializedManagedClusterProperties.agentPoolProfiles = agentPoolProfiles; + } else if ("linuxProfile".equals(fieldName)) { + deserializedManagedClusterProperties.linuxProfile = ContainerServiceLinuxProfile.fromJson(reader); + } else if ("windowsProfile".equals(fieldName)) { + deserializedManagedClusterProperties.windowsProfile = ManagedClusterWindowsProfile.fromJson(reader); + } else if ("servicePrincipalProfile".equals(fieldName)) { + deserializedManagedClusterProperties.servicePrincipalProfile + = ManagedClusterServicePrincipalProfile.fromJson(reader); + } else if ("addonProfiles".equals(fieldName)) { + Map addonProfiles + = reader.readMap(reader1 -> ManagedClusterAddonProfile.fromJson(reader1)); + deserializedManagedClusterProperties.addonProfiles = addonProfiles; + } else if ("podIdentityProfile".equals(fieldName)) { + deserializedManagedClusterProperties.podIdentityProfile + = ManagedClusterPodIdentityProfile.fromJson(reader); + } else if ("oidcIssuerProfile".equals(fieldName)) { + deserializedManagedClusterProperties.oidcIssuerProfile + = ManagedClusterOIDCIssuerProfile.fromJson(reader); + } else if ("nodeResourceGroup".equals(fieldName)) { + deserializedManagedClusterProperties.nodeResourceGroup = reader.getString(); + } else if ("nodeResourceGroupProfile".equals(fieldName)) { + deserializedManagedClusterProperties.nodeResourceGroupProfile + = ManagedClusterNodeResourceGroupProfile.fromJson(reader); + } else if ("enableRBAC".equals(fieldName)) { + deserializedManagedClusterProperties.enableRBAC = reader.getNullable(JsonReader::getBoolean); + } else if ("supportPlan".equals(fieldName)) { + deserializedManagedClusterProperties.supportPlan + = KubernetesSupportPlan.fromString(reader.getString()); + } else if ("networkProfile".equals(fieldName)) { + deserializedManagedClusterProperties.networkProfile + = ContainerServiceNetworkProfile.fromJson(reader); + } else if ("aadProfile".equals(fieldName)) { + deserializedManagedClusterProperties.aadProfile = ManagedClusterAADProfile.fromJson(reader); + } else if ("autoUpgradeProfile".equals(fieldName)) { + deserializedManagedClusterProperties.autoUpgradeProfile + = ManagedClusterAutoUpgradeProfile.fromJson(reader); + } else if ("upgradeSettings".equals(fieldName)) { + deserializedManagedClusterProperties.upgradeSettings = ClusterUpgradeSettings.fromJson(reader); + } else if ("autoScalerProfile".equals(fieldName)) { + deserializedManagedClusterProperties.autoScalerProfile + = ManagedClusterPropertiesAutoScalerProfile.fromJson(reader); + } else if ("apiServerAccessProfile".equals(fieldName)) { + deserializedManagedClusterProperties.apiServerAccessProfile + = ManagedClusterApiServerAccessProfile.fromJson(reader); + } else if ("diskEncryptionSetID".equals(fieldName)) { + deserializedManagedClusterProperties.diskEncryptionSetID = reader.getString(); + } else if ("identityProfile".equals(fieldName)) { + Map identityProfile + = reader.readMap(reader1 -> UserAssignedIdentity.fromJson(reader1)); + deserializedManagedClusterProperties.identityProfile = identityProfile; + } else if ("privateLinkResources".equals(fieldName)) { + List privateLinkResources + = reader.readArray(reader1 -> PrivateLinkResourceInner.fromJson(reader1)); + deserializedManagedClusterProperties.privateLinkResources = privateLinkResources; + } else if ("disableLocalAccounts".equals(fieldName)) { + deserializedManagedClusterProperties.disableLocalAccounts + = reader.getNullable(JsonReader::getBoolean); + } else if ("httpProxyConfig".equals(fieldName)) { + deserializedManagedClusterProperties.httpProxyConfig + = ManagedClusterHttpProxyConfig.fromJson(reader); + } else if ("securityProfile".equals(fieldName)) { + deserializedManagedClusterProperties.securityProfile + = ManagedClusterSecurityProfile.fromJson(reader); + } else if ("storageProfile".equals(fieldName)) { + deserializedManagedClusterProperties.storageProfile = ManagedClusterStorageProfile.fromJson(reader); + } else if ("ingressProfile".equals(fieldName)) { + deserializedManagedClusterProperties.ingressProfile = ManagedClusterIngressProfile.fromJson(reader); + } else if ("publicNetworkAccess".equals(fieldName)) { + deserializedManagedClusterProperties.publicNetworkAccess + = PublicNetworkAccess.fromString(reader.getString()); + } else if ("workloadAutoScalerProfile".equals(fieldName)) { + deserializedManagedClusterProperties.workloadAutoScalerProfile + = ManagedClusterWorkloadAutoScalerProfile.fromJson(reader); + } else if ("azureMonitorProfile".equals(fieldName)) { + deserializedManagedClusterProperties.azureMonitorProfile + = ManagedClusterAzureMonitorProfile.fromJson(reader); + } else if ("serviceMeshProfile".equals(fieldName)) { + deserializedManagedClusterProperties.serviceMeshProfile = ServiceMeshProfile.fromJson(reader); + } else if ("resourceUID".equals(fieldName)) { + deserializedManagedClusterProperties.resourceUID = reader.getString(); + } else if ("metricsProfile".equals(fieldName)) { + deserializedManagedClusterProperties.metricsProfile = ManagedClusterMetricsProfile.fromJson(reader); + } else if ("nodeProvisioningProfile".equals(fieldName)) { + deserializedManagedClusterProperties.nodeProvisioningProfile + = ManagedClusterNodeProvisioningProfile.fromJson(reader); + } else if ("bootstrapProfile".equals(fieldName)) { + deserializedManagedClusterProperties.bootstrapProfile + = ManagedClusterBootstrapProfile.fromJson(reader); + } else if ("aiToolchainOperatorProfile".equals(fieldName)) { + deserializedManagedClusterProperties.aiToolchainOperatorProfile + = ManagedClusterAIToolchainOperatorProfile.fromJson(reader); + } else if ("status".equals(fieldName)) { + deserializedManagedClusterProperties.status = ManagedClusterStatus.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterProperties; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterUpgradeProfileInner.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterUpgradeProfileInner.java new file mode 100644 index 000000000000..c7b8992509ab --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterUpgradeProfileInner.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterPoolUpgradeProfile; +import java.io.IOException; +import java.util.List; + +/** + * The list of available upgrades for compute pools. + */ +@Immutable +public final class ManagedClusterUpgradeProfileInner extends ProxyResource { + /* + * The properties of the upgrade profile. + */ + private ManagedClusterUpgradeProfileProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ManagedClusterUpgradeProfileInner class. + */ + private ManagedClusterUpgradeProfileInner() { + } + + /** + * Get the innerProperties property: The properties of the upgrade profile. + * + * @return the innerProperties value. + */ + private ManagedClusterUpgradeProfileProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the controlPlaneProfile property: The list of available upgrade versions for the control plane. + * + * @return the controlPlaneProfile value. + */ + public ManagedClusterPoolUpgradeProfile controlPlaneProfile() { + return this.innerProperties() == null ? null : this.innerProperties().controlPlaneProfile(); + } + + /** + * Get the agentPoolProfiles property: The list of available upgrade versions for agent pools. + * + * @return the agentPoolProfiles value. + */ + public List agentPoolProfiles() { + return this.innerProperties() == null ? null : this.innerProperties().agentPoolProfiles(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterUpgradeProfileInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterUpgradeProfileInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ManagedClusterUpgradeProfileInner. + */ + public static ManagedClusterUpgradeProfileInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterUpgradeProfileInner deserializedManagedClusterUpgradeProfileInner + = new ManagedClusterUpgradeProfileInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedManagedClusterUpgradeProfileInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedManagedClusterUpgradeProfileInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedManagedClusterUpgradeProfileInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedManagedClusterUpgradeProfileInner.innerProperties + = ManagedClusterUpgradeProfileProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedManagedClusterUpgradeProfileInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterUpgradeProfileInner; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterUpgradeProfileProperties.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterUpgradeProfileProperties.java new file mode 100644 index 000000000000..8b6a932b4496 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterUpgradeProfileProperties.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterPoolUpgradeProfile; +import java.io.IOException; +import java.util.List; + +/** + * Control plane and agent pool upgrade profiles. + */ +@Immutable +public final class ManagedClusterUpgradeProfileProperties + implements JsonSerializable { + /* + * The list of available upgrade versions for the control plane. + */ + private ManagedClusterPoolUpgradeProfile controlPlaneProfile; + + /* + * The list of available upgrade versions for agent pools. + */ + private List agentPoolProfiles; + + /** + * Creates an instance of ManagedClusterUpgradeProfileProperties class. + */ + private ManagedClusterUpgradeProfileProperties() { + } + + /** + * Get the controlPlaneProfile property: The list of available upgrade versions for the control plane. + * + * @return the controlPlaneProfile value. + */ + public ManagedClusterPoolUpgradeProfile controlPlaneProfile() { + return this.controlPlaneProfile; + } + + /** + * Get the agentPoolProfiles property: The list of available upgrade versions for agent pools. + * + * @return the agentPoolProfiles value. + */ + public List agentPoolProfiles() { + return this.agentPoolProfiles; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("controlPlaneProfile", this.controlPlaneProfile); + jsonWriter.writeArrayField("agentPoolProfiles", this.agentPoolProfiles, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterUpgradeProfileProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterUpgradeProfileProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ManagedClusterUpgradeProfileProperties. + */ + public static ManagedClusterUpgradeProfileProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterUpgradeProfileProperties deserializedManagedClusterUpgradeProfileProperties + = new ManagedClusterUpgradeProfileProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("controlPlaneProfile".equals(fieldName)) { + deserializedManagedClusterUpgradeProfileProperties.controlPlaneProfile + = ManagedClusterPoolUpgradeProfile.fromJson(reader); + } else if ("agentPoolProfiles".equals(fieldName)) { + List agentPoolProfiles + = reader.readArray(reader1 -> ManagedClusterPoolUpgradeProfile.fromJson(reader1)); + deserializedManagedClusterUpgradeProfileProperties.agentPoolProfiles = agentPoolProfiles; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterUpgradeProfileProperties; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedNamespaceInner.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedNamespaceInner.java new file mode 100644 index 000000000000..3b0bc514caf6 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedNamespaceInner.java @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerservice.generated.models.NamespaceProperties; +import java.io.IOException; +import java.util.Map; + +/** + * Namespace managed by ARM. + */ +@Fluent +public final class ManagedNamespaceInner extends ProxyResource { + /* + * Properties of a namespace. + */ + private NamespaceProperties properties; + + /* + * Resource tags. + */ + private Map tags; + + /* + * The geo-location where the resource lives + */ + private String 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. + */ + private String eTag; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ManagedNamespaceInner class. + */ + public ManagedNamespaceInner() { + } + + /** + * Get the properties property: Properties of a namespace. + * + * @return the properties value. + */ + public NamespaceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of a namespace. + * + * @param properties the properties value to set. + * @return the ManagedNamespaceInner object itself. + */ + public ManagedNamespaceInner withProperties(NamespaceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the ManagedNamespaceInner object itself. + */ + public ManagedNamespaceInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The geo-location where the resource lives. + * + * @param location the location value to set. + * @return the ManagedNamespaceInner object itself. + */ + public ManagedNamespaceInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the eTag property: If eTag is provided in the response body, it may also be provided as a header per the + * normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. + * HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), + * and If-Range (section 14.27) header fields. + * + * @return the eTag value. + */ + public String eTag() { + return this.eTag; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("location", this.location); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedNamespaceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedNamespaceInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ManagedNamespaceInner. + */ + public static ManagedNamespaceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedNamespaceInner deserializedManagedNamespaceInner = new ManagedNamespaceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedManagedNamespaceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedManagedNamespaceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedManagedNamespaceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedManagedNamespaceInner.properties = NamespaceProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedManagedNamespaceInner.tags = tags; + } else if ("location".equals(fieldName)) { + deserializedManagedNamespaceInner.location = reader.getString(); + } else if ("eTag".equals(fieldName)) { + deserializedManagedNamespaceInner.eTag = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedManagedNamespaceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedNamespaceInner; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/MeshRevisionProfileInner.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/MeshRevisionProfileInner.java new file mode 100644 index 000000000000..ffbe1144e16c --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/MeshRevisionProfileInner.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerservice.generated.models.MeshRevisionProfileProperties; +import java.io.IOException; + +/** + * Mesh revision profile for a mesh. + */ +@Immutable +public final class MeshRevisionProfileInner extends ProxyResource { + /* + * Mesh revision profile properties for a mesh + */ + private MeshRevisionProfileProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of MeshRevisionProfileInner class. + */ + private MeshRevisionProfileInner() { + } + + /** + * Get the properties property: Mesh revision profile properties for a mesh. + * + * @return the properties value. + */ + public MeshRevisionProfileProperties properties() { + return this.properties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MeshRevisionProfileInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MeshRevisionProfileInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MeshRevisionProfileInner. + */ + public static MeshRevisionProfileInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MeshRevisionProfileInner deserializedMeshRevisionProfileInner = new MeshRevisionProfileInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMeshRevisionProfileInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedMeshRevisionProfileInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedMeshRevisionProfileInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedMeshRevisionProfileInner.properties = MeshRevisionProfileProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedMeshRevisionProfileInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMeshRevisionProfileInner; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/MeshUpgradeProfileInner.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/MeshUpgradeProfileInner.java new file mode 100644 index 000000000000..859e5ffb7375 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/MeshUpgradeProfileInner.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerservice.generated.models.MeshUpgradeProfileProperties; +import java.io.IOException; + +/** + * Upgrade profile for given mesh. + */ +@Immutable +public final class MeshUpgradeProfileInner extends ProxyResource { + /* + * Mesh upgrade profile properties for a major.minor release. + */ + private MeshUpgradeProfileProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of MeshUpgradeProfileInner class. + */ + private MeshUpgradeProfileInner() { + } + + /** + * Get the properties property: Mesh upgrade profile properties for a major.minor release. + * + * @return the properties value. + */ + public MeshUpgradeProfileProperties properties() { + return this.properties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MeshUpgradeProfileInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MeshUpgradeProfileInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MeshUpgradeProfileInner. + */ + public static MeshUpgradeProfileInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MeshUpgradeProfileInner deserializedMeshUpgradeProfileInner = new MeshUpgradeProfileInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMeshUpgradeProfileInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedMeshUpgradeProfileInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedMeshUpgradeProfileInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedMeshUpgradeProfileInner.properties = MeshUpgradeProfileProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedMeshUpgradeProfileInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMeshUpgradeProfileInner; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/OperationValueDisplay.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/OperationValueDisplay.java new file mode 100644 index 000000000000..017e4f63c897 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/OperationValueDisplay.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes the properties of a Operation Value Display. + */ +@Immutable +public final class OperationValueDisplay implements JsonSerializable { + /* + * The display name of the operation. + */ + private String operation; + + /* + * The display name of the resource the operation applies to. + */ + private String resource; + + /* + * The description of the operation. + */ + private String description; + + /* + * The resource provider for the operation. + */ + private String provider; + + /** + * Creates an instance of OperationValueDisplay class. + */ + private OperationValueDisplay() { + } + + /** + * Get the operation property: The display name of the operation. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the resource property: The display name of the resource the operation applies to. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Get the description property: The description of the operation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the provider property: The resource provider for the operation. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationValueDisplay from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationValueDisplay if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationValueDisplay. + */ + public static OperationValueDisplay fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationValueDisplay deserializedOperationValueDisplay = new OperationValueDisplay(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("operation".equals(fieldName)) { + deserializedOperationValueDisplay.operation = reader.getString(); + } else if ("resource".equals(fieldName)) { + deserializedOperationValueDisplay.resource = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedOperationValueDisplay.description = reader.getString(); + } else if ("provider".equals(fieldName)) { + deserializedOperationValueDisplay.provider = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationValueDisplay; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/OperationValueInner.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/OperationValueInner.java new file mode 100644 index 000000000000..bcf584eac159 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/OperationValueInner.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes the properties of a Operation value. + */ +@Immutable +public final class OperationValueInner implements JsonSerializable { + /* + * The origin of the operation. + */ + private String origin; + + /* + * The name of the operation. + */ + private String name; + + /* + * Describes the properties of a Operation Value Display. + */ + private OperationValueDisplay innerDisplay; + + /** + * Creates an instance of OperationValueInner class. + */ + private OperationValueInner() { + } + + /** + * Get the origin property: The origin of the operation. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Get the name property: The name of the operation. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the innerDisplay property: Describes the properties of a Operation Value Display. + * + * @return the innerDisplay value. + */ + private OperationValueDisplay innerDisplay() { + return this.innerDisplay; + } + + /** + * Get the operation property: The display name of the operation. + * + * @return the operation value. + */ + public String operation() { + return this.innerDisplay() == null ? null : this.innerDisplay().operation(); + } + + /** + * Get the resource property: The display name of the resource the operation applies to. + * + * @return the resource value. + */ + public String resource() { + return this.innerDisplay() == null ? null : this.innerDisplay().resource(); + } + + /** + * Get the description property: The description of the operation. + * + * @return the description value. + */ + public String description() { + return this.innerDisplay() == null ? null : this.innerDisplay().description(); + } + + /** + * Get the provider property: The resource provider for the operation. + * + * @return the provider value. + */ + public String provider() { + return this.innerDisplay() == null ? null : this.innerDisplay().provider(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("display", this.innerDisplay); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationValueInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationValueInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationValueInner. + */ + public static OperationValueInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationValueInner deserializedOperationValueInner = new OperationValueInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("origin".equals(fieldName)) { + deserializedOperationValueInner.origin = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedOperationValueInner.name = reader.getString(); + } else if ("display".equals(fieldName)) { + deserializedOperationValueInner.innerDisplay = OperationValueDisplay.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationValueInner; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/OutboundEnvironmentEndpointInner.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/OutboundEnvironmentEndpointInner.java new file mode 100644 index 000000000000..f73b89ed9ca0 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/OutboundEnvironmentEndpointInner.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerservice.generated.models.EndpointDependency; +import java.io.IOException; +import java.util.List; + +/** + * Egress endpoints which AKS agent nodes connect to for common purpose. + */ +@Immutable +public final class OutboundEnvironmentEndpointInner implements JsonSerializable { + /* + * The category of endpoints accessed by the AKS agent node, e.g. azure-resource-management, apiserver, etc. + */ + private String category; + + /* + * The endpoints that AKS agent nodes connect to + */ + private List endpoints; + + /** + * Creates an instance of OutboundEnvironmentEndpointInner class. + */ + private OutboundEnvironmentEndpointInner() { + } + + /** + * Get the category property: The category of endpoints accessed by the AKS agent node, e.g. + * azure-resource-management, apiserver, etc. + * + * @return the category value. + */ + public String category() { + return this.category; + } + + /** + * Get the endpoints property: The endpoints that AKS agent nodes connect to. + * + * @return the endpoints value. + */ + public List endpoints() { + return this.endpoints; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", this.category); + jsonWriter.writeArrayField("endpoints", this.endpoints, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OutboundEnvironmentEndpointInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OutboundEnvironmentEndpointInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OutboundEnvironmentEndpointInner. + */ + public static OutboundEnvironmentEndpointInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OutboundEnvironmentEndpointInner deserializedOutboundEnvironmentEndpointInner + = new OutboundEnvironmentEndpointInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + deserializedOutboundEnvironmentEndpointInner.category = reader.getString(); + } else if ("endpoints".equals(fieldName)) { + List endpoints + = reader.readArray(reader1 -> EndpointDependency.fromJson(reader1)); + deserializedOutboundEnvironmentEndpointInner.endpoints = endpoints; + } else { + reader.skipChildren(); + } + } + + return deserializedOutboundEnvironmentEndpointInner; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/PrivateEndpointConnectionInner.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/PrivateEndpointConnectionInner.java new file mode 100644 index 000000000000..4ec7acdcb59f --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/PrivateEndpointConnectionInner.java @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerservice.generated.models.PrivateEndpoint; +import com.azure.resourcemanager.containerservice.generated.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.containerservice.generated.models.PrivateLinkServiceConnectionState; +import java.io.IOException; + +/** + * A private endpoint connection. + */ +@Fluent +public final class PrivateEndpointConnectionInner extends ProxyResource { + /* + * The properties of a private endpoint connection. + */ + private PrivateEndpointConnectionProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of PrivateEndpointConnectionInner class. + */ + public PrivateEndpointConnectionInner() { + } + + /** + * Get the innerProperties property: The properties of a private endpoint connection. + * + * @return the innerProperties value. + */ + private PrivateEndpointConnectionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the provisioningState property: The current provisioning state. + * + * @return the provisioningState value. + */ + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the privateEndpoint property: The resource of private endpoint. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpoint(); + } + + /** + * Set the privateEndpoint property: The resource of private endpoint. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateEndpoint(privateEndpoint); + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkServiceConnectionState(); + } + + /** + * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner + withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PrivateEndpointConnectionInner. + */ + public static PrivateEndpointConnectionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionInner deserializedPrivateEndpointConnectionInner + = new PrivateEndpointConnectionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.innerProperties + = PrivateEndpointConnectionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionInner; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/PrivateEndpointConnectionListResultInner.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/PrivateEndpointConnectionListResultInner.java new file mode 100644 index 000000000000..b64d35137db7 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/PrivateEndpointConnectionListResultInner.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * A list of private endpoint connections. + */ +@Immutable +public final class PrivateEndpointConnectionListResultInner + implements JsonSerializable { + /* + * The collection value. + */ + private List value; + + /** + * Creates an instance of PrivateEndpointConnectionListResultInner class. + */ + private PrivateEndpointConnectionListResultInner() { + } + + /** + * Get the value property: The collection value. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionListResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionListResultInner if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateEndpointConnectionListResultInner. + */ + public static PrivateEndpointConnectionListResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionListResultInner deserializedPrivateEndpointConnectionListResultInner + = new PrivateEndpointConnectionListResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1)); + deserializedPrivateEndpointConnectionListResultInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionListResultInner; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/PrivateEndpointConnectionProperties.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/PrivateEndpointConnectionProperties.java new file mode 100644 index 000000000000..aadeeaea342c --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/PrivateEndpointConnectionProperties.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerservice.generated.models.PrivateEndpoint; +import com.azure.resourcemanager.containerservice.generated.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.containerservice.generated.models.PrivateLinkServiceConnectionState; +import java.io.IOException; + +/** + * Properties of a private endpoint connection. + */ +@Fluent +public final class PrivateEndpointConnectionProperties + implements JsonSerializable { + /* + * The current provisioning state. + */ + private PrivateEndpointConnectionProvisioningState provisioningState; + + /* + * The resource of private endpoint. + */ + private PrivateEndpoint privateEndpoint; + + /* + * A collection of information about the state of the connection between service consumer and provider. + */ + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /** + * Creates an instance of PrivateEndpointConnectionProperties class. + */ + public PrivateEndpointConnectionProperties() { + } + + /** + * Get the provisioningState property: The current provisioning state. + * + * @return the provisioningState value. + */ + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the privateEndpoint property: The resource of private endpoint. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the privateEndpoint property: The resource of private endpoint. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties + withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("privateLinkServiceConnectionState", this.privateLinkServiceConnectionState); + jsonWriter.writeJsonField("privateEndpoint", this.privateEndpoint); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PrivateEndpointConnectionProperties. + */ + public static PrivateEndpointConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionProperties deserializedPrivateEndpointConnectionProperties + = new PrivateEndpointConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("privateLinkServiceConnectionState".equals(fieldName)) { + deserializedPrivateEndpointConnectionProperties.privateLinkServiceConnectionState + = PrivateLinkServiceConnectionState.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedPrivateEndpointConnectionProperties.provisioningState + = PrivateEndpointConnectionProvisioningState.fromString(reader.getString()); + } else if ("privateEndpoint".equals(fieldName)) { + deserializedPrivateEndpointConnectionProperties.privateEndpoint = PrivateEndpoint.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionProperties; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/PrivateLinkResourceInner.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/PrivateLinkResourceInner.java new file mode 100644 index 000000000000..779249c779e6 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/PrivateLinkResourceInner.java @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * A private link resource. + */ +@Fluent +public final class PrivateLinkResourceInner implements JsonSerializable { + /* + * The ID of the private link resource. + */ + private String id; + + /* + * The name of the private link resource. See [naming rules](https://aka.ms/search-naming-rules) for more details. + */ + private String name; + + /* + * The resource type. + */ + private String type; + + /* + * The group ID of the resource. + */ + private String groupId; + + /* + * The RequiredMembers of the resource + */ + private List requiredMembers; + + /* + * The private link service ID of the resource, this field is exposed only to NRP internally. + */ + private String privateLinkServiceID; + + /** + * Creates an instance of PrivateLinkResourceInner class. + */ + public PrivateLinkResourceInner() { + } + + /** + * Get the id property: The ID of the private link resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The ID of the private link resource. + * + * @param id the id value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: The name of the private link resource. See [naming + * rules](https://aka.ms/search-naming-rules) for more details. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the private link resource. See [naming + * rules](https://aka.ms/search-naming-rules) for more details. + * + * @param name the name value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The resource type. + * + * @param type the type value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withType(String type) { + this.type = type; + return this; + } + + /** + * Get the groupId property: The group ID of the resource. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Set the groupId property: The group ID of the resource. + * + * @param groupId the groupId value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withGroupId(String groupId) { + this.groupId = groupId; + return this; + } + + /** + * Get the requiredMembers property: The RequiredMembers of the resource. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Set the requiredMembers property: The RequiredMembers of the resource. + * + * @param requiredMembers the requiredMembers value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withRequiredMembers(List requiredMembers) { + this.requiredMembers = requiredMembers; + return this; + } + + /** + * Get the privateLinkServiceID property: The private link service ID of the resource, this field is exposed only to + * NRP internally. + * + * @return the privateLinkServiceID value. + */ + public String privateLinkServiceID() { + return this.privateLinkServiceID; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("groupId", this.groupId); + jsonWriter.writeArrayField("requiredMembers", this.requiredMembers, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResourceInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateLinkResourceInner. + */ + public static PrivateLinkResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResourceInner deserializedPrivateLinkResourceInner = new PrivateLinkResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateLinkResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPrivateLinkResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPrivateLinkResourceInner.type = reader.getString(); + } else if ("groupId".equals(fieldName)) { + deserializedPrivateLinkResourceInner.groupId = reader.getString(); + } else if ("requiredMembers".equals(fieldName)) { + List requiredMembers = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateLinkResourceInner.requiredMembers = requiredMembers; + } else if ("privateLinkServiceID".equals(fieldName)) { + deserializedPrivateLinkResourceInner.privateLinkServiceID = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResourceInner; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/PrivateLinkResourcesListResultInner.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/PrivateLinkResourcesListResultInner.java new file mode 100644 index 000000000000..803be7b8f068 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/PrivateLinkResourcesListResultInner.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * A list of private link resources. + */ +@Immutable +public final class PrivateLinkResourcesListResultInner + implements JsonSerializable { + /* + * The collection value. + */ + private List value; + + /** + * Creates an instance of PrivateLinkResourcesListResultInner class. + */ + private PrivateLinkResourcesListResultInner() { + } + + /** + * Get the value property: The collection value. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkResourcesListResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResourcesListResultInner if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateLinkResourcesListResultInner. + */ + public static PrivateLinkResourcesListResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResourcesListResultInner deserializedPrivateLinkResourcesListResultInner + = new PrivateLinkResourcesListResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PrivateLinkResourceInner.fromJson(reader1)); + deserializedPrivateLinkResourcesListResultInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResourcesListResultInner; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/RunCommandResultInner.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/RunCommandResultInner.java new file mode 100644 index 000000000000..68700b2c4276 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/RunCommandResultInner.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * run command result. + */ +@Immutable +public final class RunCommandResultInner implements JsonSerializable { + /* + * The command id. + */ + private String id; + + /* + * Properties of command result. + */ + private CommandResultProperties innerProperties; + + /** + * Creates an instance of RunCommandResultInner class. + */ + private RunCommandResultInner() { + } + + /** + * Get the id property: The command id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the innerProperties property: Properties of command result. + * + * @return the innerProperties value. + */ + private CommandResultProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the provisioningState property: provisioning State. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the exitCode property: The exit code of the command. + * + * @return the exitCode value. + */ + public Integer exitCode() { + return this.innerProperties() == null ? null : this.innerProperties().exitCode(); + } + + /** + * Get the startedAt property: The time when the command started. + * + * @return the startedAt value. + */ + public OffsetDateTime startedAt() { + return this.innerProperties() == null ? null : this.innerProperties().startedAt(); + } + + /** + * Get the finishedAt property: The time when the command finished. + * + * @return the finishedAt value. + */ + public OffsetDateTime finishedAt() { + return this.innerProperties() == null ? null : this.innerProperties().finishedAt(); + } + + /** + * Get the logs property: The command output. + * + * @return the logs value. + */ + public String logs() { + return this.innerProperties() == null ? null : this.innerProperties().logs(); + } + + /** + * Get the reason property: An explanation of why provisioningState is set to failed (if so). + * + * @return the reason value. + */ + public String reason() { + return this.innerProperties() == null ? null : this.innerProperties().reason(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RunCommandResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RunCommandResultInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the RunCommandResultInner. + */ + public static RunCommandResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RunCommandResultInner deserializedRunCommandResultInner = new RunCommandResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedRunCommandResultInner.id = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedRunCommandResultInner.innerProperties = CommandResultProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRunCommandResultInner; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/SnapshotInner.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/SnapshotInner.java new file mode 100644 index 000000000000..6d3173e9776e --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/SnapshotInner.java @@ -0,0 +1,277 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerservice.generated.models.CreationData; +import com.azure.resourcemanager.containerservice.generated.models.OSSKU; +import com.azure.resourcemanager.containerservice.generated.models.OSType; +import com.azure.resourcemanager.containerservice.generated.models.SnapshotType; +import java.io.IOException; +import java.util.Map; + +/** + * A node pool snapshot resource. + */ +@Fluent +public final class SnapshotInner extends Resource { + /* + * Properties of a snapshot. + */ + private SnapshotProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of SnapshotInner class. + */ + public SnapshotInner() { + } + + /** + * Get the innerProperties property: Properties of a snapshot. + * + * @return the innerProperties value. + */ + private SnapshotProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public SnapshotInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SnapshotInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the creationData property: CreationData to be used to specify the source agent pool resource ID to create + * this snapshot. + * + * @return the creationData value. + */ + public CreationData creationData() { + return this.innerProperties() == null ? null : this.innerProperties().creationData(); + } + + /** + * Set the creationData property: CreationData to be used to specify the source agent pool resource ID to create + * this snapshot. + * + * @param creationData the creationData value to set. + * @return the SnapshotInner object itself. + */ + public SnapshotInner withCreationData(CreationData creationData) { + if (this.innerProperties() == null) { + this.innerProperties = new SnapshotProperties(); + } + this.innerProperties().withCreationData(creationData); + return this; + } + + /** + * Get the snapshotType property: The type of a snapshot. The default is NodePool. + * + * @return the snapshotType value. + */ + public SnapshotType snapshotType() { + return this.innerProperties() == null ? null : this.innerProperties().snapshotType(); + } + + /** + * Set the snapshotType property: The type of a snapshot. The default is NodePool. + * + * @param snapshotType the snapshotType value to set. + * @return the SnapshotInner object itself. + */ + public SnapshotInner withSnapshotType(SnapshotType snapshotType) { + if (this.innerProperties() == null) { + this.innerProperties = new SnapshotProperties(); + } + this.innerProperties().withSnapshotType(snapshotType); + return this; + } + + /** + * Get the kubernetesVersion property: The version of Kubernetes. + * + * @return the kubernetesVersion value. + */ + public String kubernetesVersion() { + return this.innerProperties() == null ? null : this.innerProperties().kubernetesVersion(); + } + + /** + * Get the nodeImageVersion property: The version of node image. + * + * @return the nodeImageVersion value. + */ + public String nodeImageVersion() { + return this.innerProperties() == null ? null : this.innerProperties().nodeImageVersion(); + } + + /** + * Get the osType property: The operating system type. The default is Linux. + * + * @return the osType value. + */ + public OSType osType() { + return this.innerProperties() == null ? null : this.innerProperties().osType(); + } + + /** + * Get the osSku property: 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. + * + * @return the osSku value. + */ + public OSSKU osSku() { + return this.innerProperties() == null ? null : this.innerProperties().osSku(); + } + + /** + * Get the vmSize property: The size of the VM. + * + * @return the vmSize value. + */ + public String vmSize() { + return this.innerProperties() == null ? null : this.innerProperties().vmSize(); + } + + /** + * Get the enableFIPS property: Whether to use a FIPS-enabled OS. + * + * @return the enableFIPS value. + */ + public Boolean enableFIPS() { + return this.innerProperties() == null ? null : this.innerProperties().enableFIPS(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SnapshotInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SnapshotInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SnapshotInner. + */ + public static SnapshotInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SnapshotInner deserializedSnapshotInner = new SnapshotInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSnapshotInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSnapshotInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSnapshotInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedSnapshotInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedSnapshotInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedSnapshotInner.innerProperties = SnapshotProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSnapshotInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSnapshotInner; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/SnapshotProperties.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/SnapshotProperties.java new file mode 100644 index 000000000000..1788a7762030 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/SnapshotProperties.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerservice.generated.models.CreationData; +import com.azure.resourcemanager.containerservice.generated.models.OSSKU; +import com.azure.resourcemanager.containerservice.generated.models.OSType; +import com.azure.resourcemanager.containerservice.generated.models.SnapshotType; +import java.io.IOException; + +/** + * Properties used to configure a node pool snapshot. + */ +@Fluent +public final class SnapshotProperties implements JsonSerializable { + /* + * CreationData to be used to specify the source agent pool resource ID to create this snapshot. + */ + private CreationData creationData; + + /* + * The type of a snapshot. The default is NodePool. + */ + private SnapshotType snapshotType; + + /* + * The version of Kubernetes. + */ + private String kubernetesVersion; + + /* + * The version of node image. + */ + private String nodeImageVersion; + + /* + * The operating system type. The default is Linux. + */ + private OSType osType; + + /* + * 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. + */ + private OSSKU osSku; + + /* + * The size of the VM. + */ + private String vmSize; + + /* + * Whether to use a FIPS-enabled OS. + */ + private Boolean enableFIPS; + + /** + * Creates an instance of SnapshotProperties class. + */ + public SnapshotProperties() { + } + + /** + * Get the creationData property: CreationData to be used to specify the source agent pool resource ID to create + * this snapshot. + * + * @return the creationData value. + */ + public CreationData creationData() { + return this.creationData; + } + + /** + * Set the creationData property: CreationData to be used to specify the source agent pool resource ID to create + * this snapshot. + * + * @param creationData the creationData value to set. + * @return the SnapshotProperties object itself. + */ + public SnapshotProperties withCreationData(CreationData creationData) { + this.creationData = creationData; + return this; + } + + /** + * Get the snapshotType property: The type of a snapshot. The default is NodePool. + * + * @return the snapshotType value. + */ + public SnapshotType snapshotType() { + return this.snapshotType; + } + + /** + * Set the snapshotType property: The type of a snapshot. The default is NodePool. + * + * @param snapshotType the snapshotType value to set. + * @return the SnapshotProperties object itself. + */ + public SnapshotProperties withSnapshotType(SnapshotType snapshotType) { + this.snapshotType = snapshotType; + return this; + } + + /** + * Get the kubernetesVersion property: The version of Kubernetes. + * + * @return the kubernetesVersion value. + */ + public String kubernetesVersion() { + return this.kubernetesVersion; + } + + /** + * Get the nodeImageVersion property: The version of node image. + * + * @return the nodeImageVersion value. + */ + public String nodeImageVersion() { + return this.nodeImageVersion; + } + + /** + * Get the osType property: The operating system type. The default is Linux. + * + * @return the osType value. + */ + public OSType osType() { + return this.osType; + } + + /** + * Get the osSku property: 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. + * + * @return the osSku value. + */ + public OSSKU osSku() { + return this.osSku; + } + + /** + * Get the vmSize property: The size of the VM. + * + * @return the vmSize value. + */ + public String vmSize() { + return this.vmSize; + } + + /** + * Get the enableFIPS property: Whether to use a FIPS-enabled OS. + * + * @return the enableFIPS value. + */ + public Boolean enableFIPS() { + return this.enableFIPS; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("creationData", this.creationData); + jsonWriter.writeStringField("snapshotType", this.snapshotType == null ? null : this.snapshotType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SnapshotProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SnapshotProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SnapshotProperties. + */ + public static SnapshotProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SnapshotProperties deserializedSnapshotProperties = new SnapshotProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("creationData".equals(fieldName)) { + deserializedSnapshotProperties.creationData = CreationData.fromJson(reader); + } else if ("snapshotType".equals(fieldName)) { + deserializedSnapshotProperties.snapshotType = SnapshotType.fromString(reader.getString()); + } else if ("kubernetesVersion".equals(fieldName)) { + deserializedSnapshotProperties.kubernetesVersion = reader.getString(); + } else if ("nodeImageVersion".equals(fieldName)) { + deserializedSnapshotProperties.nodeImageVersion = reader.getString(); + } else if ("osType".equals(fieldName)) { + deserializedSnapshotProperties.osType = OSType.fromString(reader.getString()); + } else if ("osSku".equals(fieldName)) { + deserializedSnapshotProperties.osSku = OSSKU.fromString(reader.getString()); + } else if ("vmSize".equals(fieldName)) { + deserializedSnapshotProperties.vmSize = reader.getString(); + } else if ("enableFIPS".equals(fieldName)) { + deserializedSnapshotProperties.enableFIPS = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedSnapshotProperties; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/TrustedAccessRoleBindingInner.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/TrustedAccessRoleBindingInner.java new file mode 100644 index 000000000000..508bf4006956 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/TrustedAccessRoleBindingInner.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerservice.generated.models.TrustedAccessRoleBindingProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Defines binding between a resource and role. + */ +@Fluent +public final class TrustedAccessRoleBindingInner extends ProxyResource { + /* + * Properties for trusted access role binding + */ + private TrustedAccessRoleBindingProperties innerProperties = new TrustedAccessRoleBindingProperties(); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of TrustedAccessRoleBindingInner class. + */ + public TrustedAccessRoleBindingInner() { + } + + /** + * Get the innerProperties property: Properties for trusted access role binding. + * + * @return the innerProperties value. + */ + private TrustedAccessRoleBindingProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the provisioningState property: The current provisioning state of trusted access role binding. + * + * @return the provisioningState value. + */ + public TrustedAccessRoleBindingProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the sourceResourceId property: The ARM resource ID of source resource that trusted access is configured for. + * + * @return the sourceResourceId value. + */ + public String sourceResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().sourceResourceId(); + } + + /** + * Set the sourceResourceId property: The ARM resource ID of source resource that trusted access is configured for. + * + * @param sourceResourceId the sourceResourceId value to set. + * @return the TrustedAccessRoleBindingInner object itself. + */ + public TrustedAccessRoleBindingInner withSourceResourceId(String sourceResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new TrustedAccessRoleBindingProperties(); + } + this.innerProperties().withSourceResourceId(sourceResourceId); + return this; + } + + /** + * Get the roles property: A list of roles to bind, each item is a resource type qualified role name. For example: + * 'Microsoft.MachineLearningServices/workspaces/reader'. + * + * @return the roles value. + */ + public List roles() { + return this.innerProperties() == null ? null : this.innerProperties().roles(); + } + + /** + * Set the roles property: A list of roles to bind, each item is a resource type qualified role name. For example: + * 'Microsoft.MachineLearningServices/workspaces/reader'. + * + * @param roles the roles value to set. + * @return the TrustedAccessRoleBindingInner object itself. + */ + public TrustedAccessRoleBindingInner withRoles(List roles) { + if (this.innerProperties() == null) { + this.innerProperties = new TrustedAccessRoleBindingProperties(); + } + this.innerProperties().withRoles(roles); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TrustedAccessRoleBindingInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TrustedAccessRoleBindingInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TrustedAccessRoleBindingInner. + */ + public static TrustedAccessRoleBindingInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TrustedAccessRoleBindingInner deserializedTrustedAccessRoleBindingInner + = new TrustedAccessRoleBindingInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedTrustedAccessRoleBindingInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedTrustedAccessRoleBindingInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedTrustedAccessRoleBindingInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedTrustedAccessRoleBindingInner.innerProperties + = TrustedAccessRoleBindingProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedTrustedAccessRoleBindingInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedTrustedAccessRoleBindingInner; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/TrustedAccessRoleBindingProperties.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/TrustedAccessRoleBindingProperties.java new file mode 100644 index 000000000000..a08c7db8fd66 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/TrustedAccessRoleBindingProperties.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerservice.generated.models.TrustedAccessRoleBindingProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Properties for trusted access role binding. + */ +@Fluent +public final class TrustedAccessRoleBindingProperties implements JsonSerializable { + /* + * The current provisioning state of trusted access role binding. + */ + private TrustedAccessRoleBindingProvisioningState provisioningState; + + /* + * The ARM resource ID of source resource that trusted access is configured for. + */ + private String sourceResourceId; + + /* + * A list of roles to bind, each item is a resource type qualified role name. For example: + * 'Microsoft.MachineLearningServices/workspaces/reader'. + */ + private List roles; + + /** + * Creates an instance of TrustedAccessRoleBindingProperties class. + */ + public TrustedAccessRoleBindingProperties() { + } + + /** + * Get the provisioningState property: The current provisioning state of trusted access role binding. + * + * @return the provisioningState value. + */ + public TrustedAccessRoleBindingProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the sourceResourceId property: The ARM resource ID of source resource that trusted access is configured for. + * + * @return the sourceResourceId value. + */ + public String sourceResourceId() { + return this.sourceResourceId; + } + + /** + * Set the sourceResourceId property: The ARM resource ID of source resource that trusted access is configured for. + * + * @param sourceResourceId the sourceResourceId value to set. + * @return the TrustedAccessRoleBindingProperties object itself. + */ + public TrustedAccessRoleBindingProperties withSourceResourceId(String sourceResourceId) { + this.sourceResourceId = sourceResourceId; + return this; + } + + /** + * Get the roles property: A list of roles to bind, each item is a resource type qualified role name. For example: + * 'Microsoft.MachineLearningServices/workspaces/reader'. + * + * @return the roles value. + */ + public List roles() { + return this.roles; + } + + /** + * Set the roles property: A list of roles to bind, each item is a resource type qualified role name. For example: + * 'Microsoft.MachineLearningServices/workspaces/reader'. + * + * @param roles the roles value to set. + * @return the TrustedAccessRoleBindingProperties object itself. + */ + public TrustedAccessRoleBindingProperties withRoles(List roles) { + this.roles = roles; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("sourceResourceId", this.sourceResourceId); + jsonWriter.writeArrayField("roles", this.roles, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TrustedAccessRoleBindingProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TrustedAccessRoleBindingProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TrustedAccessRoleBindingProperties. + */ + public static TrustedAccessRoleBindingProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TrustedAccessRoleBindingProperties deserializedTrustedAccessRoleBindingProperties + = new TrustedAccessRoleBindingProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sourceResourceId".equals(fieldName)) { + deserializedTrustedAccessRoleBindingProperties.sourceResourceId = reader.getString(); + } else if ("roles".equals(fieldName)) { + List roles = reader.readArray(reader1 -> reader1.getString()); + deserializedTrustedAccessRoleBindingProperties.roles = roles; + } else if ("provisioningState".equals(fieldName)) { + deserializedTrustedAccessRoleBindingProperties.provisioningState + = TrustedAccessRoleBindingProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedTrustedAccessRoleBindingProperties; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/TrustedAccessRoleInner.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/TrustedAccessRoleInner.java new file mode 100644 index 000000000000..f21bb2a8e035 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/TrustedAccessRoleInner.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerservice.generated.models.TrustedAccessRoleRule; +import java.io.IOException; +import java.util.List; + +/** + * Trusted access role definition. + */ +@Immutable +public final class TrustedAccessRoleInner implements JsonSerializable { + /* + * Resource type of Azure resource + */ + private String sourceResourceType; + + /* + * Name of role, name is unique under a source resource type + */ + private String name; + + /* + * 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). + */ + private List rules; + + /** + * Creates an instance of TrustedAccessRoleInner class. + */ + private TrustedAccessRoleInner() { + } + + /** + * Get the sourceResourceType property: Resource type of Azure resource. + * + * @return the sourceResourceType value. + */ + public String sourceResourceType() { + return this.sourceResourceType; + } + + /** + * Get the name property: Name of role, name is unique under a source resource type. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the rules property: 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). + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TrustedAccessRoleInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TrustedAccessRoleInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the TrustedAccessRoleInner. + */ + public static TrustedAccessRoleInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TrustedAccessRoleInner deserializedTrustedAccessRoleInner = new TrustedAccessRoleInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sourceResourceType".equals(fieldName)) { + deserializedTrustedAccessRoleInner.sourceResourceType = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedTrustedAccessRoleInner.name = reader.getString(); + } else if ("rules".equals(fieldName)) { + List rules + = reader.readArray(reader1 -> TrustedAccessRoleRule.fromJson(reader1)); + deserializedTrustedAccessRoleInner.rules = rules; + } else { + reader.skipChildren(); + } + } + + return deserializedTrustedAccessRoleInner; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/package-info.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/package-info.java new file mode 100644 index 000000000000..8e06488ac7cd --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the inner data models for ContainerService. + * The Container Service Client. + */ +package com.azure.resourcemanager.containerservice.generated.fluent.models; diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/package-info.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/package-info.java new file mode 100644 index 000000000000..3ee3649a42e3 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the service clients for ContainerService. + * The Container Service Client. + */ +package com.azure.resourcemanager.containerservice.generated.fluent; diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/AgentPoolAvailableVersionsImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/AgentPoolAvailableVersionsImpl.java new file mode 100644 index 000000000000..8e2b5760b4ca --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/AgentPoolAvailableVersionsImpl.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.AgentPoolAvailableVersionsInner; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolAvailableVersions; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem; +import java.util.Collections; +import java.util.List; + +public final class AgentPoolAvailableVersionsImpl implements AgentPoolAvailableVersions { + private AgentPoolAvailableVersionsInner innerObject; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + AgentPoolAvailableVersionsImpl(AgentPoolAvailableVersionsInner innerObject, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public List agentPoolVersions() { + List inner = this.innerModel().agentPoolVersions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public AgentPoolAvailableVersionsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/AgentPoolImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/AgentPoolImpl.java new file mode 100644 index 000000000000..eb30a02b304e --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/AgentPoolImpl.java @@ -0,0 +1,705 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.fluent.models.AgentPoolInner; +import com.azure.resourcemanager.containerservice.generated.models.AgentPool; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolDeleteMachinesParameter; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolGatewayProfile; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolMode; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolNetworkProfile; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolSecurityProfile; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolStatus; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolType; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolUpgradeSettings; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolWindowsProfile; +import com.azure.resourcemanager.containerservice.generated.models.CreationData; +import com.azure.resourcemanager.containerservice.generated.models.GPUInstanceProfile; +import com.azure.resourcemanager.containerservice.generated.models.GPUProfile; +import com.azure.resourcemanager.containerservice.generated.models.KubeletConfig; +import com.azure.resourcemanager.containerservice.generated.models.KubeletDiskType; +import com.azure.resourcemanager.containerservice.generated.models.LinuxOSConfig; +import com.azure.resourcemanager.containerservice.generated.models.LocalDNSProfile; +import com.azure.resourcemanager.containerservice.generated.models.OSDiskType; +import com.azure.resourcemanager.containerservice.generated.models.OSSKU; +import com.azure.resourcemanager.containerservice.generated.models.OSType; +import com.azure.resourcemanager.containerservice.generated.models.PodIPAllocationMode; +import com.azure.resourcemanager.containerservice.generated.models.PowerState; +import com.azure.resourcemanager.containerservice.generated.models.ScaleDownMode; +import com.azure.resourcemanager.containerservice.generated.models.ScaleSetEvictionPolicy; +import com.azure.resourcemanager.containerservice.generated.models.ScaleSetPriority; +import com.azure.resourcemanager.containerservice.generated.models.VirtualMachineNodes; +import com.azure.resourcemanager.containerservice.generated.models.VirtualMachinesProfile; +import com.azure.resourcemanager.containerservice.generated.models.WorkloadRuntime; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class AgentPoolImpl implements AgentPool, AgentPool.Definition, AgentPool.Update { + private AgentPoolInner innerObject; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String eTag() { + return this.innerModel().eTag(); + } + + public Integer count() { + return this.innerModel().count(); + } + + public String vmSize() { + return this.innerModel().vmSize(); + } + + public Integer osDiskSizeGB() { + return this.innerModel().osDiskSizeGB(); + } + + public OSDiskType osDiskType() { + return this.innerModel().osDiskType(); + } + + public KubeletDiskType kubeletDiskType() { + return this.innerModel().kubeletDiskType(); + } + + public WorkloadRuntime workloadRuntime() { + return this.innerModel().workloadRuntime(); + } + + public String messageOfTheDay() { + return this.innerModel().messageOfTheDay(); + } + + public String vnetSubnetID() { + return this.innerModel().vnetSubnetID(); + } + + public String podSubnetID() { + return this.innerModel().podSubnetID(); + } + + public PodIPAllocationMode podIPAllocationMode() { + return this.innerModel().podIPAllocationMode(); + } + + public Integer maxPods() { + return this.innerModel().maxPods(); + } + + public OSType osType() { + return this.innerModel().osType(); + } + + public OSSKU osSKU() { + return this.innerModel().osSKU(); + } + + public Integer maxCount() { + return this.innerModel().maxCount(); + } + + public Integer minCount() { + return this.innerModel().minCount(); + } + + public Boolean enableAutoScaling() { + return this.innerModel().enableAutoScaling(); + } + + public ScaleDownMode scaleDownMode() { + return this.innerModel().scaleDownMode(); + } + + public AgentPoolType typePropertiesType() { + return this.innerModel().typePropertiesType(); + } + + public AgentPoolMode mode() { + return this.innerModel().mode(); + } + + public String orchestratorVersion() { + return this.innerModel().orchestratorVersion(); + } + + public String currentOrchestratorVersion() { + return this.innerModel().currentOrchestratorVersion(); + } + + public String nodeImageVersion() { + return this.innerModel().nodeImageVersion(); + } + + public AgentPoolUpgradeSettings upgradeSettings() { + return this.innerModel().upgradeSettings(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public PowerState powerState() { + return this.innerModel().powerState(); + } + + public List availabilityZones() { + List inner = this.innerModel().availabilityZones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Boolean enableNodePublicIP() { + return this.innerModel().enableNodePublicIP(); + } + + public String nodePublicIPPrefixID() { + return this.innerModel().nodePublicIPPrefixID(); + } + + public ScaleSetPriority scaleSetPriority() { + return this.innerModel().scaleSetPriority(); + } + + public ScaleSetEvictionPolicy scaleSetEvictionPolicy() { + return this.innerModel().scaleSetEvictionPolicy(); + } + + public Double spotMaxPrice() { + return this.innerModel().spotMaxPrice(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Map nodeLabels() { + Map inner = this.innerModel().nodeLabels(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public List nodeTaints() { + List inner = this.innerModel().nodeTaints(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String proximityPlacementGroupID() { + return this.innerModel().proximityPlacementGroupID(); + } + + public KubeletConfig kubeletConfig() { + return this.innerModel().kubeletConfig(); + } + + public LinuxOSConfig linuxOSConfig() { + return this.innerModel().linuxOSConfig(); + } + + public Boolean enableEncryptionAtHost() { + return this.innerModel().enableEncryptionAtHost(); + } + + public Boolean enableUltraSSD() { + return this.innerModel().enableUltraSSD(); + } + + public Boolean enableFIPS() { + return this.innerModel().enableFIPS(); + } + + public GPUInstanceProfile gpuInstanceProfile() { + return this.innerModel().gpuInstanceProfile(); + } + + public CreationData creationData() { + return this.innerModel().creationData(); + } + + public String capacityReservationGroupID() { + return this.innerModel().capacityReservationGroupID(); + } + + public String hostGroupID() { + return this.innerModel().hostGroupID(); + } + + public AgentPoolNetworkProfile networkProfile() { + return this.innerModel().networkProfile(); + } + + public AgentPoolWindowsProfile windowsProfile() { + return this.innerModel().windowsProfile(); + } + + public AgentPoolSecurityProfile securityProfile() { + return this.innerModel().securityProfile(); + } + + public GPUProfile gpuProfile() { + return this.innerModel().gpuProfile(); + } + + public AgentPoolGatewayProfile gatewayProfile() { + return this.innerModel().gatewayProfile(); + } + + public VirtualMachinesProfile virtualMachinesProfile() { + return this.innerModel().virtualMachinesProfile(); + } + + public List virtualMachineNodesStatus() { + List inner = this.innerModel().virtualMachineNodesStatus(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public AgentPoolStatus status() { + return this.innerModel().status(); + } + + public LocalDNSProfile localDNSProfile() { + return this.innerModel().localDNSProfile(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public AgentPoolInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String resourceName; + + private String agentPoolName; + + private String createIfMatch; + + private String createIfNoneMatch; + + private String updateIfMatch; + + private String updateIfNoneMatch; + + public AgentPoolImpl withExistingManagedCluster(String resourceGroupName, String resourceName) { + this.resourceGroupName = resourceGroupName; + this.resourceName = resourceName; + return this; + } + + public AgentPool create() { + this.innerObject = serviceManager.serviceClient() + .getAgentPools() + .createOrUpdate(resourceGroupName, resourceName, agentPoolName, this.innerModel(), createIfMatch, + createIfNoneMatch, Context.NONE); + return this; + } + + public AgentPool create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAgentPools() + .createOrUpdate(resourceGroupName, resourceName, agentPoolName, this.innerModel(), createIfMatch, + createIfNoneMatch, context); + return this; + } + + AgentPoolImpl(String name, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = new AgentPoolInner(); + this.serviceManager = serviceManager; + this.agentPoolName = name; + this.createIfMatch = null; + this.createIfNoneMatch = null; + } + + public AgentPoolImpl update() { + this.updateIfMatch = null; + this.updateIfNoneMatch = null; + return this; + } + + public AgentPool apply() { + this.innerObject = serviceManager.serviceClient() + .getAgentPools() + .createOrUpdate(resourceGroupName, resourceName, agentPoolName, this.innerModel(), updateIfMatch, + updateIfNoneMatch, Context.NONE); + return this; + } + + public AgentPool apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAgentPools() + .createOrUpdate(resourceGroupName, resourceName, agentPoolName, this.innerModel(), updateIfMatch, + updateIfNoneMatch, context); + return this; + } + + AgentPoolImpl(AgentPoolInner innerObject, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.resourceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "managedClusters"); + this.agentPoolName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "agentPools"); + } + + public AgentPool refresh() { + this.innerObject = serviceManager.serviceClient() + .getAgentPools() + .getWithResponse(resourceGroupName, resourceName, agentPoolName, Context.NONE) + .getValue(); + return this; + } + + public AgentPool refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAgentPools() + .getWithResponse(resourceGroupName, resourceName, agentPoolName, context) + .getValue(); + return this; + } + + public void abortLatestOperation() { + serviceManager.agentPools().abortLatestOperation(resourceGroupName, resourceName, agentPoolName); + } + + public void abortLatestOperation(Context context) { + serviceManager.agentPools().abortLatestOperation(resourceGroupName, resourceName, agentPoolName, context); + } + + public void deleteMachines(AgentPoolDeleteMachinesParameter machines) { + serviceManager.agentPools().deleteMachines(resourceGroupName, resourceName, agentPoolName, machines); + } + + public void deleteMachines(AgentPoolDeleteMachinesParameter machines, Context context) { + serviceManager.agentPools().deleteMachines(resourceGroupName, resourceName, agentPoolName, machines, context); + } + + public void upgradeNodeImageVersion() { + serviceManager.agentPools().upgradeNodeImageVersion(resourceGroupName, resourceName, agentPoolName); + } + + public void upgradeNodeImageVersion(Context context) { + serviceManager.agentPools().upgradeNodeImageVersion(resourceGroupName, resourceName, agentPoolName, context); + } + + public AgentPoolImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public AgentPoolImpl withCount(Integer count) { + this.innerModel().withCount(count); + return this; + } + + public AgentPoolImpl withVmSize(String vmSize) { + this.innerModel().withVmSize(vmSize); + return this; + } + + public AgentPoolImpl withOsDiskSizeGB(Integer osDiskSizeGB) { + this.innerModel().withOsDiskSizeGB(osDiskSizeGB); + return this; + } + + public AgentPoolImpl withOsDiskType(OSDiskType osDiskType) { + this.innerModel().withOsDiskType(osDiskType); + return this; + } + + public AgentPoolImpl withKubeletDiskType(KubeletDiskType kubeletDiskType) { + this.innerModel().withKubeletDiskType(kubeletDiskType); + return this; + } + + public AgentPoolImpl withWorkloadRuntime(WorkloadRuntime workloadRuntime) { + this.innerModel().withWorkloadRuntime(workloadRuntime); + return this; + } + + public AgentPoolImpl withMessageOfTheDay(String messageOfTheDay) { + this.innerModel().withMessageOfTheDay(messageOfTheDay); + return this; + } + + public AgentPoolImpl withVnetSubnetID(String vnetSubnetID) { + this.innerModel().withVnetSubnetID(vnetSubnetID); + return this; + } + + public AgentPoolImpl withPodSubnetID(String podSubnetID) { + this.innerModel().withPodSubnetID(podSubnetID); + return this; + } + + public AgentPoolImpl withPodIPAllocationMode(PodIPAllocationMode podIPAllocationMode) { + this.innerModel().withPodIPAllocationMode(podIPAllocationMode); + return this; + } + + public AgentPoolImpl withMaxPods(Integer maxPods) { + this.innerModel().withMaxPods(maxPods); + return this; + } + + public AgentPoolImpl withOsType(OSType osType) { + this.innerModel().withOsType(osType); + return this; + } + + public AgentPoolImpl withOsSKU(OSSKU osSKU) { + this.innerModel().withOsSKU(osSKU); + return this; + } + + public AgentPoolImpl withMaxCount(Integer maxCount) { + this.innerModel().withMaxCount(maxCount); + return this; + } + + public AgentPoolImpl withMinCount(Integer minCount) { + this.innerModel().withMinCount(minCount); + return this; + } + + public AgentPoolImpl withEnableAutoScaling(Boolean enableAutoScaling) { + this.innerModel().withEnableAutoScaling(enableAutoScaling); + return this; + } + + public AgentPoolImpl withScaleDownMode(ScaleDownMode scaleDownMode) { + this.innerModel().withScaleDownMode(scaleDownMode); + return this; + } + + public AgentPoolImpl withTypePropertiesType(AgentPoolType typePropertiesType) { + this.innerModel().withTypePropertiesType(typePropertiesType); + return this; + } + + public AgentPoolImpl withMode(AgentPoolMode mode) { + this.innerModel().withMode(mode); + return this; + } + + public AgentPoolImpl withOrchestratorVersion(String orchestratorVersion) { + this.innerModel().withOrchestratorVersion(orchestratorVersion); + return this; + } + + public AgentPoolImpl withUpgradeSettings(AgentPoolUpgradeSettings upgradeSettings) { + this.innerModel().withUpgradeSettings(upgradeSettings); + return this; + } + + public AgentPoolImpl withPowerState(PowerState powerState) { + this.innerModel().withPowerState(powerState); + return this; + } + + public AgentPoolImpl withAvailabilityZones(List availabilityZones) { + this.innerModel().withAvailabilityZones(availabilityZones); + return this; + } + + public AgentPoolImpl withEnableNodePublicIP(Boolean enableNodePublicIP) { + this.innerModel().withEnableNodePublicIP(enableNodePublicIP); + return this; + } + + public AgentPoolImpl withNodePublicIPPrefixID(String nodePublicIPPrefixID) { + this.innerModel().withNodePublicIPPrefixID(nodePublicIPPrefixID); + return this; + } + + public AgentPoolImpl withScaleSetPriority(ScaleSetPriority scaleSetPriority) { + this.innerModel().withScaleSetPriority(scaleSetPriority); + return this; + } + + public AgentPoolImpl withScaleSetEvictionPolicy(ScaleSetEvictionPolicy scaleSetEvictionPolicy) { + this.innerModel().withScaleSetEvictionPolicy(scaleSetEvictionPolicy); + return this; + } + + public AgentPoolImpl withSpotMaxPrice(Double spotMaxPrice) { + this.innerModel().withSpotMaxPrice(spotMaxPrice); + return this; + } + + public AgentPoolImpl withNodeLabels(Map nodeLabels) { + this.innerModel().withNodeLabels(nodeLabels); + return this; + } + + public AgentPoolImpl withNodeTaints(List nodeTaints) { + this.innerModel().withNodeTaints(nodeTaints); + return this; + } + + public AgentPoolImpl withProximityPlacementGroupID(String proximityPlacementGroupID) { + this.innerModel().withProximityPlacementGroupID(proximityPlacementGroupID); + return this; + } + + public AgentPoolImpl withKubeletConfig(KubeletConfig kubeletConfig) { + this.innerModel().withKubeletConfig(kubeletConfig); + return this; + } + + public AgentPoolImpl withLinuxOSConfig(LinuxOSConfig linuxOSConfig) { + this.innerModel().withLinuxOSConfig(linuxOSConfig); + return this; + } + + public AgentPoolImpl withEnableEncryptionAtHost(Boolean enableEncryptionAtHost) { + this.innerModel().withEnableEncryptionAtHost(enableEncryptionAtHost); + return this; + } + + public AgentPoolImpl withEnableUltraSSD(Boolean enableUltraSSD) { + this.innerModel().withEnableUltraSSD(enableUltraSSD); + return this; + } + + public AgentPoolImpl withEnableFIPS(Boolean enableFIPS) { + this.innerModel().withEnableFIPS(enableFIPS); + return this; + } + + public AgentPoolImpl withGpuInstanceProfile(GPUInstanceProfile gpuInstanceProfile) { + this.innerModel().withGpuInstanceProfile(gpuInstanceProfile); + return this; + } + + public AgentPoolImpl withCreationData(CreationData creationData) { + this.innerModel().withCreationData(creationData); + return this; + } + + public AgentPoolImpl withCapacityReservationGroupID(String capacityReservationGroupID) { + this.innerModel().withCapacityReservationGroupID(capacityReservationGroupID); + return this; + } + + public AgentPoolImpl withHostGroupID(String hostGroupID) { + this.innerModel().withHostGroupID(hostGroupID); + return this; + } + + public AgentPoolImpl withNetworkProfile(AgentPoolNetworkProfile networkProfile) { + this.innerModel().withNetworkProfile(networkProfile); + return this; + } + + public AgentPoolImpl withWindowsProfile(AgentPoolWindowsProfile windowsProfile) { + this.innerModel().withWindowsProfile(windowsProfile); + return this; + } + + public AgentPoolImpl withSecurityProfile(AgentPoolSecurityProfile securityProfile) { + this.innerModel().withSecurityProfile(securityProfile); + return this; + } + + public AgentPoolImpl withGpuProfile(GPUProfile gpuProfile) { + this.innerModel().withGpuProfile(gpuProfile); + return this; + } + + public AgentPoolImpl withGatewayProfile(AgentPoolGatewayProfile gatewayProfile) { + this.innerModel().withGatewayProfile(gatewayProfile); + return this; + } + + public AgentPoolImpl withVirtualMachinesProfile(VirtualMachinesProfile virtualMachinesProfile) { + this.innerModel().withVirtualMachinesProfile(virtualMachinesProfile); + return this; + } + + public AgentPoolImpl withVirtualMachineNodesStatus(List virtualMachineNodesStatus) { + this.innerModel().withVirtualMachineNodesStatus(virtualMachineNodesStatus); + return this; + } + + public AgentPoolImpl withStatus(AgentPoolStatus status) { + this.innerModel().withStatus(status); + return this; + } + + public AgentPoolImpl withLocalDNSProfile(LocalDNSProfile localDNSProfile) { + this.innerModel().withLocalDNSProfile(localDNSProfile); + return this; + } + + public AgentPoolImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.createIfMatch = ifMatch; + return this; + } else { + this.updateIfMatch = ifMatch; + return this; + } + } + + public AgentPoolImpl withIfNoneMatch(String ifNoneMatch) { + if (isInCreateMode()) { + this.createIfNoneMatch = ifNoneMatch; + return this; + } else { + this.updateIfNoneMatch = ifNoneMatch; + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel() == null || this.innerModel().id() == null; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/AgentPoolUpgradeProfileImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/AgentPoolUpgradeProfileImpl.java new file mode 100644 index 000000000000..f4b56ad50444 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/AgentPoolUpgradeProfileImpl.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.containerservice.generated.fluent.models.AgentPoolUpgradeProfileInner; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolUpgradeProfile; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolUpgradeProfilePropertiesUpgradesItem; +import com.azure.resourcemanager.containerservice.generated.models.OSType; +import java.util.Collections; +import java.util.List; + +public final class AgentPoolUpgradeProfileImpl implements AgentPoolUpgradeProfile { + private AgentPoolUpgradeProfileInner innerObject; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + AgentPoolUpgradeProfileImpl(AgentPoolUpgradeProfileInner innerObject, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String kubernetesVersion() { + return this.innerModel().kubernetesVersion(); + } + + public OSType osType() { + return this.innerModel().osType(); + } + + public List upgrades() { + List inner = this.innerModel().upgrades(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String latestNodeImageVersion() { + return this.innerModel().latestNodeImageVersion(); + } + + public AgentPoolUpgradeProfileInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/AgentPoolsClientImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/AgentPoolsClientImpl.java new file mode 100644 index 000000000000..cb7a7251bdcb --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/AgentPoolsClientImpl.java @@ -0,0 +1,1808 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerservice.generated.fluent.AgentPoolsClient; +import com.azure.resourcemanager.containerservice.generated.fluent.models.AgentPoolAvailableVersionsInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.AgentPoolInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.AgentPoolUpgradeProfileInner; +import com.azure.resourcemanager.containerservice.generated.implementation.models.AgentPoolListResult; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolDeleteMachinesParameter; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in AgentPoolsClient. + */ +public final class AgentPoolsClientImpl implements AgentPoolsClient { + /** + * The proxy service used to perform REST calls. + */ + private final AgentPoolsService service; + + /** + * The service client containing this operation class. + */ + private final ContainerServiceManagementClientImpl client; + + /** + * Initializes an instance of AgentPoolsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AgentPoolsClientImpl(ContainerServiceManagementClientImpl client) { + this.service + = RestProxy.create(AgentPoolsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerServiceManagementClientAgentPools to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ContainerServiceManagementClientAgentPools") + public interface AgentPoolsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("agentPoolName") String agentPoolName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("agentPoolName") String agentPoolName, @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("agentPoolName") String agentPoolName, @HeaderParam("if-match") String ifMatch, + @HeaderParam("if-none-match") String ifNoneMatch, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") AgentPoolInner parameters, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("agentPoolName") String agentPoolName, @HeaderParam("if-match") String ifMatch, + @HeaderParam("if-none-match") String ifNoneMatch, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") AgentPoolInner parameters, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("agentPoolName") String agentPoolName, + @QueryParam("ignore-pod-disruption-budget") Boolean ignorePodDisruptionBudget, + @HeaderParam("if-match") String ifMatch, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("agentPoolName") String agentPoolName, + @QueryParam("ignore-pod-disruption-budget") Boolean ignorePodDisruptionBudget, + @HeaderParam("if-match") String ifMatch, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/abort") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> abortLatestOperation(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("agentPoolName") String agentPoolName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/abort") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response abortLatestOperationSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("agentPoolName") String agentPoolName, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/deleteMachines") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteMachines(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("agentPoolName") String agentPoolName, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") AgentPoolDeleteMachinesParameter machines, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/deleteMachines") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteMachinesSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("agentPoolName") String agentPoolName, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") AgentPoolDeleteMachinesParameter machines, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> upgradeNodeImageVersion(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("agentPoolName") String agentPoolName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response upgradeNodeImageVersionSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("agentPoolName") String agentPoolName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getAvailableAgentPoolVersions( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getAvailableAgentPoolVersionsSync( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getUpgradeProfile(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("agentPoolName") String agentPoolName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getUpgradeProfileSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("agentPoolName") String agentPoolName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets the specified managed cluster agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified managed cluster agent pool along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String resourceName, + String agentPoolName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, agentPoolName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified managed cluster agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified managed cluster agent pool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String resourceName, String agentPoolName) { + return getWithResponseAsync(resourceGroupName, resourceName, agentPoolName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the specified managed cluster agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified managed cluster agent pool along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String resourceName, String agentPoolName, + Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, resourceName, agentPoolName, accept, context); + } + + /** + * Gets the specified managed cluster agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified managed cluster agent pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AgentPoolInner get(String resourceGroupName, String resourceName, String agentPoolName) { + return getWithResponse(resourceGroupName, resourceName, agentPoolName, Context.NONE).getValue(); + } + + /** + * Creates or updates an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param parameters The agent pool to create or update. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param ifNoneMatch The request should only proceed if no entity matches this string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return agent Pool along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String resourceName, String agentPoolName, AgentPoolInner parameters, String ifMatch, String ifNoneMatch) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, agentPoolName, ifMatch, ifNoneMatch, + contentType, accept, parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param parameters The agent pool to create or update. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param ifNoneMatch The request should only proceed if no entity matches this string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return agent Pool along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String resourceName, + String agentPoolName, AgentPoolInner parameters, String ifMatch, String ifNoneMatch) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, agentPoolName, ifMatch, ifNoneMatch, + contentType, accept, parameters, Context.NONE); + } + + /** + * Creates or updates an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param parameters The agent pool to create or update. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param ifNoneMatch The request should only proceed if no entity matches this string. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return agent Pool along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String resourceName, + String agentPoolName, AgentPoolInner parameters, String ifMatch, String ifNoneMatch, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, agentPoolName, ifMatch, ifNoneMatch, + contentType, accept, parameters, context); + } + + /** + * Creates or updates an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param parameters The agent pool to create or update. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param ifNoneMatch The request should only proceed if no entity matches this string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of agent Pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AgentPoolInner> beginCreateOrUpdateAsync(String resourceGroupName, + String resourceName, String agentPoolName, AgentPoolInner parameters, String ifMatch, String ifNoneMatch) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, resourceName, + agentPoolName, parameters, ifMatch, ifNoneMatch); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + AgentPoolInner.class, AgentPoolInner.class, this.client.getContext()); + } + + /** + * Creates or updates an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param parameters The agent pool to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of agent Pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AgentPoolInner> beginCreateOrUpdateAsync(String resourceGroupName, + String resourceName, String agentPoolName, AgentPoolInner parameters) { + final String ifMatch = null; + final String ifNoneMatch = null; + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, resourceName, + agentPoolName, parameters, ifMatch, ifNoneMatch); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + AgentPoolInner.class, AgentPoolInner.class, this.client.getContext()); + } + + /** + * Creates or updates an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param parameters The agent pool to create or update. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param ifNoneMatch The request should only proceed if no entity matches this string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of agent Pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AgentPoolInner> beginCreateOrUpdate(String resourceGroupName, + String resourceName, String agentPoolName, AgentPoolInner parameters, String ifMatch, String ifNoneMatch) { + Response response = createOrUpdateWithResponse(resourceGroupName, resourceName, agentPoolName, + parameters, ifMatch, ifNoneMatch); + return this.client.getLroResult(response, AgentPoolInner.class, + AgentPoolInner.class, Context.NONE); + } + + /** + * Creates or updates an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param parameters The agent pool to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of agent Pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AgentPoolInner> beginCreateOrUpdate(String resourceGroupName, + String resourceName, String agentPoolName, AgentPoolInner parameters) { + final String ifMatch = null; + final String ifNoneMatch = null; + Response response = createOrUpdateWithResponse(resourceGroupName, resourceName, agentPoolName, + parameters, ifMatch, ifNoneMatch); + return this.client.getLroResult(response, AgentPoolInner.class, + AgentPoolInner.class, Context.NONE); + } + + /** + * Creates or updates an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param parameters The agent pool to create or update. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param ifNoneMatch The request should only proceed if no entity matches this string. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of agent Pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AgentPoolInner> beginCreateOrUpdate(String resourceGroupName, + String resourceName, String agentPoolName, AgentPoolInner parameters, String ifMatch, String ifNoneMatch, + Context context) { + Response response = createOrUpdateWithResponse(resourceGroupName, resourceName, agentPoolName, + parameters, ifMatch, ifNoneMatch, context); + return this.client.getLroResult(response, AgentPoolInner.class, + AgentPoolInner.class, context); + } + + /** + * Creates or updates an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param parameters The agent pool to create or update. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param ifNoneMatch The request should only proceed if no entity matches this string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return agent Pool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String resourceName, + String agentPoolName, AgentPoolInner parameters, String ifMatch, String ifNoneMatch) { + return beginCreateOrUpdateAsync(resourceGroupName, resourceName, agentPoolName, parameters, ifMatch, + ifNoneMatch).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param parameters The agent pool to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return agent Pool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String resourceName, + String agentPoolName, AgentPoolInner parameters) { + final String ifMatch = null; + final String ifNoneMatch = null; + return beginCreateOrUpdateAsync(resourceGroupName, resourceName, agentPoolName, parameters, ifMatch, + ifNoneMatch).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param parameters The agent pool to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return agent Pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AgentPoolInner createOrUpdate(String resourceGroupName, String resourceName, String agentPoolName, + AgentPoolInner parameters) { + final String ifMatch = null; + final String ifNoneMatch = null; + return beginCreateOrUpdate(resourceGroupName, resourceName, agentPoolName, parameters, ifMatch, ifNoneMatch) + .getFinalResult(); + } + + /** + * Creates or updates an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param parameters The agent pool to create or update. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param ifNoneMatch The request should only proceed if no entity matches this string. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return agent Pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AgentPoolInner createOrUpdate(String resourceGroupName, String resourceName, String agentPoolName, + AgentPoolInner parameters, String ifMatch, String ifNoneMatch, Context context) { + return beginCreateOrUpdate(resourceGroupName, resourceName, agentPoolName, parameters, ifMatch, ifNoneMatch, + context).getFinalResult(); + } + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param ignorePodDisruptionBudget ignore-pod-disruption-budget=true to delete those pods on a node without + * considering Pod Disruption Budget. + * @param ifMatch The request should only proceed if an entity matches this string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String resourceName, + String agentPoolName, Boolean ignorePodDisruptionBudget, String ifMatch) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, agentPoolName, + ignorePodDisruptionBudget, ifMatch, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param ignorePodDisruptionBudget ignore-pod-disruption-budget=true to delete those pods on a node without + * considering Pod Disruption Budget. + * @param ifMatch The request should only proceed if an entity matches this string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String resourceName, String agentPoolName, + Boolean ignorePodDisruptionBudget, String ifMatch) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, agentPoolName, ignorePodDisruptionBudget, + ifMatch, Context.NONE); + } + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param ignorePodDisruptionBudget ignore-pod-disruption-budget=true to delete those pods on a node without + * considering Pod Disruption Budget. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String resourceName, String agentPoolName, + Boolean ignorePodDisruptionBudget, String ifMatch, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, agentPoolName, ignorePodDisruptionBudget, + ifMatch, context); + } + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param ignorePodDisruptionBudget ignore-pod-disruption-budget=true to delete those pods on a node without + * considering Pod Disruption Budget. + * @param ifMatch The request should only proceed if an entity matches this string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String resourceName, + String agentPoolName, Boolean ignorePodDisruptionBudget, String ifMatch) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName, agentPoolName, + ignorePodDisruptionBudget, ifMatch); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String resourceName, + String agentPoolName) { + final Boolean ignorePodDisruptionBudget = null; + final String ifMatch = null; + Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName, agentPoolName, + ignorePodDisruptionBudget, ifMatch); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param ignorePodDisruptionBudget ignore-pod-disruption-budget=true to delete those pods on a node without + * considering Pod Disruption Budget. + * @param ifMatch The request should only proceed if an entity matches this string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, + String agentPoolName, Boolean ignorePodDisruptionBudget, String ifMatch) { + Response response + = deleteWithResponse(resourceGroupName, resourceName, agentPoolName, ignorePodDisruptionBudget, ifMatch); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, + String agentPoolName) { + final Boolean ignorePodDisruptionBudget = null; + final String ifMatch = null; + Response response + = deleteWithResponse(resourceGroupName, resourceName, agentPoolName, ignorePodDisruptionBudget, ifMatch); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param ignorePodDisruptionBudget ignore-pod-disruption-budget=true to delete those pods on a node without + * considering Pod Disruption Budget. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, + String agentPoolName, Boolean ignorePodDisruptionBudget, String ifMatch, Context context) { + Response response = deleteWithResponse(resourceGroupName, resourceName, agentPoolName, + ignorePodDisruptionBudget, ifMatch, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param ignorePodDisruptionBudget ignore-pod-disruption-budget=true to delete those pods on a node without + * considering Pod Disruption Budget. + * @param ifMatch The request should only proceed if an entity matches this string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String resourceName, String agentPoolName, + Boolean ignorePodDisruptionBudget, String ifMatch) { + return beginDeleteAsync(resourceGroupName, resourceName, agentPoolName, ignorePodDisruptionBudget, ifMatch) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String resourceName, String agentPoolName) { + final Boolean ignorePodDisruptionBudget = null; + final String ifMatch = null; + return beginDeleteAsync(resourceGroupName, resourceName, agentPoolName, ignorePodDisruptionBudget, ifMatch) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String resourceName, String agentPoolName) { + final Boolean ignorePodDisruptionBudget = null; + final String ifMatch = null; + beginDelete(resourceGroupName, resourceName, agentPoolName, ignorePodDisruptionBudget, ifMatch) + .getFinalResult(); + } + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param ignorePodDisruptionBudget ignore-pod-disruption-budget=true to delete those pods on a node without + * considering Pod Disruption Budget. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String resourceName, String agentPoolName, + Boolean ignorePodDisruptionBudget, String ifMatch, Context context) { + beginDelete(resourceGroupName, resourceName, agentPoolName, ignorePodDisruptionBudget, ifMatch, context) + .getFinalResult(); + } + + /** + * Gets a list of agent pools in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of agent pools in the specified managed cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String resourceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of agent pools in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of agent pools in the specified managed cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String resourceName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, resourceName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of agent pools in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of agent pools in the specified managed cluster along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String resourceName) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets a list of agent pools in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of agent pools in the specified managed cluster along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String resourceName, + Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets a list of agent pools in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of agent pools in the specified managed cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String resourceName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, resourceName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Gets a list of agent pools in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of agent pools in the specified managed cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String resourceName, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, resourceName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Aborts last operation running on agent pool. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> abortLatestOperationWithResponseAsync(String resourceGroupName, + String resourceName, String agentPoolName) { + return FluxUtil + .withContext(context -> service.abortLatestOperation(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, agentPoolName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Aborts last operation running on agent pool. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response abortLatestOperationWithResponse(String resourceGroupName, String resourceName, + String agentPoolName) { + return service.abortLatestOperationSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, agentPoolName, Context.NONE); + } + + /** + * Aborts last operation running on agent pool. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response abortLatestOperationWithResponse(String resourceGroupName, String resourceName, + String agentPoolName, Context context) { + return service.abortLatestOperationSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, agentPoolName, context); + } + + /** + * Aborts last operation running on agent pool. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginAbortLatestOperationAsync(String resourceGroupName, + String resourceName, String agentPoolName) { + Mono>> mono + = abortLatestOperationWithResponseAsync(resourceGroupName, resourceName, agentPoolName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Aborts last operation running on agent pool. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginAbortLatestOperation(String resourceGroupName, String resourceName, + String agentPoolName) { + Response response + = abortLatestOperationWithResponse(resourceGroupName, resourceName, agentPoolName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Aborts last operation running on agent pool. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginAbortLatestOperation(String resourceGroupName, String resourceName, + String agentPoolName, Context context) { + Response response + = abortLatestOperationWithResponse(resourceGroupName, resourceName, agentPoolName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Aborts last operation running on agent pool. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono abortLatestOperationAsync(String resourceGroupName, String resourceName, String agentPoolName) { + return beginAbortLatestOperationAsync(resourceGroupName, resourceName, agentPoolName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Aborts last operation running on agent pool. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void abortLatestOperation(String resourceGroupName, String resourceName, String agentPoolName) { + beginAbortLatestOperation(resourceGroupName, resourceName, agentPoolName).getFinalResult(); + } + + /** + * Aborts last operation running on agent pool. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void abortLatestOperation(String resourceGroupName, String resourceName, String agentPoolName, + Context context) { + beginAbortLatestOperation(resourceGroupName, resourceName, agentPoolName, context).getFinalResult(); + } + + /** + * Deletes specific machines in an agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param machines A list of machines from the agent pool to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteMachinesWithResponseAsync(String resourceGroupName, + String resourceName, String agentPoolName, AgentPoolDeleteMachinesParameter machines) { + final String contentType = "application/json"; + return FluxUtil + .withContext(context -> service.deleteMachines(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, agentPoolName, contentType, machines, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes specific machines in an agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param machines A list of machines from the agent pool to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteMachinesWithResponse(String resourceGroupName, String resourceName, + String agentPoolName, AgentPoolDeleteMachinesParameter machines) { + final String contentType = "application/json"; + return service.deleteMachinesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, agentPoolName, contentType, machines, + Context.NONE); + } + + /** + * Deletes specific machines in an agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param machines A list of machines from the agent pool to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteMachinesWithResponse(String resourceGroupName, String resourceName, + String agentPoolName, AgentPoolDeleteMachinesParameter machines, Context context) { + final String contentType = "application/json"; + return service.deleteMachinesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, agentPoolName, contentType, machines, + context); + } + + /** + * Deletes specific machines in an agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param machines A list of machines from the agent pool to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteMachinesAsync(String resourceGroupName, String resourceName, + String agentPoolName, AgentPoolDeleteMachinesParameter machines) { + Mono>> mono + = deleteMachinesWithResponseAsync(resourceGroupName, resourceName, agentPoolName, machines); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes specific machines in an agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param machines A list of machines from the agent pool to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeleteMachines(String resourceGroupName, String resourceName, + String agentPoolName, AgentPoolDeleteMachinesParameter machines) { + Response response + = deleteMachinesWithResponse(resourceGroupName, resourceName, agentPoolName, machines); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Deletes specific machines in an agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param machines A list of machines from the agent pool to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeleteMachines(String resourceGroupName, String resourceName, + String agentPoolName, AgentPoolDeleteMachinesParameter machines, Context context) { + Response response + = deleteMachinesWithResponse(resourceGroupName, resourceName, agentPoolName, machines, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Deletes specific machines in an agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param machines A list of machines from the agent pool to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteMachinesAsync(String resourceGroupName, String resourceName, String agentPoolName, + AgentPoolDeleteMachinesParameter machines) { + return beginDeleteMachinesAsync(resourceGroupName, resourceName, agentPoolName, machines).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes specific machines in an agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param machines A list of machines from the agent pool to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteMachines(String resourceGroupName, String resourceName, String agentPoolName, + AgentPoolDeleteMachinesParameter machines) { + beginDeleteMachines(resourceGroupName, resourceName, agentPoolName, machines).getFinalResult(); + } + + /** + * Deletes specific machines in an agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param machines A list of machines from the agent pool to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteMachines(String resourceGroupName, String resourceName, String agentPoolName, + AgentPoolDeleteMachinesParameter machines, Context context) { + beginDeleteMachines(resourceGroupName, resourceName, agentPoolName, machines, context).getFinalResult(); + } + + /** + * Upgrades the node image version of an agent pool to the latest. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return agent Pool along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> upgradeNodeImageVersionWithResponseAsync(String resourceGroupName, + String resourceName, String agentPoolName) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.upgradeNodeImageVersion(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, agentPoolName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Upgrades the node image version of an agent pool to the latest. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return agent Pool along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response upgradeNodeImageVersionWithResponse(String resourceGroupName, String resourceName, + String agentPoolName) { + final String accept = "application/json"; + return service.upgradeNodeImageVersionSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, agentPoolName, accept, Context.NONE); + } + + /** + * Upgrades the node image version of an agent pool to the latest. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return agent Pool along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response upgradeNodeImageVersionWithResponse(String resourceGroupName, String resourceName, + String agentPoolName, Context context) { + final String accept = "application/json"; + return service.upgradeNodeImageVersionSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, agentPoolName, accept, context); + } + + /** + * Upgrades the node image version of an agent pool to the latest. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of agent Pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginUpgradeNodeImageVersionAsync(String resourceGroupName, + String resourceName, String agentPoolName) { + Mono>> mono + = upgradeNodeImageVersionWithResponseAsync(resourceGroupName, resourceName, agentPoolName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Upgrades the node image version of an agent pool to the latest. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of agent Pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginUpgradeNodeImageVersion(String resourceGroupName, + String resourceName, String agentPoolName) { + Response response + = upgradeNodeImageVersionWithResponse(resourceGroupName, resourceName, agentPoolName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Upgrades the node image version of an agent pool to the latest. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of agent Pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginUpgradeNodeImageVersion(String resourceGroupName, + String resourceName, String agentPoolName, Context context) { + Response response + = upgradeNodeImageVersionWithResponse(resourceGroupName, resourceName, agentPoolName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Upgrades the node image version of an agent pool to the latest. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return agent Pool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono upgradeNodeImageVersionAsync(String resourceGroupName, String resourceName, + String agentPoolName) { + return beginUpgradeNodeImageVersionAsync(resourceGroupName, resourceName, agentPoolName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Upgrades the node image version of an agent pool to the latest. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void upgradeNodeImageVersion(String resourceGroupName, String resourceName, String agentPoolName) { + beginUpgradeNodeImageVersion(resourceGroupName, resourceName, agentPoolName).getFinalResult(); + } + + /** + * Upgrades the node image version of an agent pool to the latest. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void upgradeNodeImageVersion(String resourceGroupName, String resourceName, String agentPoolName, + Context context) { + beginUpgradeNodeImageVersion(resourceGroupName, resourceName, agentPoolName, context).getFinalResult(); + } + + /** + * Gets a list of supported Kubernetes versions for the specified agent pool. + * + * See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more + * details about the version lifecycle. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of supported Kubernetes versions for the specified agent pool. + * + * See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more + * details about the version lifecycle along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getAvailableAgentPoolVersionsWithResponseAsync(String resourceGroupName, String resourceName) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.getAvailableAgentPoolVersions(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of supported Kubernetes versions for the specified agent pool. + * + * See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more + * details about the version lifecycle. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of supported Kubernetes versions for the specified agent pool. + * + * See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more + * details about the version lifecycle on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAvailableAgentPoolVersionsAsync(String resourceGroupName, + String resourceName) { + return getAvailableAgentPoolVersionsWithResponseAsync(resourceGroupName, resourceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a list of supported Kubernetes versions for the specified agent pool. + * + * See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more + * details about the version lifecycle. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of supported Kubernetes versions for the specified agent pool. + * + * See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more + * details about the version lifecycle along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAvailableAgentPoolVersionsWithResponse(String resourceGroupName, + String resourceName, Context context) { + final String accept = "application/json"; + return service.getAvailableAgentPoolVersionsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context); + } + + /** + * Gets a list of supported Kubernetes versions for the specified agent pool. + * + * See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more + * details about the version lifecycle. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of supported Kubernetes versions for the specified agent pool. + * + * See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more + * details about the version lifecycle. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AgentPoolAvailableVersionsInner getAvailableAgentPoolVersions(String resourceGroupName, + String resourceName) { + return getAvailableAgentPoolVersionsWithResponse(resourceGroupName, resourceName, Context.NONE).getValue(); + } + + /** + * Gets the upgrade profile for an agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upgrade profile for an agent pool along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getUpgradeProfileWithResponseAsync(String resourceGroupName, + String resourceName, String agentPoolName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getUpgradeProfile(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, agentPoolName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the upgrade profile for an agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upgrade profile for an agent pool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getUpgradeProfileAsync(String resourceGroupName, String resourceName, + String agentPoolName) { + return getUpgradeProfileWithResponseAsync(resourceGroupName, resourceName, agentPoolName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the upgrade profile for an agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upgrade profile for an agent pool along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getUpgradeProfileWithResponse(String resourceGroupName, + String resourceName, String agentPoolName, Context context) { + final String accept = "application/json"; + return service.getUpgradeProfileSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, agentPoolName, accept, context); + } + + /** + * Gets the upgrade profile for an agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upgrade profile for an agent pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AgentPoolUpgradeProfileInner getUpgradeProfile(String resourceGroupName, String resourceName, + String agentPoolName) { + return getUpgradeProfileWithResponse(resourceGroupName, resourceName, agentPoolName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of agent pools in the specified managed cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of agent pools in the specified managed cluster along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of agent pools in the specified managed cluster along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/AgentPoolsImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/AgentPoolsImpl.java new file mode 100644 index 000000000000..0294fd6ec53c --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/AgentPoolsImpl.java @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerservice.generated.fluent.AgentPoolsClient; +import com.azure.resourcemanager.containerservice.generated.fluent.models.AgentPoolAvailableVersionsInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.AgentPoolInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.AgentPoolUpgradeProfileInner; +import com.azure.resourcemanager.containerservice.generated.models.AgentPool; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolAvailableVersions; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolDeleteMachinesParameter; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolUpgradeProfile; +import com.azure.resourcemanager.containerservice.generated.models.AgentPools; + +public final class AgentPoolsImpl implements AgentPools { + private static final ClientLogger LOGGER = new ClientLogger(AgentPoolsImpl.class); + + private final AgentPoolsClient innerClient; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + public AgentPoolsImpl(AgentPoolsClient innerClient, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String resourceName, String agentPoolName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, resourceName, agentPoolName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AgentPoolImpl(inner.getValue(), this.manager())); + } + + public AgentPool get(String resourceGroupName, String resourceName, String agentPoolName) { + AgentPoolInner inner = this.serviceClient().get(resourceGroupName, resourceName, agentPoolName); + if (inner != null) { + return new AgentPoolImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String resourceName, String agentPoolName) { + this.serviceClient().delete(resourceGroupName, resourceName, agentPoolName); + } + + public void delete(String resourceGroupName, String resourceName, String agentPoolName, + Boolean ignorePodDisruptionBudget, String ifMatch, Context context) { + this.serviceClient() + .delete(resourceGroupName, resourceName, agentPoolName, ignorePodDisruptionBudget, ifMatch, context); + } + + public PagedIterable list(String resourceGroupName, String resourceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, resourceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AgentPoolImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String resourceName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, resourceName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AgentPoolImpl(inner1, this.manager())); + } + + public void abortLatestOperation(String resourceGroupName, String resourceName, String agentPoolName) { + this.serviceClient().abortLatestOperation(resourceGroupName, resourceName, agentPoolName); + } + + public void abortLatestOperation(String resourceGroupName, String resourceName, String agentPoolName, + Context context) { + this.serviceClient().abortLatestOperation(resourceGroupName, resourceName, agentPoolName, context); + } + + public void deleteMachines(String resourceGroupName, String resourceName, String agentPoolName, + AgentPoolDeleteMachinesParameter machines) { + this.serviceClient().deleteMachines(resourceGroupName, resourceName, agentPoolName, machines); + } + + public void deleteMachines(String resourceGroupName, String resourceName, String agentPoolName, + AgentPoolDeleteMachinesParameter machines, Context context) { + this.serviceClient().deleteMachines(resourceGroupName, resourceName, agentPoolName, machines, context); + } + + public void upgradeNodeImageVersion(String resourceGroupName, String resourceName, String agentPoolName) { + this.serviceClient().upgradeNodeImageVersion(resourceGroupName, resourceName, agentPoolName); + } + + public void upgradeNodeImageVersion(String resourceGroupName, String resourceName, String agentPoolName, + Context context) { + this.serviceClient().upgradeNodeImageVersion(resourceGroupName, resourceName, agentPoolName, context); + } + + public Response getAvailableAgentPoolVersionsWithResponse(String resourceGroupName, + String resourceName, Context context) { + Response inner + = this.serviceClient().getAvailableAgentPoolVersionsWithResponse(resourceGroupName, resourceName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AgentPoolAvailableVersionsImpl(inner.getValue(), this.manager())); + } + + public AgentPoolAvailableVersions getAvailableAgentPoolVersions(String resourceGroupName, String resourceName) { + AgentPoolAvailableVersionsInner inner + = this.serviceClient().getAvailableAgentPoolVersions(resourceGroupName, resourceName); + if (inner != null) { + return new AgentPoolAvailableVersionsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getUpgradeProfileWithResponse(String resourceGroupName, + String resourceName, String agentPoolName, Context context) { + Response inner = this.serviceClient() + .getUpgradeProfileWithResponse(resourceGroupName, resourceName, agentPoolName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AgentPoolUpgradeProfileImpl(inner.getValue(), this.manager())); + } + + public AgentPoolUpgradeProfile getUpgradeProfile(String resourceGroupName, String resourceName, + String agentPoolName) { + AgentPoolUpgradeProfileInner inner + = this.serviceClient().getUpgradeProfile(resourceGroupName, resourceName, agentPoolName); + if (inner != null) { + return new AgentPoolUpgradeProfileImpl(inner, this.manager()); + } else { + return null; + } + } + + public AgentPool getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = ResourceManagerUtils.getValueFromIdByName(id, "managedClusters"); + if (resourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedClusters'.", id))); + } + String agentPoolName = ResourceManagerUtils.getValueFromIdByName(id, "agentPools"); + if (agentPoolName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'agentPools'.", id))); + } + return this.getWithResponse(resourceGroupName, resourceName, agentPoolName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = ResourceManagerUtils.getValueFromIdByName(id, "managedClusters"); + if (resourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedClusters'.", id))); + } + String agentPoolName = ResourceManagerUtils.getValueFromIdByName(id, "agentPools"); + if (agentPoolName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'agentPools'.", id))); + } + return this.getWithResponse(resourceGroupName, resourceName, agentPoolName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = ResourceManagerUtils.getValueFromIdByName(id, "managedClusters"); + if (resourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedClusters'.", id))); + } + String agentPoolName = ResourceManagerUtils.getValueFromIdByName(id, "agentPools"); + if (agentPoolName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'agentPools'.", id))); + } + Boolean localIgnorePodDisruptionBudget = null; + String localIfMatch = null; + this.delete(resourceGroupName, resourceName, agentPoolName, localIgnorePodDisruptionBudget, localIfMatch, + Context.NONE); + } + + public void deleteByIdWithResponse(String id, Boolean ignorePodDisruptionBudget, String ifMatch, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = ResourceManagerUtils.getValueFromIdByName(id, "managedClusters"); + if (resourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedClusters'.", id))); + } + String agentPoolName = ResourceManagerUtils.getValueFromIdByName(id, "agentPools"); + if (agentPoolName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'agentPools'.", id))); + } + this.delete(resourceGroupName, resourceName, agentPoolName, ignorePodDisruptionBudget, ifMatch, context); + } + + private AgentPoolsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } + + public AgentPoolImpl define(String name) { + return new AgentPoolImpl(name, this.manager()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ContainerServiceManagementClientBuilder.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ContainerServiceManagementClientBuilder.java new file mode 100644 index 000000000000..a7c7f5f3a6ea --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ContainerServiceManagementClientBuilder.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** + * A builder for creating a new instance of the ContainerServiceManagementClientImpl type. + */ +@ServiceClientBuilder(serviceClients = { ContainerServiceManagementClientImpl.class }) +public final class ContainerServiceManagementClientBuilder { + /* + * Service host + */ + private String endpoint; + + /** + * Sets Service host. + * + * @param endpoint the endpoint value. + * @return the ContainerServiceManagementClientBuilder. + */ + public ContainerServiceManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The ID of the target subscription. The value must be an UUID. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. The value must be an UUID. + * + * @param subscriptionId the subscriptionId value. + * @return the ContainerServiceManagementClientBuilder. + */ + public ContainerServiceManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the ContainerServiceManagementClientBuilder. + */ + public ContainerServiceManagementClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the ContainerServiceManagementClientBuilder. + */ + public ContainerServiceManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the ContainerServiceManagementClientBuilder. + */ + public ContainerServiceManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the ContainerServiceManagementClientBuilder. + */ + public ContainerServiceManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of ContainerServiceManagementClientImpl with the provided parameters. + * + * @return an instance of ContainerServiceManagementClientImpl. + */ + public ContainerServiceManagementClientImpl buildClient() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval + = (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + ContainerServiceManagementClientImpl client = new ContainerServiceManagementClientImpl(localPipeline, + localSerializerAdapter, localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); + return client; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ContainerServiceManagementClientImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ContainerServiceManagementClientImpl.java new file mode 100644 index 000000000000..0d7df5db9d34 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ContainerServiceManagementClientImpl.java @@ -0,0 +1,484 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.management.polling.SyncPollerFactory; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.containerservice.generated.fluent.AgentPoolsClient; +import com.azure.resourcemanager.containerservice.generated.fluent.ContainerServiceManagementClient; +import com.azure.resourcemanager.containerservice.generated.fluent.MachinesClient; +import com.azure.resourcemanager.containerservice.generated.fluent.MaintenanceConfigurationsClient; +import com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient; +import com.azure.resourcemanager.containerservice.generated.fluent.ManagedNamespacesClient; +import com.azure.resourcemanager.containerservice.generated.fluent.OperationsClient; +import com.azure.resourcemanager.containerservice.generated.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.containerservice.generated.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.containerservice.generated.fluent.ResolvePrivateLinkServiceIdsClient; +import com.azure.resourcemanager.containerservice.generated.fluent.SnapshotsClient; +import com.azure.resourcemanager.containerservice.generated.fluent.TrustedAccessRoleBindingsClient; +import com.azure.resourcemanager.containerservice.generated.fluent.TrustedAccessRolesClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the ContainerServiceManagementClientImpl type. + */ +@ServiceClient(builder = ContainerServiceManagementClientBuilder.class) +public final class ContainerServiceManagementClientImpl implements ContainerServiceManagementClient { + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** + * Version parameter. + */ + private final String apiVersion; + + /** + * Gets Version parameter. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** + * The ID of the target subscription. The value must be an UUID. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** + * The HTTP pipeline to send requests through. + */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** + * The serializer to serialize an object into a string. + */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** + * The default poll interval for long-running operation. + */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** + * The AgentPoolsClient object to access its operations. + */ + private final AgentPoolsClient agentPools; + + /** + * Gets the AgentPoolsClient object to access its operations. + * + * @return the AgentPoolsClient object. + */ + public AgentPoolsClient getAgentPools() { + return this.agentPools; + } + + /** + * The ManagedClustersClient object to access its operations. + */ + private final ManagedClustersClient managedClusters; + + /** + * Gets the ManagedClustersClient object to access its operations. + * + * @return the ManagedClustersClient object. + */ + public ManagedClustersClient getManagedClusters() { + return this.managedClusters; + } + + /** + * The MaintenanceConfigurationsClient object to access its operations. + */ + private final MaintenanceConfigurationsClient maintenanceConfigurations; + + /** + * Gets the MaintenanceConfigurationsClient object to access its operations. + * + * @return the MaintenanceConfigurationsClient object. + */ + public MaintenanceConfigurationsClient getMaintenanceConfigurations() { + return this.maintenanceConfigurations; + } + + /** + * The ManagedNamespacesClient object to access its operations. + */ + private final ManagedNamespacesClient managedNamespaces; + + /** + * Gets the ManagedNamespacesClient object to access its operations. + * + * @return the ManagedNamespacesClient object. + */ + public ManagedNamespacesClient getManagedNamespaces() { + return this.managedNamespaces; + } + + /** + * The MachinesClient object to access its operations. + */ + private final MachinesClient machines; + + /** + * Gets the MachinesClient object to access its operations. + * + * @return the MachinesClient object. + */ + public MachinesClient getMachines() { + return this.machines; + } + + /** + * The PrivateEndpointConnectionsClient object to access its operations. + */ + private final PrivateEndpointConnectionsClient privateEndpointConnections; + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * The SnapshotsClient object to access its operations. + */ + private final SnapshotsClient snapshots; + + /** + * Gets the SnapshotsClient object to access its operations. + * + * @return the SnapshotsClient object. + */ + public SnapshotsClient getSnapshots() { + return this.snapshots; + } + + /** + * The TrustedAccessRoleBindingsClient object to access its operations. + */ + private final TrustedAccessRoleBindingsClient trustedAccessRoleBindings; + + /** + * Gets the TrustedAccessRoleBindingsClient object to access its operations. + * + * @return the TrustedAccessRoleBindingsClient object. + */ + public TrustedAccessRoleBindingsClient getTrustedAccessRoleBindings() { + return this.trustedAccessRoleBindings; + } + + /** + * The OperationsClient object to access its operations. + */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** + * The PrivateLinkResourcesClient object to access its operations. + */ + private final PrivateLinkResourcesClient privateLinkResources; + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + public PrivateLinkResourcesClient getPrivateLinkResources() { + return this.privateLinkResources; + } + + /** + * The ResolvePrivateLinkServiceIdsClient object to access its operations. + */ + private final ResolvePrivateLinkServiceIdsClient resolvePrivateLinkServiceIds; + + /** + * Gets the ResolvePrivateLinkServiceIdsClient object to access its operations. + * + * @return the ResolvePrivateLinkServiceIdsClient object. + */ + public ResolvePrivateLinkServiceIdsClient getResolvePrivateLinkServiceIds() { + return this.resolvePrivateLinkServiceIds; + } + + /** + * The TrustedAccessRolesClient object to access its operations. + */ + private final TrustedAccessRolesClient trustedAccessRoles; + + /** + * Gets the TrustedAccessRolesClient object to access its operations. + * + * @return the TrustedAccessRolesClient object. + */ + public TrustedAccessRolesClient getTrustedAccessRoles() { + return this.trustedAccessRoles; + } + + /** + * Initializes an instance of ContainerServiceManagementClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param endpoint Service host. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. + */ + ContainerServiceManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.endpoint = endpoint; + this.subscriptionId = subscriptionId; + this.apiVersion = "2026-01-01"; + this.agentPools = new AgentPoolsClientImpl(this); + this.managedClusters = new ManagedClustersClientImpl(this); + this.maintenanceConfigurations = new MaintenanceConfigurationsClientImpl(this); + this.managedNamespaces = new ManagedNamespacesClientImpl(this); + this.machines = new MachinesClientImpl(this); + this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); + this.snapshots = new SnapshotsClientImpl(this); + this.trustedAccessRoleBindings = new TrustedAccessRoleBindingsClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); + this.resolvePrivateLinkServiceIds = new ResolvePrivateLinkServiceIdsClientImpl(this); + this.trustedAccessRoles = new TrustedAccessRolesClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + return CoreUtils.mergeContexts(this.getContext(), context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult(Mono>> activationResponse, + HttpPipeline httpPipeline, Type pollResultType, Type finalResultType, Context context) { + return PollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, activationResponse, context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return SyncPoller for poll result and final result. + */ + public SyncPoller, U> getLroResult(Response activationResponse, + Type pollResultType, Type finalResultType, Context context) { + return SyncPollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, () -> activationResponse, context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = new HttpResponseImpl(lroError.getResponseStatusCode(), lroError.getResponseHeaders(), + lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = this.getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + LOGGER.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(HttpHeaderName.fromString(s)); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ContainerServiceManagementClientImpl.class); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/CredentialResultsImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/CredentialResultsImpl.java new file mode 100644 index 000000000000..e79be1684520 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/CredentialResultsImpl.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.CredentialResultsInner; +import com.azure.resourcemanager.containerservice.generated.models.CredentialResult; +import com.azure.resourcemanager.containerservice.generated.models.CredentialResults; +import java.util.Collections; +import java.util.List; + +public final class CredentialResultsImpl implements CredentialResults { + private CredentialResultsInner innerObject; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + CredentialResultsImpl(CredentialResultsInner innerObject, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List kubeconfigs() { + List inner = this.innerModel().kubeconfigs(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public CredentialResultsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/KubernetesVersionListResultImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/KubernetesVersionListResultImpl.java new file mode 100644 index 000000000000..e939562cec1c --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/KubernetesVersionListResultImpl.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.KubernetesVersionListResultInner; +import com.azure.resourcemanager.containerservice.generated.models.KubernetesVersion; +import com.azure.resourcemanager.containerservice.generated.models.KubernetesVersionListResult; +import java.util.Collections; +import java.util.List; + +public final class KubernetesVersionListResultImpl implements KubernetesVersionListResult { + private KubernetesVersionListResultInner innerObject; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + KubernetesVersionListResultImpl(KubernetesVersionListResultInner innerObject, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List values() { + List inner = this.innerModel().values(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public KubernetesVersionListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MachineImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MachineImpl.java new file mode 100644 index 000000000000..f0851552e5a2 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MachineImpl.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.containerservice.generated.fluent.models.MachineInner; +import com.azure.resourcemanager.containerservice.generated.models.Machine; +import com.azure.resourcemanager.containerservice.generated.models.MachineProperties; +import java.util.Collections; +import java.util.List; + +public final class MachineImpl implements Machine { + private MachineInner innerObject; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + MachineImpl(MachineInner innerObject, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public MachineProperties properties() { + return this.innerModel().properties(); + } + + public List zones() { + List inner = this.innerModel().zones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public MachineInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MachinesClientImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MachinesClientImpl.java new file mode 100644 index 000000000000..70a9c2f08693 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MachinesClientImpl.java @@ -0,0 +1,372 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.containerservice.generated.fluent.MachinesClient; +import com.azure.resourcemanager.containerservice.generated.fluent.models.MachineInner; +import com.azure.resourcemanager.containerservice.generated.implementation.models.MachineListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in MachinesClient. + */ +public final class MachinesClientImpl implements MachinesClient { + /** + * The proxy service used to perform REST calls. + */ + private final MachinesService service; + + /** + * The service client containing this operation class. + */ + private final ContainerServiceManagementClientImpl client; + + /** + * Initializes an instance of MachinesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + MachinesClientImpl(ContainerServiceManagementClientImpl client) { + this.service = RestProxy.create(MachinesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerServiceManagementClientMachines to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ContainerServiceManagementClientMachines") + public interface MachinesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines/{machineName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("agentPoolName") String agentPoolName, @PathParam("machineName") String machineName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines/{machineName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("agentPoolName") String agentPoolName, @PathParam("machineName") String machineName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("agentPoolName") String agentPoolName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("agentPoolName") String agentPoolName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a specific machine in the specified agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param machineName Host name of the machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific machine in the specified agent pool along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String resourceName, + String agentPoolName, String machineName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, agentPoolName, machineName, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a specific machine in the specified agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param machineName Host name of the machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific machine in the specified agent pool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String resourceName, String agentPoolName, + String machineName) { + return getWithResponseAsync(resourceGroupName, resourceName, agentPoolName, machineName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a specific machine in the specified agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param machineName Host name of the machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific machine in the specified agent pool along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String resourceName, String agentPoolName, + String machineName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, resourceName, agentPoolName, machineName, accept, context); + } + + /** + * Get a specific machine in the specified agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param machineName Host name of the machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific machine in the specified agent pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MachineInner get(String resourceGroupName, String resourceName, String agentPoolName, String machineName) { + return getWithResponse(resourceGroupName, resourceName, agentPoolName, machineName, Context.NONE).getValue(); + } + + /** + * Gets a list of machines in the specified agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of machines in the specified agent pool along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String resourceName, + String agentPoolName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, agentPoolName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of machines in the specified agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of machines in the specified agent pool as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String resourceName, String agentPoolName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, resourceName, agentPoolName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of machines in the specified agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of machines in the specified agent pool along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String resourceName, + String agentPoolName) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, agentPoolName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets a list of machines in the specified agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of machines in the specified agent pool along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String resourceName, + String agentPoolName, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, agentPoolName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets a list of machines in the specified agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of machines in the specified agent pool as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String resourceName, String agentPoolName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, resourceName, agentPoolName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Gets a list of machines in the specified agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of machines in the specified agent pool as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String resourceName, String agentPoolName, + Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, resourceName, agentPoolName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of machines in the specified agent pool along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of machines in the specified agent pool along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of machines in the specified agent pool along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MachinesImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MachinesImpl.java new file mode 100644 index 000000000000..411d74bd8574 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MachinesImpl.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerservice.generated.fluent.MachinesClient; +import com.azure.resourcemanager.containerservice.generated.fluent.models.MachineInner; +import com.azure.resourcemanager.containerservice.generated.models.Machine; +import com.azure.resourcemanager.containerservice.generated.models.Machines; + +public final class MachinesImpl implements Machines { + private static final ClientLogger LOGGER = new ClientLogger(MachinesImpl.class); + + private final MachinesClient innerClient; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + public MachinesImpl(MachinesClient innerClient, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String resourceName, String agentPoolName, + String machineName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, resourceName, agentPoolName, machineName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new MachineImpl(inner.getValue(), this.manager())); + } + + public Machine get(String resourceGroupName, String resourceName, String agentPoolName, String machineName) { + MachineInner inner = this.serviceClient().get(resourceGroupName, resourceName, agentPoolName, machineName); + if (inner != null) { + return new MachineImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String resourceName, String agentPoolName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, resourceName, agentPoolName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MachineImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String resourceName, String agentPoolName, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, resourceName, agentPoolName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MachineImpl(inner1, this.manager())); + } + + private MachinesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MaintenanceConfigurationImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MaintenanceConfigurationImpl.java new file mode 100644 index 000000000000..c902d2393f5c --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MaintenanceConfigurationImpl.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.fluent.models.MaintenanceConfigurationInner; +import com.azure.resourcemanager.containerservice.generated.models.MaintenanceConfiguration; +import com.azure.resourcemanager.containerservice.generated.models.MaintenanceWindow; +import com.azure.resourcemanager.containerservice.generated.models.TimeInWeek; +import com.azure.resourcemanager.containerservice.generated.models.TimeSpan; +import java.util.Collections; +import java.util.List; + +public final class MaintenanceConfigurationImpl + implements MaintenanceConfiguration, MaintenanceConfiguration.Definition, MaintenanceConfiguration.Update { + private MaintenanceConfigurationInner innerObject; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public List timeInWeek() { + List inner = this.innerModel().timeInWeek(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List notAllowedTime() { + List inner = this.innerModel().notAllowedTime(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public MaintenanceWindow maintenanceWindow() { + return this.innerModel().maintenanceWindow(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public MaintenanceConfigurationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String resourceName; + + private String configName; + + public MaintenanceConfigurationImpl withExistingManagedCluster(String resourceGroupName, String resourceName) { + this.resourceGroupName = resourceGroupName; + this.resourceName = resourceName; + return this; + } + + public MaintenanceConfiguration create() { + this.innerObject = serviceManager.serviceClient() + .getMaintenanceConfigurations() + .createOrUpdateWithResponse(resourceGroupName, resourceName, configName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public MaintenanceConfiguration create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getMaintenanceConfigurations() + .createOrUpdateWithResponse(resourceGroupName, resourceName, configName, this.innerModel(), context) + .getValue(); + return this; + } + + MaintenanceConfigurationImpl(String name, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = new MaintenanceConfigurationInner(); + this.serviceManager = serviceManager; + this.configName = name; + } + + public MaintenanceConfigurationImpl update() { + return this; + } + + public MaintenanceConfiguration apply() { + this.innerObject = serviceManager.serviceClient() + .getMaintenanceConfigurations() + .createOrUpdateWithResponse(resourceGroupName, resourceName, configName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public MaintenanceConfiguration apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getMaintenanceConfigurations() + .createOrUpdateWithResponse(resourceGroupName, resourceName, configName, this.innerModel(), context) + .getValue(); + return this; + } + + MaintenanceConfigurationImpl(MaintenanceConfigurationInner innerObject, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.resourceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "managedClusters"); + this.configName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "maintenanceConfigurations"); + } + + public MaintenanceConfiguration refresh() { + this.innerObject = serviceManager.serviceClient() + .getMaintenanceConfigurations() + .getWithResponse(resourceGroupName, resourceName, configName, Context.NONE) + .getValue(); + return this; + } + + public MaintenanceConfiguration refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getMaintenanceConfigurations() + .getWithResponse(resourceGroupName, resourceName, configName, context) + .getValue(); + return this; + } + + public MaintenanceConfigurationImpl withTimeInWeek(List timeInWeek) { + this.innerModel().withTimeInWeek(timeInWeek); + return this; + } + + public MaintenanceConfigurationImpl withNotAllowedTime(List notAllowedTime) { + this.innerModel().withNotAllowedTime(notAllowedTime); + return this; + } + + public MaintenanceConfigurationImpl withMaintenanceWindow(MaintenanceWindow maintenanceWindow) { + this.innerModel().withMaintenanceWindow(maintenanceWindow); + return this; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MaintenanceConfigurationsClientImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MaintenanceConfigurationsClientImpl.java new file mode 100644 index 000000000000..95412814ac3c --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MaintenanceConfigurationsClientImpl.java @@ -0,0 +1,585 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.containerservice.generated.fluent.MaintenanceConfigurationsClient; +import com.azure.resourcemanager.containerservice.generated.fluent.models.MaintenanceConfigurationInner; +import com.azure.resourcemanager.containerservice.generated.implementation.models.MaintenanceConfigurationListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in MaintenanceConfigurationsClient. + */ +public final class MaintenanceConfigurationsClientImpl implements MaintenanceConfigurationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final MaintenanceConfigurationsService service; + + /** + * The service client containing this operation class. + */ + private final ContainerServiceManagementClientImpl client; + + /** + * Initializes an instance of MaintenanceConfigurationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + MaintenanceConfigurationsClientImpl(ContainerServiceManagementClientImpl client) { + this.service = RestProxy.create(MaintenanceConfigurationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerServiceManagementClientMaintenanceConfigurations to be used + * by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ContainerServiceManagementClientMaintenanceConfigurations") + public interface MaintenanceConfigurationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("configName") String configName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("configName") String configName, @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("configName") String configName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") MaintenanceConfigurationInner parameters, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("configName") String configName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") MaintenanceConfigurationInner parameters, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("configName") String configName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("configName") String configName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByManagedCluster(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByManagedClusterSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByManagedClusterNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByManagedClusterNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets the specified maintenance configuration of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param configName The name of the maintenance configuration. Supported values are 'default', + * 'aksManagedAutoUpgradeSchedule', or 'aksManagedNodeOSUpgradeSchedule'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified maintenance configuration of a managed cluster along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String resourceName, String configName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, configName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified maintenance configuration of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param configName The name of the maintenance configuration. Supported values are 'default', + * 'aksManagedAutoUpgradeSchedule', or 'aksManagedNodeOSUpgradeSchedule'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified maintenance configuration of a managed cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String resourceName, + String configName) { + return getWithResponseAsync(resourceGroupName, resourceName, configName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the specified maintenance configuration of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param configName The name of the maintenance configuration. Supported values are 'default', + * 'aksManagedAutoUpgradeSchedule', or 'aksManagedNodeOSUpgradeSchedule'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified maintenance configuration of a managed cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String resourceName, + String configName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, resourceName, configName, accept, context); + } + + /** + * Gets the specified maintenance configuration of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param configName The name of the maintenance configuration. Supported values are 'default', + * 'aksManagedAutoUpgradeSchedule', or 'aksManagedNodeOSUpgradeSchedule'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified maintenance configuration of a managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MaintenanceConfigurationInner get(String resourceGroupName, String resourceName, String configName) { + return getWithResponse(resourceGroupName, resourceName, configName, Context.NONE).getValue(); + } + + /** + * Creates or updates a maintenance configuration in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param configName The name of the maintenance configuration. Supported values are 'default', + * 'aksManagedAutoUpgradeSchedule', or 'aksManagedNodeOSUpgradeSchedule'. + * @param parameters The maintenance configuration to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return planned maintenance configuration, used to configure when updates can be deployed to a Managed Cluster + * along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String resourceName, String configName, MaintenanceConfigurationInner parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, configName, contentType, accept, + parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a maintenance configuration in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param configName The name of the maintenance configuration. Supported values are 'default', + * 'aksManagedAutoUpgradeSchedule', or 'aksManagedNodeOSUpgradeSchedule'. + * @param parameters The maintenance configuration to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return planned maintenance configuration, used to configure when updates can be deployed to a Managed Cluster on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String resourceName, + String configName, MaintenanceConfigurationInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, resourceName, configName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates a maintenance configuration in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param configName The name of the maintenance configuration. Supported values are 'default', + * 'aksManagedAutoUpgradeSchedule', or 'aksManagedNodeOSUpgradeSchedule'. + * @param parameters The maintenance configuration to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return planned maintenance configuration, used to configure when updates can be deployed to a Managed Cluster + * along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, + String resourceName, String configName, MaintenanceConfigurationInner parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, configName, contentType, accept, + parameters, context); + } + + /** + * Creates or updates a maintenance configuration in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param configName The name of the maintenance configuration. Supported values are 'default', + * 'aksManagedAutoUpgradeSchedule', or 'aksManagedNodeOSUpgradeSchedule'. + * @param parameters The maintenance configuration to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return planned maintenance configuration, used to configure when updates can be deployed to a Managed Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MaintenanceConfigurationInner createOrUpdate(String resourceGroupName, String resourceName, + String configName, MaintenanceConfigurationInner parameters) { + return createOrUpdateWithResponse(resourceGroupName, resourceName, configName, parameters, Context.NONE) + .getValue(); + } + + /** + * Deletes a maintenance configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param configName The name of the maintenance configuration. Supported values are 'default', + * 'aksManagedAutoUpgradeSchedule', or 'aksManagedNodeOSUpgradeSchedule'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String resourceName, + String configName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, configName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a maintenance configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param configName The name of the maintenance configuration. Supported values are 'default', + * 'aksManagedAutoUpgradeSchedule', or 'aksManagedNodeOSUpgradeSchedule'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String resourceName, String configName) { + return deleteWithResponseAsync(resourceGroupName, resourceName, configName).flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes a maintenance configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param configName The name of the maintenance configuration. Supported values are 'default', + * 'aksManagedAutoUpgradeSchedule', or 'aksManagedNodeOSUpgradeSchedule'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String resourceName, String configName, + Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, configName, context); + } + + /** + * Deletes a maintenance configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param configName The name of the maintenance configuration. Supported values are 'default', + * 'aksManagedAutoUpgradeSchedule', or 'aksManagedNodeOSUpgradeSchedule'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String resourceName, String configName) { + deleteWithResponse(resourceGroupName, resourceName, configName, Context.NONE); + } + + /** + * Gets a list of maintenance configurations in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of maintenance configurations in the specified managed cluster along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByManagedClusterSinglePageAsync(String resourceGroupName, String resourceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByManagedCluster(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of maintenance configurations in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of maintenance configurations in the specified managed cluster as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByManagedClusterAsync(String resourceGroupName, + String resourceName) { + return new PagedFlux<>(() -> listByManagedClusterSinglePageAsync(resourceGroupName, resourceName), + nextLink -> listByManagedClusterNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of maintenance configurations in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of maintenance configurations in the specified managed cluster along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByManagedClusterSinglePage(String resourceGroupName, + String resourceName) { + final String accept = "application/json"; + Response res + = service.listByManagedClusterSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets a list of maintenance configurations in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of maintenance configurations in the specified managed cluster along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByManagedClusterSinglePage(String resourceGroupName, + String resourceName, Context context) { + final String accept = "application/json"; + Response res + = service.listByManagedClusterSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets a list of maintenance configurations in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of maintenance configurations in the specified managed cluster as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByManagedCluster(String resourceGroupName, + String resourceName) { + return new PagedIterable<>(() -> listByManagedClusterSinglePage(resourceGroupName, resourceName), + nextLink -> listByManagedClusterNextSinglePage(nextLink)); + } + + /** + * Gets a list of maintenance configurations in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of maintenance configurations in the specified managed cluster as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByManagedCluster(String resourceGroupName, + String resourceName, Context context) { + return new PagedIterable<>(() -> listByManagedClusterSinglePage(resourceGroupName, resourceName, context), + nextLink -> listByManagedClusterNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of maintenance configurations in the specified managed cluster along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByManagedClusterNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByManagedClusterNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of maintenance configurations in the specified managed cluster along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByManagedClusterNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByManagedClusterNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of maintenance configurations in the specified managed cluster along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByManagedClusterNextSinglePage(String nextLink, + Context context) { + final String accept = "application/json"; + Response res + = service.listByManagedClusterNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MaintenanceConfigurationsImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MaintenanceConfigurationsImpl.java new file mode 100644 index 000000000000..ad19268a82ce --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MaintenanceConfigurationsImpl.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerservice.generated.fluent.MaintenanceConfigurationsClient; +import com.azure.resourcemanager.containerservice.generated.fluent.models.MaintenanceConfigurationInner; +import com.azure.resourcemanager.containerservice.generated.models.MaintenanceConfiguration; +import com.azure.resourcemanager.containerservice.generated.models.MaintenanceConfigurations; + +public final class MaintenanceConfigurationsImpl implements MaintenanceConfigurations { + private static final ClientLogger LOGGER = new ClientLogger(MaintenanceConfigurationsImpl.class); + + private final MaintenanceConfigurationsClient innerClient; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + public MaintenanceConfigurationsImpl(MaintenanceConfigurationsClient innerClient, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String resourceName, + String configName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, resourceName, configName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new MaintenanceConfigurationImpl(inner.getValue(), this.manager())); + } + + public MaintenanceConfiguration get(String resourceGroupName, String resourceName, String configName) { + MaintenanceConfigurationInner inner = this.serviceClient().get(resourceGroupName, resourceName, configName); + if (inner != null) { + return new MaintenanceConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse(String resourceGroupName, String resourceName, String configName, + Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, resourceName, configName, context); + } + + public void delete(String resourceGroupName, String resourceName, String configName) { + this.serviceClient().delete(resourceGroupName, resourceName, configName); + } + + public PagedIterable listByManagedCluster(String resourceGroupName, String resourceName) { + PagedIterable inner + = this.serviceClient().listByManagedCluster(resourceGroupName, resourceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MaintenanceConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable listByManagedCluster(String resourceGroupName, String resourceName, + Context context) { + PagedIterable inner + = this.serviceClient().listByManagedCluster(resourceGroupName, resourceName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MaintenanceConfigurationImpl(inner1, this.manager())); + } + + public MaintenanceConfiguration getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = ResourceManagerUtils.getValueFromIdByName(id, "managedClusters"); + if (resourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedClusters'.", id))); + } + String configName = ResourceManagerUtils.getValueFromIdByName(id, "maintenanceConfigurations"); + if (configName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'maintenanceConfigurations'.", id))); + } + return this.getWithResponse(resourceGroupName, resourceName, configName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = ResourceManagerUtils.getValueFromIdByName(id, "managedClusters"); + if (resourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedClusters'.", id))); + } + String configName = ResourceManagerUtils.getValueFromIdByName(id, "maintenanceConfigurations"); + if (configName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'maintenanceConfigurations'.", id))); + } + return this.getWithResponse(resourceGroupName, resourceName, configName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = ResourceManagerUtils.getValueFromIdByName(id, "managedClusters"); + if (resourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedClusters'.", id))); + } + String configName = ResourceManagerUtils.getValueFromIdByName(id, "maintenanceConfigurations"); + if (configName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'maintenanceConfigurations'.", id))); + } + this.deleteWithResponse(resourceGroupName, resourceName, configName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = ResourceManagerUtils.getValueFromIdByName(id, "managedClusters"); + if (resourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedClusters'.", id))); + } + String configName = ResourceManagerUtils.getValueFromIdByName(id, "maintenanceConfigurations"); + if (configName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'maintenanceConfigurations'.", id))); + } + return this.deleteWithResponse(resourceGroupName, resourceName, configName, context); + } + + private MaintenanceConfigurationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } + + public MaintenanceConfigurationImpl define(String name) { + return new MaintenanceConfigurationImpl(name, this.manager()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClusterAccessProfileImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClusterAccessProfileImpl.java new file mode 100644 index 000000000000..0e3c7b741afa --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClusterAccessProfileImpl.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterAccessProfileInner; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAccessProfile; +import java.util.Collections; +import java.util.Map; + +public final class ManagedClusterAccessProfileImpl implements ManagedClusterAccessProfile { + private ManagedClusterAccessProfileInner innerObject; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + ManagedClusterAccessProfileImpl(ManagedClusterAccessProfileInner innerObject, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public byte[] kubeConfig() { + return this.innerModel().kubeConfig(); + } + + public ManagedClusterAccessProfileInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClusterImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClusterImpl.java new file mode 100644 index 000000000000..b95a4b86cc98 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClusterImpl.java @@ -0,0 +1,762 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.containerservice.generated.models.ClusterUpgradeSettings; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServiceLinuxProfile; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServiceNetworkProfile; +import com.azure.resourcemanager.containerservice.generated.models.CredentialResults; +import com.azure.resourcemanager.containerservice.generated.models.ExtendedLocation; +import com.azure.resourcemanager.containerservice.generated.models.Format; +import com.azure.resourcemanager.containerservice.generated.models.KubernetesSupportPlan; +import com.azure.resourcemanager.containerservice.generated.models.ManagedCluster; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAADProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAIToolchainOperatorProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAddonProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAgentPoolProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterApiServerAccessProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAutoUpgradeProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAzureMonitorProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterBootstrapProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterHttpProxyConfig; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterIdentity; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterIngressProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterMetricsProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterNodeProvisioningProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterNodeResourceGroupProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterOIDCIssuerProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterPodIdentityProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterPropertiesAutoScalerProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSKU; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSecurityProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterServicePrincipalProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterStatus; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterStorageProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterWindowsProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterWorkloadAutoScalerProfile; +import com.azure.resourcemanager.containerservice.generated.models.PowerState; +import com.azure.resourcemanager.containerservice.generated.models.PrivateLinkResource; +import com.azure.resourcemanager.containerservice.generated.models.PublicNetworkAccess; +import com.azure.resourcemanager.containerservice.generated.models.RunCommandRequest; +import com.azure.resourcemanager.containerservice.generated.models.RunCommandResult; +import com.azure.resourcemanager.containerservice.generated.models.ServiceMeshProfile; +import com.azure.resourcemanager.containerservice.generated.models.TagsObject; +import com.azure.resourcemanager.containerservice.generated.models.UserAssignedIdentity; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class ManagedClusterImpl implements ManagedCluster, ManagedCluster.Definition, ManagedCluster.Update { + private ManagedClusterInner innerObject; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String eTag() { + return this.innerModel().eTag(); + } + + public ManagedClusterSKU sku() { + return this.innerModel().sku(); + } + + public ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public ManagedClusterIdentity identity() { + return this.innerModel().identity(); + } + + public String kind() { + return this.innerModel().kind(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public PowerState powerState() { + return this.innerModel().powerState(); + } + + public Integer maxAgentPools() { + return this.innerModel().maxAgentPools(); + } + + public String kubernetesVersion() { + return this.innerModel().kubernetesVersion(); + } + + public String currentKubernetesVersion() { + return this.innerModel().currentKubernetesVersion(); + } + + public String dnsPrefix() { + return this.innerModel().dnsPrefix(); + } + + public String fqdnSubdomain() { + return this.innerModel().fqdnSubdomain(); + } + + public String fqdn() { + return this.innerModel().fqdn(); + } + + public String privateFQDN() { + return this.innerModel().privateFQDN(); + } + + public String azurePortalFQDN() { + return this.innerModel().azurePortalFQDN(); + } + + public List agentPoolProfiles() { + List inner = this.innerModel().agentPoolProfiles(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ContainerServiceLinuxProfile linuxProfile() { + return this.innerModel().linuxProfile(); + } + + public ManagedClusterWindowsProfile windowsProfile() { + return this.innerModel().windowsProfile(); + } + + public ManagedClusterServicePrincipalProfile servicePrincipalProfile() { + return this.innerModel().servicePrincipalProfile(); + } + + public Map addonProfiles() { + Map inner = this.innerModel().addonProfiles(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ManagedClusterPodIdentityProfile podIdentityProfile() { + return this.innerModel().podIdentityProfile(); + } + + public ManagedClusterOIDCIssuerProfile oidcIssuerProfile() { + return this.innerModel().oidcIssuerProfile(); + } + + public String nodeResourceGroup() { + return this.innerModel().nodeResourceGroup(); + } + + public ManagedClusterNodeResourceGroupProfile nodeResourceGroupProfile() { + return this.innerModel().nodeResourceGroupProfile(); + } + + public Boolean enableRBAC() { + return this.innerModel().enableRBAC(); + } + + public KubernetesSupportPlan supportPlan() { + return this.innerModel().supportPlan(); + } + + public ContainerServiceNetworkProfile networkProfile() { + return this.innerModel().networkProfile(); + } + + public ManagedClusterAADProfile aadProfile() { + return this.innerModel().aadProfile(); + } + + public ManagedClusterAutoUpgradeProfile autoUpgradeProfile() { + return this.innerModel().autoUpgradeProfile(); + } + + public ClusterUpgradeSettings upgradeSettings() { + return this.innerModel().upgradeSettings(); + } + + public ManagedClusterPropertiesAutoScalerProfile autoScalerProfile() { + return this.innerModel().autoScalerProfile(); + } + + public ManagedClusterApiServerAccessProfile apiServerAccessProfile() { + return this.innerModel().apiServerAccessProfile(); + } + + public String diskEncryptionSetID() { + return this.innerModel().diskEncryptionSetID(); + } + + public Map identityProfile() { + Map inner = this.innerModel().identityProfile(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public List privateLinkResources() { + List inner = this.innerModel().privateLinkResources(); + if (inner != null) { + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public Boolean disableLocalAccounts() { + return this.innerModel().disableLocalAccounts(); + } + + public ManagedClusterHttpProxyConfig httpProxyConfig() { + return this.innerModel().httpProxyConfig(); + } + + public ManagedClusterSecurityProfile securityProfile() { + return this.innerModel().securityProfile(); + } + + public ManagedClusterStorageProfile storageProfile() { + return this.innerModel().storageProfile(); + } + + public ManagedClusterIngressProfile ingressProfile() { + return this.innerModel().ingressProfile(); + } + + public PublicNetworkAccess publicNetworkAccess() { + return this.innerModel().publicNetworkAccess(); + } + + public ManagedClusterWorkloadAutoScalerProfile workloadAutoScalerProfile() { + return this.innerModel().workloadAutoScalerProfile(); + } + + public ManagedClusterAzureMonitorProfile azureMonitorProfile() { + return this.innerModel().azureMonitorProfile(); + } + + public ServiceMeshProfile serviceMeshProfile() { + return this.innerModel().serviceMeshProfile(); + } + + public String resourceUID() { + return this.innerModel().resourceUID(); + } + + public ManagedClusterMetricsProfile metricsProfile() { + return this.innerModel().metricsProfile(); + } + + public ManagedClusterNodeProvisioningProfile nodeProvisioningProfile() { + return this.innerModel().nodeProvisioningProfile(); + } + + public ManagedClusterBootstrapProfile bootstrapProfile() { + return this.innerModel().bootstrapProfile(); + } + + public ManagedClusterAIToolchainOperatorProfile aiToolchainOperatorProfile() { + return this.innerModel().aiToolchainOperatorProfile(); + } + + public ManagedClusterStatus status() { + return this.innerModel().status(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ManagedClusterInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String resourceName; + + private String createIfMatch; + + private String createIfNoneMatch; + + private String updateIfMatch; + + private TagsObject updateParameters; + + public ManagedClusterImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ManagedCluster create() { + this.innerObject = serviceManager.serviceClient() + .getManagedClusters() + .createOrUpdate(resourceGroupName, resourceName, this.innerModel(), createIfMatch, createIfNoneMatch, + Context.NONE); + return this; + } + + public ManagedCluster create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getManagedClusters() + .createOrUpdate(resourceGroupName, resourceName, this.innerModel(), createIfMatch, createIfNoneMatch, + context); + return this; + } + + ManagedClusterImpl(String name, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = new ManagedClusterInner(); + this.serviceManager = serviceManager; + this.resourceName = name; + this.createIfMatch = null; + this.createIfNoneMatch = null; + } + + public ManagedClusterImpl update() { + this.updateIfMatch = null; + this.updateParameters = new TagsObject(); + return this; + } + + public ManagedCluster apply() { + this.innerObject = serviceManager.serviceClient() + .getManagedClusters() + .updateTags(resourceGroupName, resourceName, updateParameters, updateIfMatch, Context.NONE); + return this; + } + + public ManagedCluster apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getManagedClusters() + .updateTags(resourceGroupName, resourceName, updateParameters, updateIfMatch, context); + return this; + } + + ManagedClusterImpl(ManagedClusterInner innerObject, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.resourceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "managedClusters"); + } + + public ManagedCluster refresh() { + this.innerObject = serviceManager.serviceClient() + .getManagedClusters() + .getByResourceGroupWithResponse(resourceGroupName, resourceName, Context.NONE) + .getValue(); + return this; + } + + public ManagedCluster refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getManagedClusters() + .getByResourceGroupWithResponse(resourceGroupName, resourceName, context) + .getValue(); + return this; + } + + public Response listClusterAdminCredentialsWithResponse(String serverFqdn, Context context) { + return serviceManager.managedClusters() + .listClusterAdminCredentialsWithResponse(resourceGroupName, resourceName, serverFqdn, context); + } + + public CredentialResults listClusterAdminCredentials() { + return serviceManager.managedClusters().listClusterAdminCredentials(resourceGroupName, resourceName); + } + + public Response listClusterUserCredentialsWithResponse(String serverFqdn, Format format, + Context context) { + return serviceManager.managedClusters() + .listClusterUserCredentialsWithResponse(resourceGroupName, resourceName, serverFqdn, format, context); + } + + public CredentialResults listClusterUserCredentials() { + return serviceManager.managedClusters().listClusterUserCredentials(resourceGroupName, resourceName); + } + + public Response listClusterMonitoringUserCredentialsWithResponse(String serverFqdn, + Context context) { + return serviceManager.managedClusters() + .listClusterMonitoringUserCredentialsWithResponse(resourceGroupName, resourceName, serverFqdn, context); + } + + public CredentialResults listClusterMonitoringUserCredentials() { + return serviceManager.managedClusters().listClusterMonitoringUserCredentials(resourceGroupName, resourceName); + } + + public void resetServicePrincipalProfile(ManagedClusterServicePrincipalProfile parameters) { + serviceManager.managedClusters().resetServicePrincipalProfile(resourceGroupName, resourceName, parameters); + } + + public void resetServicePrincipalProfile(ManagedClusterServicePrincipalProfile parameters, Context context) { + serviceManager.managedClusters() + .resetServicePrincipalProfile(resourceGroupName, resourceName, parameters, context); + } + + public void resetAADProfile(ManagedClusterAADProfile parameters) { + serviceManager.managedClusters().resetAADProfile(resourceGroupName, resourceName, parameters); + } + + public void resetAADProfile(ManagedClusterAADProfile parameters, Context context) { + serviceManager.managedClusters().resetAADProfile(resourceGroupName, resourceName, parameters, context); + } + + public void rotateClusterCertificates() { + serviceManager.managedClusters().rotateClusterCertificates(resourceGroupName, resourceName); + } + + public void rotateClusterCertificates(Context context) { + serviceManager.managedClusters().rotateClusterCertificates(resourceGroupName, resourceName, context); + } + + public void abortLatestOperation() { + serviceManager.managedClusters().abortLatestOperation(resourceGroupName, resourceName); + } + + public void abortLatestOperation(Context context) { + serviceManager.managedClusters().abortLatestOperation(resourceGroupName, resourceName, context); + } + + public void rotateServiceAccountSigningKeys() { + serviceManager.managedClusters().rotateServiceAccountSigningKeys(resourceGroupName, resourceName); + } + + public void rotateServiceAccountSigningKeys(Context context) { + serviceManager.managedClusters().rotateServiceAccountSigningKeys(resourceGroupName, resourceName, context); + } + + public void stop() { + serviceManager.managedClusters().stop(resourceGroupName, resourceName); + } + + public void stop(Context context) { + serviceManager.managedClusters().stop(resourceGroupName, resourceName, context); + } + + public void start() { + serviceManager.managedClusters().start(resourceGroupName, resourceName); + } + + public void start(Context context) { + serviceManager.managedClusters().start(resourceGroupName, resourceName, context); + } + + public RunCommandResult runCommand(RunCommandRequest requestPayload) { + return serviceManager.managedClusters().runCommand(resourceGroupName, resourceName, requestPayload); + } + + public RunCommandResult runCommand(RunCommandRequest requestPayload, Context context) { + return serviceManager.managedClusters().runCommand(resourceGroupName, resourceName, requestPayload, context); + } + + public ManagedClusterImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ManagedClusterImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ManagedClusterImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public ManagedClusterImpl withSku(ManagedClusterSKU sku) { + this.innerModel().withSku(sku); + return this; + } + + public ManagedClusterImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public ManagedClusterImpl withIdentity(ManagedClusterIdentity identity) { + this.innerModel().withIdentity(identity); + return this; + } + + public ManagedClusterImpl withKind(String kind) { + this.innerModel().withKind(kind); + return this; + } + + public ManagedClusterImpl withKubernetesVersion(String kubernetesVersion) { + this.innerModel().withKubernetesVersion(kubernetesVersion); + return this; + } + + public ManagedClusterImpl withDnsPrefix(String dnsPrefix) { + this.innerModel().withDnsPrefix(dnsPrefix); + return this; + } + + public ManagedClusterImpl withFqdnSubdomain(String fqdnSubdomain) { + this.innerModel().withFqdnSubdomain(fqdnSubdomain); + return this; + } + + public ManagedClusterImpl withAgentPoolProfiles(List agentPoolProfiles) { + this.innerModel().withAgentPoolProfiles(agentPoolProfiles); + return this; + } + + public ManagedClusterImpl withLinuxProfile(ContainerServiceLinuxProfile linuxProfile) { + this.innerModel().withLinuxProfile(linuxProfile); + return this; + } + + public ManagedClusterImpl withWindowsProfile(ManagedClusterWindowsProfile windowsProfile) { + this.innerModel().withWindowsProfile(windowsProfile); + return this; + } + + public ManagedClusterImpl + withServicePrincipalProfile(ManagedClusterServicePrincipalProfile servicePrincipalProfile) { + this.innerModel().withServicePrincipalProfile(servicePrincipalProfile); + return this; + } + + public ManagedClusterImpl withAddonProfiles(Map addonProfiles) { + this.innerModel().withAddonProfiles(addonProfiles); + return this; + } + + public ManagedClusterImpl withPodIdentityProfile(ManagedClusterPodIdentityProfile podIdentityProfile) { + this.innerModel().withPodIdentityProfile(podIdentityProfile); + return this; + } + + public ManagedClusterImpl withOidcIssuerProfile(ManagedClusterOIDCIssuerProfile oidcIssuerProfile) { + this.innerModel().withOidcIssuerProfile(oidcIssuerProfile); + return this; + } + + public ManagedClusterImpl withNodeResourceGroup(String nodeResourceGroup) { + this.innerModel().withNodeResourceGroup(nodeResourceGroup); + return this; + } + + public ManagedClusterImpl + withNodeResourceGroupProfile(ManagedClusterNodeResourceGroupProfile nodeResourceGroupProfile) { + this.innerModel().withNodeResourceGroupProfile(nodeResourceGroupProfile); + return this; + } + + public ManagedClusterImpl withEnableRBAC(Boolean enableRBAC) { + this.innerModel().withEnableRBAC(enableRBAC); + return this; + } + + public ManagedClusterImpl withSupportPlan(KubernetesSupportPlan supportPlan) { + this.innerModel().withSupportPlan(supportPlan); + return this; + } + + public ManagedClusterImpl withNetworkProfile(ContainerServiceNetworkProfile networkProfile) { + this.innerModel().withNetworkProfile(networkProfile); + return this; + } + + public ManagedClusterImpl withAadProfile(ManagedClusterAADProfile aadProfile) { + this.innerModel().withAadProfile(aadProfile); + return this; + } + + public ManagedClusterImpl withAutoUpgradeProfile(ManagedClusterAutoUpgradeProfile autoUpgradeProfile) { + this.innerModel().withAutoUpgradeProfile(autoUpgradeProfile); + return this; + } + + public ManagedClusterImpl withUpgradeSettings(ClusterUpgradeSettings upgradeSettings) { + this.innerModel().withUpgradeSettings(upgradeSettings); + return this; + } + + public ManagedClusterImpl withAutoScalerProfile(ManagedClusterPropertiesAutoScalerProfile autoScalerProfile) { + this.innerModel().withAutoScalerProfile(autoScalerProfile); + return this; + } + + public ManagedClusterImpl withApiServerAccessProfile(ManagedClusterApiServerAccessProfile apiServerAccessProfile) { + this.innerModel().withApiServerAccessProfile(apiServerAccessProfile); + return this; + } + + public ManagedClusterImpl withDiskEncryptionSetID(String diskEncryptionSetID) { + this.innerModel().withDiskEncryptionSetID(diskEncryptionSetID); + return this; + } + + public ManagedClusterImpl withIdentityProfile(Map identityProfile) { + this.innerModel().withIdentityProfile(identityProfile); + return this; + } + + public ManagedClusterImpl withPrivateLinkResources(List privateLinkResources) { + this.innerModel().withPrivateLinkResources(privateLinkResources); + return this; + } + + public ManagedClusterImpl withDisableLocalAccounts(Boolean disableLocalAccounts) { + this.innerModel().withDisableLocalAccounts(disableLocalAccounts); + return this; + } + + public ManagedClusterImpl withHttpProxyConfig(ManagedClusterHttpProxyConfig httpProxyConfig) { + this.innerModel().withHttpProxyConfig(httpProxyConfig); + return this; + } + + public ManagedClusterImpl withSecurityProfile(ManagedClusterSecurityProfile securityProfile) { + this.innerModel().withSecurityProfile(securityProfile); + return this; + } + + public ManagedClusterImpl withStorageProfile(ManagedClusterStorageProfile storageProfile) { + this.innerModel().withStorageProfile(storageProfile); + return this; + } + + public ManagedClusterImpl withIngressProfile(ManagedClusterIngressProfile ingressProfile) { + this.innerModel().withIngressProfile(ingressProfile); + return this; + } + + public ManagedClusterImpl withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.innerModel().withPublicNetworkAccess(publicNetworkAccess); + return this; + } + + public ManagedClusterImpl + withWorkloadAutoScalerProfile(ManagedClusterWorkloadAutoScalerProfile workloadAutoScalerProfile) { + this.innerModel().withWorkloadAutoScalerProfile(workloadAutoScalerProfile); + return this; + } + + public ManagedClusterImpl withAzureMonitorProfile(ManagedClusterAzureMonitorProfile azureMonitorProfile) { + this.innerModel().withAzureMonitorProfile(azureMonitorProfile); + return this; + } + + public ManagedClusterImpl withServiceMeshProfile(ServiceMeshProfile serviceMeshProfile) { + this.innerModel().withServiceMeshProfile(serviceMeshProfile); + return this; + } + + public ManagedClusterImpl withMetricsProfile(ManagedClusterMetricsProfile metricsProfile) { + this.innerModel().withMetricsProfile(metricsProfile); + return this; + } + + public ManagedClusterImpl + withNodeProvisioningProfile(ManagedClusterNodeProvisioningProfile nodeProvisioningProfile) { + this.innerModel().withNodeProvisioningProfile(nodeProvisioningProfile); + return this; + } + + public ManagedClusterImpl withBootstrapProfile(ManagedClusterBootstrapProfile bootstrapProfile) { + this.innerModel().withBootstrapProfile(bootstrapProfile); + return this; + } + + public ManagedClusterImpl + withAiToolchainOperatorProfile(ManagedClusterAIToolchainOperatorProfile aiToolchainOperatorProfile) { + this.innerModel().withAiToolchainOperatorProfile(aiToolchainOperatorProfile); + return this; + } + + public ManagedClusterImpl withStatus(ManagedClusterStatus status) { + this.innerModel().withStatus(status); + return this; + } + + public ManagedClusterImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.createIfMatch = ifMatch; + return this; + } else { + this.updateIfMatch = ifMatch; + return this; + } + } + + public ManagedClusterImpl withIfNoneMatch(String ifNoneMatch) { + this.createIfNoneMatch = ifNoneMatch; + return this; + } + + private boolean isInCreateMode() { + return this.innerModel() == null || this.innerModel().id() == null; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClusterUpgradeProfileImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClusterUpgradeProfileImpl.java new file mode 100644 index 000000000000..1ccf4a038f51 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClusterUpgradeProfileImpl.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterUpgradeProfileInner; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterPoolUpgradeProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterUpgradeProfile; +import java.util.Collections; +import java.util.List; + +public final class ManagedClusterUpgradeProfileImpl implements ManagedClusterUpgradeProfile { + private ManagedClusterUpgradeProfileInner innerObject; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + ManagedClusterUpgradeProfileImpl(ManagedClusterUpgradeProfileInner innerObject, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ManagedClusterPoolUpgradeProfile controlPlaneProfile() { + return this.innerModel().controlPlaneProfile(); + } + + public List agentPoolProfiles() { + List inner = this.innerModel().agentPoolProfiles(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ManagedClusterUpgradeProfileInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClustersClientImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClustersClientImpl.java new file mode 100644 index 000000000000..93a75955bcea --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClustersClientImpl.java @@ -0,0 +1,4599 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient; +import com.azure.resourcemanager.containerservice.generated.fluent.models.CredentialResultsInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.KubernetesVersionListResultInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterAccessProfileInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterUpgradeProfileInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.MeshRevisionProfileInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.MeshUpgradeProfileInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.OutboundEnvironmentEndpointInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.RunCommandResultInner; +import com.azure.resourcemanager.containerservice.generated.implementation.models.ManagedClusterListResult; +import com.azure.resourcemanager.containerservice.generated.implementation.models.MeshRevisionProfileList; +import com.azure.resourcemanager.containerservice.generated.implementation.models.MeshUpgradeProfileList; +import com.azure.resourcemanager.containerservice.generated.implementation.models.OutboundEnvironmentEndpointCollection; +import com.azure.resourcemanager.containerservice.generated.models.Format; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAADProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterServicePrincipalProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClustersGetCommandResultResponse; +import com.azure.resourcemanager.containerservice.generated.models.RunCommandRequest; +import com.azure.resourcemanager.containerservice.generated.models.TagsObject; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ManagedClustersClient. + */ +public final class ManagedClustersClientImpl implements ManagedClustersClient { + /** + * The proxy service used to perform REST calls. + */ + private final ManagedClustersService service; + + /** + * The service client containing this operation class. + */ + private final ContainerServiceManagementClientImpl client; + + /** + * Initializes an instance of ManagedClustersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ManagedClustersClientImpl(ContainerServiceManagementClientImpl client) { + this.service + = RestProxy.create(ManagedClustersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerServiceManagementClientManagedClusters to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ContainerServiceManagementClientManagedClusters") + public interface ManagedClustersService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("if-match") String ifMatch, @HeaderParam("if-none-match") String ifNoneMatch, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ManagedClusterInner parameters, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("if-match") String ifMatch, @HeaderParam("if-none-match") String ifNoneMatch, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ManagedClusterInner parameters, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateTags(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("if-match") String ifMatch, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") TagsObject parameters, + Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateTagsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("if-match") String ifMatch, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") TagsObject parameters, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("if-match") String ifMatch, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("if-match") String ifMatch, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getAccessProfile(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("roleName") String roleName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getAccessProfileSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("roleName") String roleName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listClusterAdminCredentials(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @QueryParam("server-fqdn") String serverFqdn, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listClusterAdminCredentialsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @QueryParam("server-fqdn") String serverFqdn, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listClusterUserCredentials(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @QueryParam("server-fqdn") String serverFqdn, @QueryParam("format") Format format, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listClusterUserCredentialsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @QueryParam("server-fqdn") String serverFqdn, @QueryParam("format") Format format, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listClusterMonitoringUserCredentials( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @QueryParam("server-fqdn") String serverFqdn, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listClusterMonitoringUserCredentialsSync( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @QueryParam("server-fqdn") String serverFqdn, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> resetServicePrincipalProfile(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") ManagedClusterServicePrincipalProfile parameters, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response resetServicePrincipalProfileSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") ManagedClusterServicePrincipalProfile parameters, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> resetAADProfile(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") ManagedClusterAADProfile parameters, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response resetAADProfileSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") ManagedClusterAADProfile parameters, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> rotateClusterCertificates(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response rotateClusterCertificatesSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/abort") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> abortLatestOperation(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/abort") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response abortLatestOperationSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateServiceAccountSigningKeys") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> rotateServiceAccountSigningKeys(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateServiceAccountSigningKeys") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response rotateServiceAccountSigningKeysSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> stop(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response stopSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> start(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response startSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> runCommand(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") RunCommandRequest requestPayload, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response runCommandSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") RunCommandRequest requestPayload, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getCommandResult(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("commandId") String commandId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + ManagedClustersGetCommandResultResponse getCommandResultSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("commandId") String commandId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/outboundNetworkDependenciesEndpoints") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listOutboundNetworkDependenciesEndpoints( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/outboundNetworkDependenciesEndpoints") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listOutboundNetworkDependenciesEndpointsSync( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getUpgradeProfile(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getUpgradeProfileSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles/{mode}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getMeshRevisionProfile(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @PathParam("mode") String mode, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles/{mode}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getMeshRevisionProfileSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @PathParam("mode") String mode, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listMeshRevisionProfiles(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listMeshRevisionProfilesSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshUpgradeProfiles/{mode}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getMeshUpgradeProfile(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("mode") String mode, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshUpgradeProfiles/{mode}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getMeshUpgradeProfileSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("mode") String mode, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshUpgradeProfiles") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listMeshUpgradeProfiles(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshUpgradeProfiles") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listMeshUpgradeProfilesSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/kubernetesVersions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listKubernetesVersions(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/kubernetesVersions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listKubernetesVersionsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listOutboundNetworkDependenciesEndpointsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listOutboundNetworkDependenciesEndpointsNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listMeshRevisionProfilesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listMeshRevisionProfilesNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listMeshUpgradeProfilesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listMeshUpgradeProfilesNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a managed cluster along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String resourceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a managed cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String resourceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, resourceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a managed cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String resourceName, + Context context) { + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context); + } + + /** + * Gets a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedClusterInner getByResourceGroup(String resourceGroupName, String resourceName) { + return getByResourceGroupWithResponse(resourceGroupName, resourceName, Context.NONE).getValue(); + } + + /** + * Creates or updates a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The managed cluster to create or update. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param ifNoneMatch The request should only proceed if no entity matches this string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed cluster along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String resourceName, ManagedClusterInner parameters, String ifMatch, String ifNoneMatch) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, ifMatch, ifNoneMatch, contentType, + accept, parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The managed cluster to create or update. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param ifNoneMatch The request should only proceed if no entity matches this string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String resourceName, + ManagedClusterInner parameters, String ifMatch, String ifNoneMatch) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, ifMatch, ifNoneMatch, contentType, accept, + parameters, Context.NONE); + } + + /** + * Creates or updates a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The managed cluster to create or update. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param ifNoneMatch The request should only proceed if no entity matches this string. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String resourceName, + ManagedClusterInner parameters, String ifMatch, String ifNoneMatch, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, ifMatch, ifNoneMatch, contentType, accept, + parameters, context); + } + + /** + * Creates or updates a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The managed cluster to create or update. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param ifNoneMatch The request should only proceed if no entity matches this string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of managed cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ManagedClusterInner> beginCreateOrUpdateAsync( + String resourceGroupName, String resourceName, ManagedClusterInner parameters, String ifMatch, + String ifNoneMatch) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, resourceName, parameters, ifMatch, ifNoneMatch); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ManagedClusterInner.class, ManagedClusterInner.class, this.client.getContext()); + } + + /** + * Creates or updates a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The managed cluster to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of managed cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ManagedClusterInner> + beginCreateOrUpdateAsync(String resourceGroupName, String resourceName, ManagedClusterInner parameters) { + final String ifMatch = null; + final String ifNoneMatch = null; + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, resourceName, parameters, ifMatch, ifNoneMatch); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ManagedClusterInner.class, ManagedClusterInner.class, this.client.getContext()); + } + + /** + * Creates or updates a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The managed cluster to create or update. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param ifNoneMatch The request should only proceed if no entity matches this string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of managed cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ManagedClusterInner> beginCreateOrUpdate( + String resourceGroupName, String resourceName, ManagedClusterInner parameters, String ifMatch, + String ifNoneMatch) { + Response response + = createOrUpdateWithResponse(resourceGroupName, resourceName, parameters, ifMatch, ifNoneMatch); + return this.client.getLroResult(response, ManagedClusterInner.class, + ManagedClusterInner.class, Context.NONE); + } + + /** + * Creates or updates a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The managed cluster to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of managed cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ManagedClusterInner> + beginCreateOrUpdate(String resourceGroupName, String resourceName, ManagedClusterInner parameters) { + final String ifMatch = null; + final String ifNoneMatch = null; + Response response + = createOrUpdateWithResponse(resourceGroupName, resourceName, parameters, ifMatch, ifNoneMatch); + return this.client.getLroResult(response, ManagedClusterInner.class, + ManagedClusterInner.class, Context.NONE); + } + + /** + * Creates or updates a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The managed cluster to create or update. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param ifNoneMatch The request should only proceed if no entity matches this string. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of managed cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ManagedClusterInner> beginCreateOrUpdate( + String resourceGroupName, String resourceName, ManagedClusterInner parameters, String ifMatch, + String ifNoneMatch, Context context) { + Response response + = createOrUpdateWithResponse(resourceGroupName, resourceName, parameters, ifMatch, ifNoneMatch, context); + return this.client.getLroResult(response, ManagedClusterInner.class, + ManagedClusterInner.class, context); + } + + /** + * Creates or updates a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The managed cluster to create or update. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param ifNoneMatch The request should only proceed if no entity matches this string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String resourceName, + ManagedClusterInner parameters, String ifMatch, String ifNoneMatch) { + return beginCreateOrUpdateAsync(resourceGroupName, resourceName, parameters, ifMatch, ifNoneMatch).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The managed cluster to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String resourceName, + ManagedClusterInner parameters) { + final String ifMatch = null; + final String ifNoneMatch = null; + return beginCreateOrUpdateAsync(resourceGroupName, resourceName, parameters, ifMatch, ifNoneMatch).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The managed cluster to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedClusterInner createOrUpdate(String resourceGroupName, String resourceName, + ManagedClusterInner parameters) { + final String ifMatch = null; + final String ifNoneMatch = null; + return beginCreateOrUpdate(resourceGroupName, resourceName, parameters, ifMatch, ifNoneMatch).getFinalResult(); + } + + /** + * Creates or updates a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The managed cluster to create or update. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param ifNoneMatch The request should only proceed if no entity matches this string. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedClusterInner createOrUpdate(String resourceGroupName, String resourceName, + ManagedClusterInner parameters, String ifMatch, String ifNoneMatch, Context context) { + return beginCreateOrUpdate(resourceGroupName, resourceName, parameters, ifMatch, ifNoneMatch, context) + .getFinalResult(); + } + + /** + * Updates tags on a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update Managed Cluster Tags operation. + * @param ifMatch The request should only proceed if an entity matches this string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed cluster along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateTagsWithResponseAsync(String resourceGroupName, String resourceName, + TagsObject parameters, String ifMatch) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.updateTags(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, ifMatch, contentType, accept, + parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates tags on a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update Managed Cluster Tags operation. + * @param ifMatch The request should only proceed if an entity matches this string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateTagsWithResponse(String resourceGroupName, String resourceName, + TagsObject parameters, String ifMatch) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateTagsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, ifMatch, contentType, accept, parameters, + Context.NONE); + } + + /** + * Updates tags on a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update Managed Cluster Tags operation. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateTagsWithResponse(String resourceGroupName, String resourceName, + TagsObject parameters, String ifMatch, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateTagsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, ifMatch, contentType, accept, parameters, + context); + } + + /** + * Updates tags on a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update Managed Cluster Tags operation. + * @param ifMatch The request should only proceed if an entity matches this string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of managed cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ManagedClusterInner> + beginUpdateTagsAsync(String resourceGroupName, String resourceName, TagsObject parameters, String ifMatch) { + Mono>> mono + = updateTagsWithResponseAsync(resourceGroupName, resourceName, parameters, ifMatch); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ManagedClusterInner.class, ManagedClusterInner.class, this.client.getContext()); + } + + /** + * Updates tags on a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update Managed Cluster Tags operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of managed cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ManagedClusterInner> + beginUpdateTagsAsync(String resourceGroupName, String resourceName, TagsObject parameters) { + final String ifMatch = null; + Mono>> mono + = updateTagsWithResponseAsync(resourceGroupName, resourceName, parameters, ifMatch); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ManagedClusterInner.class, ManagedClusterInner.class, this.client.getContext()); + } + + /** + * Updates tags on a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update Managed Cluster Tags operation. + * @param ifMatch The request should only proceed if an entity matches this string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of managed cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ManagedClusterInner> beginUpdateTags(String resourceGroupName, + String resourceName, TagsObject parameters, String ifMatch) { + Response response = updateTagsWithResponse(resourceGroupName, resourceName, parameters, ifMatch); + return this.client.getLroResult(response, ManagedClusterInner.class, + ManagedClusterInner.class, Context.NONE); + } + + /** + * Updates tags on a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update Managed Cluster Tags operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of managed cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ManagedClusterInner> beginUpdateTags(String resourceGroupName, + String resourceName, TagsObject parameters) { + final String ifMatch = null; + Response response = updateTagsWithResponse(resourceGroupName, resourceName, parameters, ifMatch); + return this.client.getLroResult(response, ManagedClusterInner.class, + ManagedClusterInner.class, Context.NONE); + } + + /** + * Updates tags on a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update Managed Cluster Tags operation. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of managed cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ManagedClusterInner> beginUpdateTags(String resourceGroupName, + String resourceName, TagsObject parameters, String ifMatch, Context context) { + Response response + = updateTagsWithResponse(resourceGroupName, resourceName, parameters, ifMatch, context); + return this.client.getLroResult(response, ManagedClusterInner.class, + ManagedClusterInner.class, context); + } + + /** + * Updates tags on a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update Managed Cluster Tags operation. + * @param ifMatch The request should only proceed if an entity matches this string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync(String resourceGroupName, String resourceName, + TagsObject parameters, String ifMatch) { + return beginUpdateTagsAsync(resourceGroupName, resourceName, parameters, ifMatch).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates tags on a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update Managed Cluster Tags operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync(String resourceGroupName, String resourceName, + TagsObject parameters) { + final String ifMatch = null; + return beginUpdateTagsAsync(resourceGroupName, resourceName, parameters, ifMatch).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates tags on a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update Managed Cluster Tags operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedClusterInner updateTags(String resourceGroupName, String resourceName, TagsObject parameters) { + final String ifMatch = null; + return beginUpdateTags(resourceGroupName, resourceName, parameters, ifMatch).getFinalResult(); + } + + /** + * Updates tags on a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update Managed Cluster Tags operation. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedClusterInner updateTags(String resourceGroupName, String resourceName, TagsObject parameters, + String ifMatch, Context context) { + return beginUpdateTags(resourceGroupName, resourceName, parameters, ifMatch, context).getFinalResult(); + } + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param ifMatch The request should only proceed if an entity matches this string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String resourceName, + String ifMatch) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, ifMatch, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param ifMatch The request should only proceed if an entity matches this string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String resourceName, String ifMatch) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, ifMatch, Context.NONE); + } + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String resourceName, String ifMatch, + Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, ifMatch, context); + } + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param ifMatch The request should only proceed if an entity matches this string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String resourceName, + String ifMatch) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName, ifMatch); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String resourceName) { + final String ifMatch = null; + Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName, ifMatch); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param ifMatch The request should only proceed if an entity matches this string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, + String ifMatch) { + Response response = deleteWithResponse(resourceGroupName, resourceName, ifMatch); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName) { + final String ifMatch = null; + Response response = deleteWithResponse(resourceGroupName, resourceName, ifMatch); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, String ifMatch, + Context context) { + Response response = deleteWithResponse(resourceGroupName, resourceName, ifMatch, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param ifMatch The request should only proceed if an entity matches this string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String resourceName, String ifMatch) { + return beginDeleteAsync(resourceGroupName, resourceName, ifMatch).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String resourceName) { + final String ifMatch = null; + return beginDeleteAsync(resourceGroupName, resourceName, ifMatch).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String resourceName) { + final String ifMatch = null; + beginDelete(resourceGroupName, resourceName, ifMatch).getFinalResult(); + } + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String resourceName, String ifMatch, Context context) { + beginDelete(resourceGroupName, resourceName, ifMatch, context).getFinalResult(); + } + + /** + * Lists managed clusters in the specified subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ManagedCluster list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists managed clusters in the specified subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ManagedCluster list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists managed clusters in the specified subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ManagedCluster list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists managed clusters in the specified subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ManagedCluster list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, + Context context) { + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists managed clusters in the specified subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ManagedCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); + } + + /** + * Lists managed clusters in the specified subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ManagedCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); + } + + /** + * Gets a list of managed clusters in the specified subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of managed clusters in the specified subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of managed clusters in the specified subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of managed clusters in the specified subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of managed clusters in the specified subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of managed clusters in the specified subscription along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets a list of managed clusters in the specified subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of managed clusters in the specified subscription along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets a list of managed clusters in the specified subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of managed clusters in the specified subscription as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Gets a list of managed clusters in the specified subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of managed clusters in the specified subscription as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Gets an access profile of a managed cluster. + * + * **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) + * . + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param roleName The name of the role for managed cluster accessProfile resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an access profile of a managed cluster. + * + * **WARNING**: This API will be deprecated along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAccessProfileWithResponseAsync(String resourceGroupName, + String resourceName, String roleName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getAccessProfile(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, roleName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an access profile of a managed cluster. + * + * **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) + * . + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param roleName The name of the role for managed cluster accessProfile resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an access profile of a managed cluster. + * + * **WARNING**: This API will be deprecated on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAccessProfileAsync(String resourceGroupName, String resourceName, + String roleName) { + return getAccessProfileWithResponseAsync(resourceGroupName, resourceName, roleName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an access profile of a managed cluster. + * + * **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) + * . + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param roleName The name of the role for managed cluster accessProfile resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an access profile of a managed cluster. + * + * **WARNING**: This API will be deprecated along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAccessProfileWithResponse(String resourceGroupName, + String resourceName, String roleName, Context context) { + final String accept = "application/json"; + return service.getAccessProfileSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, roleName, accept, context); + } + + /** + * Gets an access profile of a managed cluster. + * + * **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) + * . + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param roleName The name of the role for managed cluster accessProfile resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an access profile of a managed cluster. + * + * **WARNING**: This API will be deprecated. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedClusterAccessProfileInner getAccessProfile(String resourceGroupName, String resourceName, + String roleName) { + return getAccessProfileWithResponse(resourceGroupName, resourceName, roleName, Context.NONE).getValue(); + } + + /** + * Lists the admin credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param serverFqdn server fqdn type for credentials to be returned. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list credential result response along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listClusterAdminCredentialsWithResponseAsync(String resourceGroupName, String resourceName, String serverFqdn) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listClusterAdminCredentials(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, serverFqdn, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the admin credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list credential result response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listClusterAdminCredentialsAsync(String resourceGroupName, + String resourceName) { + final String serverFqdn = null; + return listClusterAdminCredentialsWithResponseAsync(resourceGroupName, resourceName, serverFqdn) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Lists the admin credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param serverFqdn server fqdn type for credentials to be returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list credential result response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listClusterAdminCredentialsWithResponse(String resourceGroupName, + String resourceName, String serverFqdn, Context context) { + final String accept = "application/json"; + return service.listClusterAdminCredentialsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, serverFqdn, accept, context); + } + + /** + * Lists the admin credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list credential result response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CredentialResultsInner listClusterAdminCredentials(String resourceGroupName, String resourceName) { + final String serverFqdn = null; + return listClusterAdminCredentialsWithResponse(resourceGroupName, resourceName, serverFqdn, Context.NONE) + .getValue(); + } + + /** + * Lists the user credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param serverFqdn server fqdn type for credentials to be returned. + * @param format 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list credential result response along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listClusterUserCredentialsWithResponseAsync(String resourceGroupName, + String resourceName, String serverFqdn, Format format) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listClusterUserCredentials(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, resourceName, + serverFqdn, format, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the user credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list credential result response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listClusterUserCredentialsAsync(String resourceGroupName, + String resourceName) { + final String serverFqdn = null; + final Format format = null; + return listClusterUserCredentialsWithResponseAsync(resourceGroupName, resourceName, serverFqdn, format) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Lists the user credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param serverFqdn server fqdn type for credentials to be returned. + * @param format 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list credential result response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listClusterUserCredentialsWithResponse(String resourceGroupName, + String resourceName, String serverFqdn, Format format, Context context) { + final String accept = "application/json"; + return service.listClusterUserCredentialsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, serverFqdn, format, accept, context); + } + + /** + * Lists the user credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list credential result response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CredentialResultsInner listClusterUserCredentials(String resourceGroupName, String resourceName) { + final String serverFqdn = null; + final Format format = null; + return listClusterUserCredentialsWithResponse(resourceGroupName, resourceName, serverFqdn, format, Context.NONE) + .getValue(); + } + + /** + * Lists the cluster monitoring user credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param serverFqdn server fqdn type for credentials to be returned. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list credential result response along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listClusterMonitoringUserCredentialsWithResponseAsync( + String resourceGroupName, String resourceName, String serverFqdn) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listClusterMonitoringUserCredentials(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, resourceName, + serverFqdn, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the cluster monitoring user credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list credential result response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listClusterMonitoringUserCredentialsAsync(String resourceGroupName, + String resourceName) { + final String serverFqdn = null; + return listClusterMonitoringUserCredentialsWithResponseAsync(resourceGroupName, resourceName, serverFqdn) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Lists the cluster monitoring user credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param serverFqdn server fqdn type for credentials to be returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list credential result response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listClusterMonitoringUserCredentialsWithResponse(String resourceGroupName, + String resourceName, String serverFqdn, Context context) { + final String accept = "application/json"; + return service.listClusterMonitoringUserCredentialsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, serverFqdn, accept, context); + } + + /** + * Lists the cluster monitoring user credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list credential result response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CredentialResultsInner listClusterMonitoringUserCredentials(String resourceGroupName, String resourceName) { + final String serverFqdn = null; + return listClusterMonitoringUserCredentialsWithResponse(resourceGroupName, resourceName, serverFqdn, + Context.NONE).getValue(); + } + + /** + * Reset the Service Principal Profile of a managed cluster. + * + * This action cannot be performed on a cluster that is not using a service principal. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The service principal profile to set on the managed cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resetServicePrincipalProfileWithResponseAsync(String resourceGroupName, + String resourceName, ManagedClusterServicePrincipalProfile parameters) { + final String contentType = "application/json"; + return FluxUtil + .withContext( + context -> service.resetServicePrincipalProfile(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, contentType, parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Reset the Service Principal Profile of a managed cluster. + * + * This action cannot be performed on a cluster that is not using a service principal. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The service principal profile to set on the managed cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response resetServicePrincipalProfileWithResponse(String resourceGroupName, String resourceName, + ManagedClusterServicePrincipalProfile parameters) { + final String contentType = "application/json"; + return service.resetServicePrincipalProfileSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, contentType, parameters, Context.NONE); + } + + /** + * Reset the Service Principal Profile of a managed cluster. + * + * This action cannot be performed on a cluster that is not using a service principal. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The service principal profile to set on the managed cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response resetServicePrincipalProfileWithResponse(String resourceGroupName, String resourceName, + ManagedClusterServicePrincipalProfile parameters, Context context) { + final String contentType = "application/json"; + return service.resetServicePrincipalProfileSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, contentType, parameters, context); + } + + /** + * Reset the Service Principal Profile of a managed cluster. + * + * This action cannot be performed on a cluster that is not using a service principal. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The service principal profile to set on the managed cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginResetServicePrincipalProfileAsync(String resourceGroupName, + String resourceName, ManagedClusterServicePrincipalProfile parameters) { + Mono>> mono + = resetServicePrincipalProfileWithResponseAsync(resourceGroupName, resourceName, parameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Reset the Service Principal Profile of a managed cluster. + * + * This action cannot be performed on a cluster that is not using a service principal. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The service principal profile to set on the managed cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginResetServicePrincipalProfile(String resourceGroupName, + String resourceName, ManagedClusterServicePrincipalProfile parameters) { + Response response + = resetServicePrincipalProfileWithResponse(resourceGroupName, resourceName, parameters); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Reset the Service Principal Profile of a managed cluster. + * + * This action cannot be performed on a cluster that is not using a service principal. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The service principal profile to set on the managed cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginResetServicePrincipalProfile(String resourceGroupName, + String resourceName, ManagedClusterServicePrincipalProfile parameters, Context context) { + Response response + = resetServicePrincipalProfileWithResponse(resourceGroupName, resourceName, parameters, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Reset the Service Principal Profile of a managed cluster. + * + * This action cannot be performed on a cluster that is not using a service principal. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The service principal profile to set on the managed cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resetServicePrincipalProfileAsync(String resourceGroupName, String resourceName, + ManagedClusterServicePrincipalProfile parameters) { + return beginResetServicePrincipalProfileAsync(resourceGroupName, resourceName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Reset the Service Principal Profile of a managed cluster. + * + * This action cannot be performed on a cluster that is not using a service principal. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The service principal profile to set on the managed cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void resetServicePrincipalProfile(String resourceGroupName, String resourceName, + ManagedClusterServicePrincipalProfile parameters) { + beginResetServicePrincipalProfile(resourceGroupName, resourceName, parameters).getFinalResult(); + } + + /** + * Reset the Service Principal Profile of a managed cluster. + * + * This action cannot be performed on a cluster that is not using a service principal. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The service principal profile to set on the managed cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void resetServicePrincipalProfile(String resourceGroupName, String resourceName, + ManagedClusterServicePrincipalProfile parameters, Context context) { + beginResetServicePrincipalProfile(resourceGroupName, resourceName, parameters, context).getFinalResult(); + } + + /** + * Reset the AAD Profile of a managed cluster. + * + * **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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The AAD profile to set on the Managed Cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resetAADProfileWithResponseAsync(String resourceGroupName, + String resourceName, ManagedClusterAADProfile parameters) { + final String contentType = "application/json"; + return FluxUtil + .withContext(context -> service.resetAADProfile(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, contentType, parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Reset the AAD Profile of a managed cluster. + * + * **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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The AAD profile to set on the Managed Cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response resetAADProfileWithResponse(String resourceGroupName, String resourceName, + ManagedClusterAADProfile parameters) { + final String contentType = "application/json"; + return service.resetAADProfileSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, contentType, parameters, Context.NONE); + } + + /** + * Reset the AAD Profile of a managed cluster. + * + * **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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The AAD profile to set on the Managed Cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response resetAADProfileWithResponse(String resourceGroupName, String resourceName, + ManagedClusterAADProfile parameters, Context context) { + final String contentType = "application/json"; + return service.resetAADProfileSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, contentType, parameters, context); + } + + /** + * Reset the AAD Profile of a managed cluster. + * + * **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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The AAD profile to set on the Managed Cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginResetAADProfileAsync(String resourceGroupName, String resourceName, + ManagedClusterAADProfile parameters) { + Mono>> mono + = resetAADProfileWithResponseAsync(resourceGroupName, resourceName, parameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Reset the AAD Profile of a managed cluster. + * + * **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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The AAD profile to set on the Managed Cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginResetAADProfile(String resourceGroupName, String resourceName, + ManagedClusterAADProfile parameters) { + Response response = resetAADProfileWithResponse(resourceGroupName, resourceName, parameters); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Reset the AAD Profile of a managed cluster. + * + * **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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The AAD profile to set on the Managed Cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginResetAADProfile(String resourceGroupName, String resourceName, + ManagedClusterAADProfile parameters, Context context) { + Response response + = resetAADProfileWithResponse(resourceGroupName, resourceName, parameters, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Reset the AAD Profile of a managed cluster. + * + * **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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The AAD profile to set on the Managed Cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resetAADProfileAsync(String resourceGroupName, String resourceName, + ManagedClusterAADProfile parameters) { + return beginResetAADProfileAsync(resourceGroupName, resourceName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Reset the AAD Profile of a managed cluster. + * + * **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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The AAD profile to set on the Managed Cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void resetAADProfile(String resourceGroupName, String resourceName, ManagedClusterAADProfile parameters) { + beginResetAADProfile(resourceGroupName, resourceName, parameters).getFinalResult(); + } + + /** + * Reset the AAD Profile of a managed cluster. + * + * **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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The AAD profile to set on the Managed Cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void resetAADProfile(String resourceGroupName, String resourceName, ManagedClusterAADProfile parameters, + Context context) { + beginResetAADProfile(resourceGroupName, resourceName, parameters, context).getFinalResult(); + } + + /** + * Rotates the certificates of a managed cluster. + * + * See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about + * rotating managed cluster certificates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> rotateClusterCertificatesWithResponseAsync(String resourceGroupName, + String resourceName) { + return FluxUtil + .withContext(context -> service.rotateClusterCertificates(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, resourceName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Rotates the certificates of a managed cluster. + * + * See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about + * rotating managed cluster certificates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response rotateClusterCertificatesWithResponse(String resourceGroupName, String resourceName) { + return service.rotateClusterCertificatesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, Context.NONE); + } + + /** + * Rotates the certificates of a managed cluster. + * + * See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about + * rotating managed cluster certificates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response rotateClusterCertificatesWithResponse(String resourceGroupName, String resourceName, + Context context) { + return service.rotateClusterCertificatesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, context); + } + + /** + * Rotates the certificates of a managed cluster. + * + * See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about + * rotating managed cluster certificates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRotateClusterCertificatesAsync(String resourceGroupName, + String resourceName) { + Mono>> mono + = rotateClusterCertificatesWithResponseAsync(resourceGroupName, resourceName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Rotates the certificates of a managed cluster. + * + * See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about + * rotating managed cluster certificates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRotateClusterCertificates(String resourceGroupName, + String resourceName) { + Response response = rotateClusterCertificatesWithResponse(resourceGroupName, resourceName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Rotates the certificates of a managed cluster. + * + * See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about + * rotating managed cluster certificates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRotateClusterCertificates(String resourceGroupName, + String resourceName, Context context) { + Response response = rotateClusterCertificatesWithResponse(resourceGroupName, resourceName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Rotates the certificates of a managed cluster. + * + * See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about + * rotating managed cluster certificates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono rotateClusterCertificatesAsync(String resourceGroupName, String resourceName) { + return beginRotateClusterCertificatesAsync(resourceGroupName, resourceName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Rotates the certificates of a managed cluster. + * + * See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about + * rotating managed cluster certificates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void rotateClusterCertificates(String resourceGroupName, String resourceName) { + beginRotateClusterCertificates(resourceGroupName, resourceName).getFinalResult(); + } + + /** + * Rotates the certificates of a managed cluster. + * + * See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about + * rotating managed cluster certificates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void rotateClusterCertificates(String resourceGroupName, String resourceName, Context context) { + beginRotateClusterCertificates(resourceGroupName, resourceName, context).getFinalResult(); + } + + /** + * Aborts last operation running on managed cluster. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> abortLatestOperationWithResponseAsync(String resourceGroupName, + String resourceName) { + return FluxUtil + .withContext(context -> service.abortLatestOperation(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Aborts last operation running on managed cluster. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response abortLatestOperationWithResponse(String resourceGroupName, String resourceName) { + return service.abortLatestOperationSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, Context.NONE); + } + + /** + * Aborts last operation running on managed cluster. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response abortLatestOperationWithResponse(String resourceGroupName, String resourceName, + Context context) { + return service.abortLatestOperationSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, context); + } + + /** + * Aborts last operation running on managed cluster. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginAbortLatestOperationAsync(String resourceGroupName, + String resourceName) { + Mono>> mono = abortLatestOperationWithResponseAsync(resourceGroupName, resourceName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Aborts last operation running on managed cluster. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginAbortLatestOperation(String resourceGroupName, String resourceName) { + Response response = abortLatestOperationWithResponse(resourceGroupName, resourceName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Aborts last operation running on managed cluster. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginAbortLatestOperation(String resourceGroupName, String resourceName, + Context context) { + Response response = abortLatestOperationWithResponse(resourceGroupName, resourceName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Aborts last operation running on managed cluster. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono abortLatestOperationAsync(String resourceGroupName, String resourceName) { + return beginAbortLatestOperationAsync(resourceGroupName, resourceName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Aborts last operation running on managed cluster. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void abortLatestOperation(String resourceGroupName, String resourceName) { + beginAbortLatestOperation(resourceGroupName, resourceName).getFinalResult(); + } + + /** + * Aborts last operation running on managed cluster. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void abortLatestOperation(String resourceGroupName, String resourceName, Context context) { + beginAbortLatestOperation(resourceGroupName, resourceName, context).getFinalResult(); + } + + /** + * Rotates the service account signing keys of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> rotateServiceAccountSigningKeysWithResponseAsync(String resourceGroupName, + String resourceName) { + return FluxUtil + .withContext(context -> service.rotateServiceAccountSigningKeys(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, resourceName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Rotates the service account signing keys of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response rotateServiceAccountSigningKeysWithResponse(String resourceGroupName, + String resourceName) { + return service.rotateServiceAccountSigningKeysSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, Context.NONE); + } + + /** + * Rotates the service account signing keys of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response rotateServiceAccountSigningKeysWithResponse(String resourceGroupName, + String resourceName, Context context) { + return service.rotateServiceAccountSigningKeysSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, context); + } + + /** + * Rotates the service account signing keys of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRotateServiceAccountSigningKeysAsync(String resourceGroupName, + String resourceName) { + Mono>> mono + = rotateServiceAccountSigningKeysWithResponseAsync(resourceGroupName, resourceName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Rotates the service account signing keys of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRotateServiceAccountSigningKeys(String resourceGroupName, + String resourceName) { + Response response = rotateServiceAccountSigningKeysWithResponse(resourceGroupName, resourceName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Rotates the service account signing keys of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRotateServiceAccountSigningKeys(String resourceGroupName, + String resourceName, Context context) { + Response response + = rotateServiceAccountSigningKeysWithResponse(resourceGroupName, resourceName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Rotates the service account signing keys of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono rotateServiceAccountSigningKeysAsync(String resourceGroupName, String resourceName) { + return beginRotateServiceAccountSigningKeysAsync(resourceGroupName, resourceName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Rotates the service account signing keys of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void rotateServiceAccountSigningKeys(String resourceGroupName, String resourceName) { + beginRotateServiceAccountSigningKeys(resourceGroupName, resourceName).getFinalResult(); + } + + /** + * Rotates the service account signing keys of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void rotateServiceAccountSigningKeys(String resourceGroupName, String resourceName, Context context) { + beginRotateServiceAccountSigningKeys(resourceGroupName, resourceName, context).getFinalResult(); + } + + /** + * Stops a Managed Cluster + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> stopWithResponseAsync(String resourceGroupName, String resourceName) { + return FluxUtil + .withContext(context -> service.stop(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Stops a Managed Cluster + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response stopWithResponse(String resourceGroupName, String resourceName) { + return service.stopSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, resourceName, Context.NONE); + } + + /** + * Stops a Managed Cluster + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response stopWithResponse(String resourceGroupName, String resourceName, Context context) { + return service.stopSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, resourceName, context); + } + + /** + * Stops a Managed Cluster + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStopAsync(String resourceGroupName, String resourceName) { + Mono>> mono = stopWithResponseAsync(resourceGroupName, resourceName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Stops a Managed Cluster + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStop(String resourceGroupName, String resourceName) { + Response response = stopWithResponse(resourceGroupName, resourceName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Stops a Managed Cluster + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStop(String resourceGroupName, String resourceName, + Context context) { + Response response = stopWithResponse(resourceGroupName, resourceName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Stops a Managed Cluster + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopAsync(String resourceGroupName, String resourceName) { + return beginStopAsync(resourceGroupName, resourceName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stops a Managed Cluster + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void stop(String resourceGroupName, String resourceName) { + beginStop(resourceGroupName, resourceName).getFinalResult(); + } + + /** + * Stops a Managed Cluster + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void stop(String resourceGroupName, String resourceName, Context context) { + beginStop(resourceGroupName, resourceName, context).getFinalResult(); + } + + /** + * Starts a previously stopped Managed Cluster + * + * See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting + * a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync(String resourceGroupName, String resourceName) { + return FluxUtil + .withContext(context -> service.start(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Starts a previously stopped Managed Cluster + * + * See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting + * a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response startWithResponse(String resourceGroupName, String resourceName) { + return service.startSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, Context.NONE); + } + + /** + * Starts a previously stopped Managed Cluster + * + * See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting + * a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response startWithResponse(String resourceGroupName, String resourceName, Context context) { + return service.startSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, context); + } + + /** + * Starts a previously stopped Managed Cluster + * + * See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting + * a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStartAsync(String resourceGroupName, String resourceName) { + Mono>> mono = startWithResponseAsync(resourceGroupName, resourceName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Starts a previously stopped Managed Cluster + * + * See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting + * a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStart(String resourceGroupName, String resourceName) { + Response response = startWithResponse(resourceGroupName, resourceName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Starts a previously stopped Managed Cluster + * + * See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting + * a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStart(String resourceGroupName, String resourceName, + Context context) { + Response response = startWithResponse(resourceGroupName, resourceName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Starts a previously stopped Managed Cluster + * + * See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting + * a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync(String resourceGroupName, String resourceName) { + return beginStartAsync(resourceGroupName, resourceName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts a previously stopped Managed Cluster + * + * See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting + * a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String resourceGroupName, String resourceName) { + beginStart(resourceGroupName, resourceName).getFinalResult(); + } + + /** + * Starts a previously stopped Managed Cluster + * + * See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting + * a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String resourceGroupName, String resourceName, Context context) { + beginStart(resourceGroupName, resourceName, context).getFinalResult(); + } + + /** + * Submits a command to run against the Managed Cluster. + * + * 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). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param requestPayload The run command request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> runCommandWithResponseAsync(String resourceGroupName, String resourceName, + RunCommandRequest requestPayload) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.runCommand(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, contentType, accept, requestPayload, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Submits a command to run against the Managed Cluster. + * + * 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). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param requestPayload The run command request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response runCommandWithResponse(String resourceGroupName, String resourceName, + RunCommandRequest requestPayload) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.runCommandSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, contentType, accept, requestPayload, + Context.NONE); + } + + /** + * Submits a command to run against the Managed Cluster. + * + * 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). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param requestPayload The run command request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response runCommandWithResponse(String resourceGroupName, String resourceName, + RunCommandRequest requestPayload, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.runCommandSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, contentType, accept, requestPayload, + context); + } + + /** + * Submits a command to run against the Managed Cluster. + * + * 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). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param requestPayload The run command request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RunCommandResultInner> + beginRunCommandAsync(String resourceGroupName, String resourceName, RunCommandRequest requestPayload) { + Mono>> mono + = runCommandWithResponseAsync(resourceGroupName, resourceName, requestPayload); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), RunCommandResultInner.class, RunCommandResultInner.class, + this.client.getContext()); + } + + /** + * Submits a command to run against the Managed Cluster. + * + * 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). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param requestPayload The run command request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RunCommandResultInner> + beginRunCommand(String resourceGroupName, String resourceName, RunCommandRequest requestPayload) { + Response response = runCommandWithResponse(resourceGroupName, resourceName, requestPayload); + return this.client.getLroResult(response, + RunCommandResultInner.class, RunCommandResultInner.class, Context.NONE); + } + + /** + * Submits a command to run against the Managed Cluster. + * + * 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). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param requestPayload The run command request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RunCommandResultInner> beginRunCommand( + String resourceGroupName, String resourceName, RunCommandRequest requestPayload, Context context) { + Response response + = runCommandWithResponse(resourceGroupName, resourceName, requestPayload, context); + return this.client.getLroResult(response, + RunCommandResultInner.class, RunCommandResultInner.class, context); + } + + /** + * Submits a command to run against the Managed Cluster. + * + * 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). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param requestPayload The run command request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono runCommandAsync(String resourceGroupName, String resourceName, + RunCommandRequest requestPayload) { + return beginRunCommandAsync(resourceGroupName, resourceName, requestPayload).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Submits a command to run against the Managed Cluster. + * + * 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). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param requestPayload The run command request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RunCommandResultInner runCommand(String resourceGroupName, String resourceName, + RunCommandRequest requestPayload) { + return beginRunCommand(resourceGroupName, resourceName, requestPayload).getFinalResult(); + } + + /** + * Submits a command to run against the Managed Cluster. + * + * 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). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param requestPayload The run command request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RunCommandResultInner runCommand(String resourceGroupName, String resourceName, + RunCommandRequest requestPayload, Context context) { + return beginRunCommand(resourceGroupName, resourceName, requestPayload, context).getFinalResult(); + } + + /** + * Gets the results of a command which has been run on the Managed Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param commandId Id of the command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the results of a command which has been run on the Managed Cluster on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getCommandResultWithResponseAsync(String resourceGroupName, + String resourceName, String commandId) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getCommandResult(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, commandId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the results of a command which has been run on the Managed Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param commandId Id of the command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the results of a command which has been run on the Managed Cluster on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getCommandResultAsync(String resourceGroupName, String resourceName, + String commandId) { + return getCommandResultWithResponseAsync(resourceGroupName, resourceName, commandId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the results of a command which has been run on the Managed Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param commandId Id of the command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the results of a command which has been run on the Managed Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedClustersGetCommandResultResponse getCommandResultWithResponse(String resourceGroupName, + String resourceName, String commandId, Context context) { + final String accept = "application/json"; + return service.getCommandResultSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, commandId, accept, context); + } + + /** + * Gets the results of a command which has been run on the Managed Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param commandId Id of the command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the results of a command which has been run on the Managed Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RunCommandResultInner getCommandResult(String resourceGroupName, String resourceName, String commandId) { + return getCommandResultWithResponse(resourceGroupName, resourceName, commandId, Context.NONE).getValue(); + } + + /** + * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed + * cluster. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed + * cluster. + * + * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster + * along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listOutboundNetworkDependenciesEndpointsSinglePageAsync(String resourceGroupName, String resourceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listOutboundNetworkDependenciesEndpoints(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, + context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed + * cluster. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed + * cluster. + * + * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster + * as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux + listOutboundNetworkDependenciesEndpointsAsync(String resourceGroupName, String resourceName) { + return new PagedFlux<>( + () -> listOutboundNetworkDependenciesEndpointsSinglePageAsync(resourceGroupName, resourceName), + nextLink -> listOutboundNetworkDependenciesEndpointsNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed + * cluster. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed + * cluster. + * + * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster + * along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse + listOutboundNetworkDependenciesEndpointsSinglePage(String resourceGroupName, String resourceName) { + final String accept = "application/json"; + Response res = service.listOutboundNetworkDependenciesEndpointsSync( + this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + resourceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed + * cluster. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed + * cluster. + * + * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster + * along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listOutboundNetworkDependenciesEndpointsSinglePage( + String resourceGroupName, String resourceName, Context context) { + final String accept = "application/json"; + Response res = service.listOutboundNetworkDependenciesEndpointsSync( + this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + resourceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed + * cluster. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed + * cluster. + * + * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster + * as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable + listOutboundNetworkDependenciesEndpoints(String resourceGroupName, String resourceName) { + return new PagedIterable<>( + () -> listOutboundNetworkDependenciesEndpointsSinglePage(resourceGroupName, resourceName), + nextLink -> listOutboundNetworkDependenciesEndpointsNextSinglePage(nextLink)); + } + + /** + * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed + * cluster. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed + * cluster. + * + * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster + * as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable + listOutboundNetworkDependenciesEndpoints(String resourceGroupName, String resourceName, Context context) { + return new PagedIterable<>( + () -> listOutboundNetworkDependenciesEndpointsSinglePage(resourceGroupName, resourceName, context), + nextLink -> listOutboundNetworkDependenciesEndpointsNextSinglePage(nextLink, context)); + } + + /** + * Gets the upgrade profile of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upgrade profile of a managed cluster along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getUpgradeProfileWithResponseAsync(String resourceGroupName, String resourceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getUpgradeProfile(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the upgrade profile of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upgrade profile of a managed cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getUpgradeProfileAsync(String resourceGroupName, + String resourceName) { + return getUpgradeProfileWithResponseAsync(resourceGroupName, resourceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the upgrade profile of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upgrade profile of a managed cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getUpgradeProfileWithResponse(String resourceGroupName, + String resourceName, Context context) { + final String accept = "application/json"; + return service.getUpgradeProfileSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context); + } + + /** + * Gets the upgrade profile of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upgrade profile of a managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedClusterUpgradeProfileInner getUpgradeProfile(String resourceGroupName, String resourceName) { + return getUpgradeProfileWithResponse(resourceGroupName, resourceName, Context.NONE).getValue(); + } + + /** + * Gets a mesh revision profile for a specified mesh in the specified location. + * + * Contains extra metadata on the revision, including supported revisions, cluster compatibility and available + * upgrades. + * + * @param location The name of the Azure region. + * @param mode The mode of the mesh. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a mesh revision profile for a specified mesh in the specified location. + * + * Contains extra metadata on the revision, including supported revisions, cluster compatibility and available + * upgrades along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getMeshRevisionProfileWithResponseAsync(String location, + String mode) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getMeshRevisionProfile(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), location, mode, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a mesh revision profile for a specified mesh in the specified location. + * + * Contains extra metadata on the revision, including supported revisions, cluster compatibility and available + * upgrades. + * + * @param location The name of the Azure region. + * @param mode The mode of the mesh. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a mesh revision profile for a specified mesh in the specified location. + * + * Contains extra metadata on the revision, including supported revisions, cluster compatibility and available + * upgrades on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getMeshRevisionProfileAsync(String location, String mode) { + return getMeshRevisionProfileWithResponseAsync(location, mode).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a mesh revision profile for a specified mesh in the specified location. + * + * Contains extra metadata on the revision, including supported revisions, cluster compatibility and available + * upgrades. + * + * @param location The name of the Azure region. + * @param mode The mode of the mesh. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a mesh revision profile for a specified mesh in the specified location. + * + * Contains extra metadata on the revision, including supported revisions, cluster compatibility and available + * upgrades along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getMeshRevisionProfileWithResponse(String location, String mode, + Context context) { + final String accept = "application/json"; + return service.getMeshRevisionProfileSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, mode, accept, context); + } + + /** + * Gets a mesh revision profile for a specified mesh in the specified location. + * + * Contains extra metadata on the revision, including supported revisions, cluster compatibility and available + * upgrades. + * + * @param location The name of the Azure region. + * @param mode The mode of the mesh. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a mesh revision profile for a specified mesh in the specified location. + * + * Contains extra metadata on the revision, including supported revisions, cluster compatibility and available + * upgrades. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MeshRevisionProfileInner getMeshRevisionProfile(String location, String mode) { + return getMeshRevisionProfileWithResponse(location, mode, Context.NONE).getValue(); + } + + /** + * Lists mesh revision profiles for all meshes in the specified location. + * + * Contains extra metadata on each revision, including supported revisions, cluster compatibility and available + * upgrades. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return holds an array of MeshRevisionsProfiles along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMeshRevisionProfilesSinglePageAsync(String location) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listMeshRevisionProfiles(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), location, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists mesh revision profiles for all meshes in the specified location. + * + * Contains extra metadata on each revision, including supported revisions, cluster compatibility and available + * upgrades. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return holds an array of MeshRevisionsProfiles as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listMeshRevisionProfilesAsync(String location) { + return new PagedFlux<>(() -> listMeshRevisionProfilesSinglePageAsync(location), + nextLink -> listMeshRevisionProfilesNextSinglePageAsync(nextLink)); + } + + /** + * Lists mesh revision profiles for all meshes in the specified location. + * + * Contains extra metadata on each revision, including supported revisions, cluster compatibility and available + * upgrades. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return holds an array of MeshRevisionsProfiles along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listMeshRevisionProfilesSinglePage(String location) { + final String accept = "application/json"; + Response res = service.listMeshRevisionProfilesSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), location, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists mesh revision profiles for all meshes in the specified location. + * + * Contains extra metadata on each revision, including supported revisions, cluster compatibility and available + * upgrades. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return holds an array of MeshRevisionsProfiles along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listMeshRevisionProfilesSinglePage(String location, + Context context) { + final String accept = "application/json"; + Response res = service.listMeshRevisionProfilesSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), location, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists mesh revision profiles for all meshes in the specified location. + * + * Contains extra metadata on each revision, including supported revisions, cluster compatibility and available + * upgrades. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return holds an array of MeshRevisionsProfiles as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMeshRevisionProfiles(String location) { + return new PagedIterable<>(() -> listMeshRevisionProfilesSinglePage(location), + nextLink -> listMeshRevisionProfilesNextSinglePage(nextLink)); + } + + /** + * Lists mesh revision profiles for all meshes in the specified location. + * + * Contains extra metadata on each revision, including supported revisions, cluster compatibility and available + * upgrades. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return holds an array of MeshRevisionsProfiles as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMeshRevisionProfiles(String location, Context context) { + return new PagedIterable<>(() -> listMeshRevisionProfilesSinglePage(location, context), + nextLink -> listMeshRevisionProfilesNextSinglePage(nextLink, context)); + } + + /** + * Gets available upgrades for a service mesh in a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param mode The mode of the mesh. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return available upgrades for a service mesh in a cluster along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getMeshUpgradeProfileWithResponseAsync(String resourceGroupName, + String resourceName, String mode) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.getMeshUpgradeProfile(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, mode, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets available upgrades for a service mesh in a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param mode The mode of the mesh. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return available upgrades for a service mesh in a cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getMeshUpgradeProfileAsync(String resourceGroupName, String resourceName, + String mode) { + return getMeshUpgradeProfileWithResponseAsync(resourceGroupName, resourceName, mode) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets available upgrades for a service mesh in a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param mode The mode of the mesh. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return available upgrades for a service mesh in a cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getMeshUpgradeProfileWithResponse(String resourceGroupName, + String resourceName, String mode, Context context) { + final String accept = "application/json"; + return service.getMeshUpgradeProfileSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, mode, accept, context); + } + + /** + * Gets available upgrades for a service mesh in a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param mode The mode of the mesh. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return available upgrades for a service mesh in a cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MeshUpgradeProfileInner getMeshUpgradeProfile(String resourceGroupName, String resourceName, String mode) { + return getMeshUpgradeProfileWithResponse(resourceGroupName, resourceName, mode, Context.NONE).getValue(); + } + + /** + * Lists available upgrades for all service meshes in a specific cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return holds an array of MeshUpgradeProfiles along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listMeshUpgradeProfilesSinglePageAsync(String resourceGroupName, String resourceName) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listMeshUpgradeProfiles(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists available upgrades for all service meshes in a specific cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return holds an array of MeshUpgradeProfiles as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listMeshUpgradeProfilesAsync(String resourceGroupName, + String resourceName) { + return new PagedFlux<>(() -> listMeshUpgradeProfilesSinglePageAsync(resourceGroupName, resourceName), + nextLink -> listMeshUpgradeProfilesNextSinglePageAsync(nextLink)); + } + + /** + * Lists available upgrades for all service meshes in a specific cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return holds an array of MeshUpgradeProfiles along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listMeshUpgradeProfilesSinglePage(String resourceGroupName, + String resourceName) { + final String accept = "application/json"; + Response res + = service.listMeshUpgradeProfilesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists available upgrades for all service meshes in a specific cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return holds an array of MeshUpgradeProfiles along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listMeshUpgradeProfilesSinglePage(String resourceGroupName, + String resourceName, Context context) { + final String accept = "application/json"; + Response res + = service.listMeshUpgradeProfilesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists available upgrades for all service meshes in a specific cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return holds an array of MeshUpgradeProfiles as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMeshUpgradeProfiles(String resourceGroupName, + String resourceName) { + return new PagedIterable<>(() -> listMeshUpgradeProfilesSinglePage(resourceGroupName, resourceName), + nextLink -> listMeshUpgradeProfilesNextSinglePage(nextLink)); + } + + /** + * Lists available upgrades for all service meshes in a specific cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return holds an array of MeshUpgradeProfiles as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMeshUpgradeProfiles(String resourceGroupName, String resourceName, + Context context) { + return new PagedIterable<>(() -> listMeshUpgradeProfilesSinglePage(resourceGroupName, resourceName, context), + nextLink -> listMeshUpgradeProfilesNextSinglePage(nextLink, context)); + } + + /** + * Gets a list of supported Kubernetes versions in the specified subscription. + * + * Contains extra metadata on the version, including supported patch versions, capabilities, available upgrades, and + * details on preview status of the version. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of supported Kubernetes versions in the specified subscription. + * + * Contains extra metadata on the version, including supported patch versions, capabilities, available upgrades, and + * details on preview status of the version along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listKubernetesVersionsWithResponseAsync(String location) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listKubernetesVersions(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), location, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of supported Kubernetes versions in the specified subscription. + * + * Contains extra metadata on the version, including supported patch versions, capabilities, available upgrades, and + * details on preview status of the version. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of supported Kubernetes versions in the specified subscription. + * + * Contains extra metadata on the version, including supported patch versions, capabilities, available upgrades, and + * details on preview status of the version on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listKubernetesVersionsAsync(String location) { + return listKubernetesVersionsWithResponseAsync(location).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a list of supported Kubernetes versions in the specified subscription. + * + * Contains extra metadata on the version, including supported patch versions, capabilities, available upgrades, and + * details on preview status of the version. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of supported Kubernetes versions in the specified subscription. + * + * Contains extra metadata on the version, including supported patch versions, capabilities, available upgrades, and + * details on preview status of the version along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listKubernetesVersionsWithResponse(String location, + Context context) { + final String accept = "application/json"; + return service.listKubernetesVersionsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, accept, context); + } + + /** + * Gets a list of supported Kubernetes versions in the specified subscription. + * + * Contains extra metadata on the version, including supported patch versions, capabilities, available upgrades, and + * details on preview status of the version. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of supported Kubernetes versions in the specified subscription. + * + * Contains extra metadata on the version, including supported patch versions, capabilities, available upgrades, and + * details on preview status of the version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public KubernetesVersionListResultInner listKubernetesVersions(String location) { + return listKubernetesVersionsWithResponse(location, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ManagedCluster list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ManagedCluster list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ManagedCluster list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of managed clusters in the specified subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of managed clusters in the specified subscription along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of managed clusters in the specified subscription along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed + * cluster. + * + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed + * cluster. + * + * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster + * along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listOutboundNetworkDependenciesEndpointsNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listOutboundNetworkDependenciesEndpointsNext(nextLink, + this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed + * cluster. + * + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed + * cluster. + * + * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster + * along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse + listOutboundNetworkDependenciesEndpointsNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res = service.listOutboundNetworkDependenciesEndpointsNextSync( + nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed + * cluster. + * + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed + * cluster. + * + * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster + * along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse + listOutboundNetworkDependenciesEndpointsNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res = service + .listOutboundNetworkDependenciesEndpointsNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists mesh revision profiles for all meshes in the specified location. + * + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return holds an array of MeshRevisionsProfiles along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMeshRevisionProfilesNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listMeshRevisionProfilesNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists mesh revision profiles for all meshes in the specified location. + * + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return holds an array of MeshRevisionsProfiles along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listMeshRevisionProfilesNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listMeshRevisionProfilesNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists mesh revision profiles for all meshes in the specified location. + * + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return holds an array of MeshRevisionsProfiles along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listMeshRevisionProfilesNextSinglePage(String nextLink, + Context context) { + final String accept = "application/json"; + Response res + = service.listMeshRevisionProfilesNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return holds an array of MeshUpgradeProfiles along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMeshUpgradeProfilesNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listMeshUpgradeProfilesNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return holds an array of MeshUpgradeProfiles along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listMeshUpgradeProfilesNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listMeshUpgradeProfilesNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return holds an array of MeshUpgradeProfiles along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listMeshUpgradeProfilesNextSinglePage(String nextLink, + Context context) { + final String accept = "application/json"; + Response res + = service.listMeshUpgradeProfilesNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClustersImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClustersImpl.java new file mode 100644 index 000000000000..b30ade01b754 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClustersImpl.java @@ -0,0 +1,446 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient; +import com.azure.resourcemanager.containerservice.generated.fluent.models.CredentialResultsInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.KubernetesVersionListResultInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterAccessProfileInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterUpgradeProfileInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.MeshRevisionProfileInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.MeshUpgradeProfileInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.OutboundEnvironmentEndpointInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.RunCommandResultInner; +import com.azure.resourcemanager.containerservice.generated.models.CredentialResults; +import com.azure.resourcemanager.containerservice.generated.models.Format; +import com.azure.resourcemanager.containerservice.generated.models.KubernetesVersionListResult; +import com.azure.resourcemanager.containerservice.generated.models.ManagedCluster; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAADProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAccessProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterServicePrincipalProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterUpgradeProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusters; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClustersGetCommandResultResponse; +import com.azure.resourcemanager.containerservice.generated.models.MeshRevisionProfile; +import com.azure.resourcemanager.containerservice.generated.models.MeshUpgradeProfile; +import com.azure.resourcemanager.containerservice.generated.models.OutboundEnvironmentEndpoint; +import com.azure.resourcemanager.containerservice.generated.models.RunCommandRequest; +import com.azure.resourcemanager.containerservice.generated.models.RunCommandResult; + +public final class ManagedClustersImpl implements ManagedClusters { + private static final ClientLogger LOGGER = new ClientLogger(ManagedClustersImpl.class); + + private final ManagedClustersClient innerClient; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + public ManagedClustersImpl(ManagedClustersClient innerClient, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String resourceName, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, resourceName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ManagedClusterImpl(inner.getValue(), this.manager())); + } + + public ManagedCluster getByResourceGroup(String resourceGroupName, String resourceName) { + ManagedClusterInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, resourceName); + if (inner != null) { + return new ManagedClusterImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String resourceName) { + this.serviceClient().delete(resourceGroupName, resourceName); + } + + public void delete(String resourceGroupName, String resourceName, String ifMatch, Context context) { + this.serviceClient().delete(resourceGroupName, resourceName, ifMatch, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ManagedClusterImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ManagedClusterImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ManagedClusterImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ManagedClusterImpl(inner1, this.manager())); + } + + public Response getAccessProfileWithResponse(String resourceGroupName, + String resourceName, String roleName, Context context) { + Response inner + = this.serviceClient().getAccessProfileWithResponse(resourceGroupName, resourceName, roleName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ManagedClusterAccessProfileImpl(inner.getValue(), this.manager())); + } + + public ManagedClusterAccessProfile getAccessProfile(String resourceGroupName, String resourceName, + String roleName) { + ManagedClusterAccessProfileInner inner + = this.serviceClient().getAccessProfile(resourceGroupName, resourceName, roleName); + if (inner != null) { + return new ManagedClusterAccessProfileImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listClusterAdminCredentialsWithResponse(String resourceGroupName, + String resourceName, String serverFqdn, Context context) { + Response inner = this.serviceClient() + .listClusterAdminCredentialsWithResponse(resourceGroupName, resourceName, serverFqdn, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CredentialResultsImpl(inner.getValue(), this.manager())); + } + + public CredentialResults listClusterAdminCredentials(String resourceGroupName, String resourceName) { + CredentialResultsInner inner + = this.serviceClient().listClusterAdminCredentials(resourceGroupName, resourceName); + if (inner != null) { + return new CredentialResultsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listClusterUserCredentialsWithResponse(String resourceGroupName, + String resourceName, String serverFqdn, Format format, Context context) { + Response inner = this.serviceClient() + .listClusterUserCredentialsWithResponse(resourceGroupName, resourceName, serverFqdn, format, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CredentialResultsImpl(inner.getValue(), this.manager())); + } + + public CredentialResults listClusterUserCredentials(String resourceGroupName, String resourceName) { + CredentialResultsInner inner = this.serviceClient().listClusterUserCredentials(resourceGroupName, resourceName); + if (inner != null) { + return new CredentialResultsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listClusterMonitoringUserCredentialsWithResponse(String resourceGroupName, + String resourceName, String serverFqdn, Context context) { + Response inner = this.serviceClient() + .listClusterMonitoringUserCredentialsWithResponse(resourceGroupName, resourceName, serverFqdn, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CredentialResultsImpl(inner.getValue(), this.manager())); + } + + public CredentialResults listClusterMonitoringUserCredentials(String resourceGroupName, String resourceName) { + CredentialResultsInner inner + = this.serviceClient().listClusterMonitoringUserCredentials(resourceGroupName, resourceName); + if (inner != null) { + return new CredentialResultsImpl(inner, this.manager()); + } else { + return null; + } + } + + public void resetServicePrincipalProfile(String resourceGroupName, String resourceName, + ManagedClusterServicePrincipalProfile parameters) { + this.serviceClient().resetServicePrincipalProfile(resourceGroupName, resourceName, parameters); + } + + public void resetServicePrincipalProfile(String resourceGroupName, String resourceName, + ManagedClusterServicePrincipalProfile parameters, Context context) { + this.serviceClient().resetServicePrincipalProfile(resourceGroupName, resourceName, parameters, context); + } + + public void resetAADProfile(String resourceGroupName, String resourceName, ManagedClusterAADProfile parameters) { + this.serviceClient().resetAADProfile(resourceGroupName, resourceName, parameters); + } + + public void resetAADProfile(String resourceGroupName, String resourceName, ManagedClusterAADProfile parameters, + Context context) { + this.serviceClient().resetAADProfile(resourceGroupName, resourceName, parameters, context); + } + + public void rotateClusterCertificates(String resourceGroupName, String resourceName) { + this.serviceClient().rotateClusterCertificates(resourceGroupName, resourceName); + } + + public void rotateClusterCertificates(String resourceGroupName, String resourceName, Context context) { + this.serviceClient().rotateClusterCertificates(resourceGroupName, resourceName, context); + } + + public void abortLatestOperation(String resourceGroupName, String resourceName) { + this.serviceClient().abortLatestOperation(resourceGroupName, resourceName); + } + + public void abortLatestOperation(String resourceGroupName, String resourceName, Context context) { + this.serviceClient().abortLatestOperation(resourceGroupName, resourceName, context); + } + + public void rotateServiceAccountSigningKeys(String resourceGroupName, String resourceName) { + this.serviceClient().rotateServiceAccountSigningKeys(resourceGroupName, resourceName); + } + + public void rotateServiceAccountSigningKeys(String resourceGroupName, String resourceName, Context context) { + this.serviceClient().rotateServiceAccountSigningKeys(resourceGroupName, resourceName, context); + } + + public void stop(String resourceGroupName, String resourceName) { + this.serviceClient().stop(resourceGroupName, resourceName); + } + + public void stop(String resourceGroupName, String resourceName, Context context) { + this.serviceClient().stop(resourceGroupName, resourceName, context); + } + + public void start(String resourceGroupName, String resourceName) { + this.serviceClient().start(resourceGroupName, resourceName); + } + + public void start(String resourceGroupName, String resourceName, Context context) { + this.serviceClient().start(resourceGroupName, resourceName, context); + } + + public RunCommandResult runCommand(String resourceGroupName, String resourceName, + RunCommandRequest requestPayload) { + RunCommandResultInner inner = this.serviceClient().runCommand(resourceGroupName, resourceName, requestPayload); + if (inner != null) { + return new RunCommandResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public RunCommandResult runCommand(String resourceGroupName, String resourceName, RunCommandRequest requestPayload, + Context context) { + RunCommandResultInner inner + = this.serviceClient().runCommand(resourceGroupName, resourceName, requestPayload, context); + if (inner != null) { + return new RunCommandResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getCommandResultWithResponse(String resourceGroupName, String resourceName, + String commandId, Context context) { + ManagedClustersGetCommandResultResponse inner + = this.serviceClient().getCommandResultWithResponse(resourceGroupName, resourceName, commandId, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RunCommandResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RunCommandResult getCommandResult(String resourceGroupName, String resourceName, String commandId) { + RunCommandResultInner inner = this.serviceClient().getCommandResult(resourceGroupName, resourceName, commandId); + if (inner != null) { + return new RunCommandResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listOutboundNetworkDependenciesEndpoints(String resourceGroupName, + String resourceName) { + PagedIterable inner + = this.serviceClient().listOutboundNetworkDependenciesEndpoints(resourceGroupName, resourceName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new OutboundEnvironmentEndpointImpl(inner1, this.manager())); + } + + public PagedIterable listOutboundNetworkDependenciesEndpoints(String resourceGroupName, + String resourceName, Context context) { + PagedIterable inner + = this.serviceClient().listOutboundNetworkDependenciesEndpoints(resourceGroupName, resourceName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new OutboundEnvironmentEndpointImpl(inner1, this.manager())); + } + + public Response getUpgradeProfileWithResponse(String resourceGroupName, + String resourceName, Context context) { + Response inner + = this.serviceClient().getUpgradeProfileWithResponse(resourceGroupName, resourceName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ManagedClusterUpgradeProfileImpl(inner.getValue(), this.manager())); + } + + public ManagedClusterUpgradeProfile getUpgradeProfile(String resourceGroupName, String resourceName) { + ManagedClusterUpgradeProfileInner inner + = this.serviceClient().getUpgradeProfile(resourceGroupName, resourceName); + if (inner != null) { + return new ManagedClusterUpgradeProfileImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getMeshRevisionProfileWithResponse(String location, String mode, + Context context) { + Response inner + = this.serviceClient().getMeshRevisionProfileWithResponse(location, mode, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new MeshRevisionProfileImpl(inner.getValue(), this.manager())); + } + + public MeshRevisionProfile getMeshRevisionProfile(String location, String mode) { + MeshRevisionProfileInner inner = this.serviceClient().getMeshRevisionProfile(location, mode); + if (inner != null) { + return new MeshRevisionProfileImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listMeshRevisionProfiles(String location) { + PagedIterable inner = this.serviceClient().listMeshRevisionProfiles(location); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MeshRevisionProfileImpl(inner1, this.manager())); + } + + public PagedIterable listMeshRevisionProfiles(String location, Context context) { + PagedIterable inner + = this.serviceClient().listMeshRevisionProfiles(location, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MeshRevisionProfileImpl(inner1, this.manager())); + } + + public Response getMeshUpgradeProfileWithResponse(String resourceGroupName, String resourceName, + String mode, Context context) { + Response inner + = this.serviceClient().getMeshUpgradeProfileWithResponse(resourceGroupName, resourceName, mode, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new MeshUpgradeProfileImpl(inner.getValue(), this.manager())); + } + + public MeshUpgradeProfile getMeshUpgradeProfile(String resourceGroupName, String resourceName, String mode) { + MeshUpgradeProfileInner inner + = this.serviceClient().getMeshUpgradeProfile(resourceGroupName, resourceName, mode); + if (inner != null) { + return new MeshUpgradeProfileImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listMeshUpgradeProfiles(String resourceGroupName, String resourceName) { + PagedIterable inner + = this.serviceClient().listMeshUpgradeProfiles(resourceGroupName, resourceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MeshUpgradeProfileImpl(inner1, this.manager())); + } + + public PagedIterable listMeshUpgradeProfiles(String resourceGroupName, String resourceName, + Context context) { + PagedIterable inner + = this.serviceClient().listMeshUpgradeProfiles(resourceGroupName, resourceName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MeshUpgradeProfileImpl(inner1, this.manager())); + } + + public Response listKubernetesVersionsWithResponse(String location, Context context) { + Response inner + = this.serviceClient().listKubernetesVersionsWithResponse(location, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new KubernetesVersionListResultImpl(inner.getValue(), this.manager())); + } + + public KubernetesVersionListResult listKubernetesVersions(String location) { + KubernetesVersionListResultInner inner = this.serviceClient().listKubernetesVersions(location); + if (inner != null) { + return new KubernetesVersionListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public ManagedCluster getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = ResourceManagerUtils.getValueFromIdByName(id, "managedClusters"); + if (resourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedClusters'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, resourceName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = ResourceManagerUtils.getValueFromIdByName(id, "managedClusters"); + if (resourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedClusters'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, resourceName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = ResourceManagerUtils.getValueFromIdByName(id, "managedClusters"); + if (resourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedClusters'.", id))); + } + String localIfMatch = null; + this.delete(resourceGroupName, resourceName, localIfMatch, Context.NONE); + } + + public void deleteByIdWithResponse(String id, String ifMatch, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = ResourceManagerUtils.getValueFromIdByName(id, "managedClusters"); + if (resourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedClusters'.", id))); + } + this.delete(resourceGroupName, resourceName, ifMatch, context); + } + + private ManagedClustersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } + + public ManagedClusterImpl define(String name) { + return new ManagedClusterImpl(name, this.manager()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedNamespaceImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedNamespaceImpl.java new file mode 100644 index 000000000000..60b35084b72c --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedNamespaceImpl.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedNamespaceInner; +import com.azure.resourcemanager.containerservice.generated.models.CredentialResults; +import com.azure.resourcemanager.containerservice.generated.models.ManagedNamespace; +import com.azure.resourcemanager.containerservice.generated.models.NamespaceProperties; +import com.azure.resourcemanager.containerservice.generated.models.TagsObject; +import java.util.Collections; +import java.util.Map; + +public final class ManagedNamespaceImpl + implements ManagedNamespace, ManagedNamespace.Definition, ManagedNamespace.Update { + private ManagedNamespaceInner innerObject; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public NamespaceProperties properties() { + return this.innerModel().properties(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String location() { + return this.innerModel().location(); + } + + public String eTag() { + return this.innerModel().eTag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ManagedNamespaceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String resourceName; + + private String managedNamespaceName; + + private TagsObject updateParameters; + + public ManagedNamespaceImpl withExistingManagedCluster(String resourceGroupName, String resourceName) { + this.resourceGroupName = resourceGroupName; + this.resourceName = resourceName; + return this; + } + + public ManagedNamespace create() { + this.innerObject = serviceManager.serviceClient() + .getManagedNamespaces() + .createOrUpdate(resourceGroupName, resourceName, managedNamespaceName, this.innerModel(), Context.NONE); + return this; + } + + public ManagedNamespace create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getManagedNamespaces() + .createOrUpdate(resourceGroupName, resourceName, managedNamespaceName, this.innerModel(), context); + return this; + } + + ManagedNamespaceImpl(String name, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = new ManagedNamespaceInner(); + this.serviceManager = serviceManager; + this.managedNamespaceName = name; + } + + public ManagedNamespaceImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public ManagedNamespace apply() { + this.innerObject = serviceManager.serviceClient() + .getManagedNamespaces() + .updateWithResponse(resourceGroupName, resourceName, managedNamespaceName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public ManagedNamespace apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getManagedNamespaces() + .updateWithResponse(resourceGroupName, resourceName, managedNamespaceName, updateParameters, context) + .getValue(); + return this; + } + + ManagedNamespaceImpl(ManagedNamespaceInner innerObject, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.resourceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "managedClusters"); + this.managedNamespaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "managedNamespaces"); + } + + public ManagedNamespace refresh() { + this.innerObject = serviceManager.serviceClient() + .getManagedNamespaces() + .getWithResponse(resourceGroupName, resourceName, managedNamespaceName, Context.NONE) + .getValue(); + return this; + } + + public ManagedNamespace refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getManagedNamespaces() + .getWithResponse(resourceGroupName, resourceName, managedNamespaceName, context) + .getValue(); + return this; + } + + public Response listCredentialWithResponse(Context context) { + return serviceManager.managedNamespaces() + .listCredentialWithResponse(resourceGroupName, resourceName, managedNamespaceName, context); + } + + public CredentialResults listCredential() { + return serviceManager.managedNamespaces().listCredential(resourceGroupName, resourceName, managedNamespaceName); + } + + public ManagedNamespaceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ManagedNamespaceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ManagedNamespaceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public ManagedNamespaceImpl withProperties(NamespaceProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel() == null || this.innerModel().id() == null; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedNamespacesClientImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedNamespacesClientImpl.java new file mode 100644 index 000000000000..3c4050162831 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedNamespacesClientImpl.java @@ -0,0 +1,989 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerservice.generated.fluent.ManagedNamespacesClient; +import com.azure.resourcemanager.containerservice.generated.fluent.models.CredentialResultsInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedNamespaceInner; +import com.azure.resourcemanager.containerservice.generated.implementation.models.ManagedNamespaceListResult; +import com.azure.resourcemanager.containerservice.generated.models.TagsObject; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ManagedNamespacesClient. + */ +public final class ManagedNamespacesClientImpl implements ManagedNamespacesClient { + /** + * The proxy service used to perform REST calls. + */ + private final ManagedNamespacesService service; + + /** + * The service client containing this operation class. + */ + private final ContainerServiceManagementClientImpl client; + + /** + * Initializes an instance of ManagedNamespacesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ManagedNamespacesClientImpl(ContainerServiceManagementClientImpl client) { + this.service + = RestProxy.create(ManagedNamespacesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerServiceManagementClientManagedNamespaces to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ContainerServiceManagementClientManagedNamespaces") + public interface ManagedNamespacesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/managedNamespaces/{managedNamespaceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("managedNamespaceName") String managedNamespaceName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/managedNamespaces/{managedNamespaceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("managedNamespaceName") String managedNamespaceName, @HeaderParam("Accept") String accept, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/managedNamespaces/{managedNamespaceName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("managedNamespaceName") String managedNamespaceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ManagedNamespaceInner parameters, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/managedNamespaces/{managedNamespaceName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("managedNamespaceName") String managedNamespaceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ManagedNamespaceInner parameters, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/managedNamespaces/{managedNamespaceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("managedNamespaceName") String managedNamespaceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") TagsObject parameters, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/managedNamespaces/{managedNamespaceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("managedNamespaceName") String managedNamespaceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") TagsObject parameters, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/managedNamespaces/{managedNamespaceName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("managedNamespaceName") String managedNamespaceName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/managedNamespaces/{managedNamespaceName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("managedNamespaceName") String managedNamespaceName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/managedNamespaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByManagedCluster(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/managedNamespaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByManagedClusterSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/managedNamespaces/{managedNamespaceName}/listCredential") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listCredential(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("managedNamespaceName") String managedNamespaceName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/managedNamespaces/{managedNamespaceName}/listCredential") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listCredentialSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("managedNamespaceName") String managedNamespaceName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByManagedClusterNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByManagedClusterNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets the specified namespace of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified namespace of a managed cluster along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String resourceName, + String managedNamespaceName) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, managedNamespaceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified namespace of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified namespace of a managed cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String resourceName, + String managedNamespaceName) { + return getWithResponseAsync(resourceGroupName, resourceName, managedNamespaceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the specified namespace of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified namespace of a managed cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String resourceName, + String managedNamespaceName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, resourceName, managedNamespaceName, accept, context); + } + + /** + * Gets the specified namespace of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified namespace of a managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedNamespaceInner get(String resourceGroupName, String resourceName, String managedNamespaceName) { + return getWithResponse(resourceGroupName, resourceName, managedNamespaceName, Context.NONE).getValue(); + } + + /** + * Creates or updates a namespace managed by ARM for the specified managed cluster. Users can configure aspects like + * resource quotas, network ingress/egress policies, and more. See aka.ms/aks/managed-namespaces for more details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @param parameters The namespace to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace managed by ARM along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String resourceName, String managedNamespaceName, ManagedNamespaceInner parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, managedNamespaceName, contentType, + accept, parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a namespace managed by ARM for the specified managed cluster. Users can configure aspects like + * resource quotas, network ingress/egress policies, and more. See aka.ms/aks/managed-namespaces for more details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @param parameters The namespace to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace managed by ARM along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String resourceName, + String managedNamespaceName, ManagedNamespaceInner parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, managedNamespaceName, contentType, accept, + parameters, Context.NONE); + } + + /** + * Creates or updates a namespace managed by ARM for the specified managed cluster. Users can configure aspects like + * resource quotas, network ingress/egress policies, and more. See aka.ms/aks/managed-namespaces for more details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @param parameters The namespace to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace managed by ARM along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String resourceName, + String managedNamespaceName, ManagedNamespaceInner parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, managedNamespaceName, contentType, accept, + parameters, context); + } + + /** + * Creates or updates a namespace managed by ARM for the specified managed cluster. Users can configure aspects like + * resource quotas, network ingress/egress policies, and more. See aka.ms/aks/managed-namespaces for more details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @param parameters The namespace to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of namespace managed by ARM. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ManagedNamespaceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String resourceName, String managedNamespaceName, ManagedNamespaceInner parameters) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, resourceName, managedNamespaceName, parameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ManagedNamespaceInner.class, ManagedNamespaceInner.class, + this.client.getContext()); + } + + /** + * Creates or updates a namespace managed by ARM for the specified managed cluster. Users can configure aspects like + * resource quotas, network ingress/egress policies, and more. See aka.ms/aks/managed-namespaces for more details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @param parameters The namespace to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of namespace managed by ARM. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ManagedNamespaceInner> beginCreateOrUpdate( + String resourceGroupName, String resourceName, String managedNamespaceName, ManagedNamespaceInner parameters) { + Response response + = createOrUpdateWithResponse(resourceGroupName, resourceName, managedNamespaceName, parameters); + return this.client.getLroResult(response, + ManagedNamespaceInner.class, ManagedNamespaceInner.class, Context.NONE); + } + + /** + * Creates or updates a namespace managed by ARM for the specified managed cluster. Users can configure aspects like + * resource quotas, network ingress/egress policies, and more. See aka.ms/aks/managed-namespaces for more details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @param parameters The namespace to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of namespace managed by ARM. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ManagedNamespaceInner> beginCreateOrUpdate( + String resourceGroupName, String resourceName, String managedNamespaceName, ManagedNamespaceInner parameters, + Context context) { + Response response + = createOrUpdateWithResponse(resourceGroupName, resourceName, managedNamespaceName, parameters, context); + return this.client.getLroResult(response, + ManagedNamespaceInner.class, ManagedNamespaceInner.class, context); + } + + /** + * Creates or updates a namespace managed by ARM for the specified managed cluster. Users can configure aspects like + * resource quotas, network ingress/egress policies, and more. See aka.ms/aks/managed-namespaces for more details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @param parameters The namespace to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace managed by ARM on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String resourceName, + String managedNamespaceName, ManagedNamespaceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, resourceName, managedNamespaceName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a namespace managed by ARM for the specified managed cluster. Users can configure aspects like + * resource quotas, network ingress/egress policies, and more. See aka.ms/aks/managed-namespaces for more details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @param parameters The namespace to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace managed by ARM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedNamespaceInner createOrUpdate(String resourceGroupName, String resourceName, + String managedNamespaceName, ManagedNamespaceInner parameters) { + return beginCreateOrUpdate(resourceGroupName, resourceName, managedNamespaceName, parameters).getFinalResult(); + } + + /** + * Creates or updates a namespace managed by ARM for the specified managed cluster. Users can configure aspects like + * resource quotas, network ingress/egress policies, and more. See aka.ms/aks/managed-namespaces for more details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @param parameters The namespace to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace managed by ARM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedNamespaceInner createOrUpdate(String resourceGroupName, String resourceName, + String managedNamespaceName, ManagedNamespaceInner parameters, Context context) { + return beginCreateOrUpdate(resourceGroupName, resourceName, managedNamespaceName, parameters, context) + .getFinalResult(); + } + + /** + * Updates tags on a managed namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @param parameters Parameters supplied to the patch namespace operation, we only support patch tags for now. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace managed by ARM along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, String resourceName, + String managedNamespaceName, TagsObject parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, managedNamespaceName, contentType, + accept, parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates tags on a managed namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @param parameters Parameters supplied to the patch namespace operation, we only support patch tags for now. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace managed by ARM on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String resourceName, + String managedNamespaceName, TagsObject parameters) { + return updateWithResponseAsync(resourceGroupName, resourceName, managedNamespaceName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Updates tags on a managed namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @param parameters Parameters supplied to the patch namespace operation, we only support patch tags for now. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace managed by ARM along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse(String resourceGroupName, String resourceName, + String managedNamespaceName, TagsObject parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, managedNamespaceName, contentType, accept, + parameters, context); + } + + /** + * Updates tags on a managed namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @param parameters Parameters supplied to the patch namespace operation, we only support patch tags for now. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace managed by ARM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedNamespaceInner update(String resourceGroupName, String resourceName, String managedNamespaceName, + TagsObject parameters) { + return updateWithResponse(resourceGroupName, resourceName, managedNamespaceName, parameters, Context.NONE) + .getValue(); + } + + /** + * Deletes a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String resourceName, + String managedNamespaceName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, managedNamespaceName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String resourceName, + String managedNamespaceName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, managedNamespaceName, Context.NONE); + } + + /** + * Deletes a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String resourceName, + String managedNamespaceName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, managedNamespaceName, context); + } + + /** + * Deletes a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String resourceName, + String managedNamespaceName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, resourceName, managedNamespaceName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, + String managedNamespaceName) { + Response response = deleteWithResponse(resourceGroupName, resourceName, managedNamespaceName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, + String managedNamespaceName, Context context) { + Response response + = deleteWithResponse(resourceGroupName, resourceName, managedNamespaceName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Deletes a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String resourceName, String managedNamespaceName) { + return beginDeleteAsync(resourceGroupName, resourceName, managedNamespaceName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String resourceName, String managedNamespaceName) { + beginDelete(resourceGroupName, resourceName, managedNamespaceName).getFinalResult(); + } + + /** + * Deletes a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String resourceName, String managedNamespaceName, Context context) { + beginDelete(resourceGroupName, resourceName, managedNamespaceName, context).getFinalResult(); + } + + /** + * Gets a list of managed namespaces in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of managed namespaces in the specified managed cluster along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByManagedClusterSinglePageAsync(String resourceGroupName, + String resourceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByManagedCluster(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of managed namespaces in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of managed namespaces in the specified managed cluster as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByManagedClusterAsync(String resourceGroupName, String resourceName) { + return new PagedFlux<>(() -> listByManagedClusterSinglePageAsync(resourceGroupName, resourceName), + nextLink -> listByManagedClusterNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of managed namespaces in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of managed namespaces in the specified managed cluster along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByManagedClusterSinglePage(String resourceGroupName, + String resourceName) { + final String accept = "application/json"; + Response res + = service.listByManagedClusterSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets a list of managed namespaces in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of managed namespaces in the specified managed cluster along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByManagedClusterSinglePage(String resourceGroupName, + String resourceName, Context context) { + final String accept = "application/json"; + Response res + = service.listByManagedClusterSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets a list of managed namespaces in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of managed namespaces in the specified managed cluster as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByManagedCluster(String resourceGroupName, String resourceName) { + return new PagedIterable<>(() -> listByManagedClusterSinglePage(resourceGroupName, resourceName), + nextLink -> listByManagedClusterNextSinglePage(nextLink)); + } + + /** + * Gets a list of managed namespaces in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of managed namespaces in the specified managed cluster as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByManagedCluster(String resourceGroupName, String resourceName, + Context context) { + return new PagedIterable<>(() -> listByManagedClusterSinglePage(resourceGroupName, resourceName, context), + nextLink -> listByManagedClusterNextSinglePage(nextLink, context)); + } + + /** + * Lists the credentials of a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list credential result response along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCredentialWithResponseAsync(String resourceGroupName, + String resourceName, String managedNamespaceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listCredential(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, managedNamespaceName, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the credentials of a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list credential result response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listCredentialAsync(String resourceGroupName, String resourceName, + String managedNamespaceName) { + return listCredentialWithResponseAsync(resourceGroupName, resourceName, managedNamespaceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Lists the credentials of a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list credential result response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listCredentialWithResponse(String resourceGroupName, String resourceName, + String managedNamespaceName, Context context) { + final String accept = "application/json"; + return service.listCredentialSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, managedNamespaceName, accept, context); + } + + /** + * Lists the credentials of a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list credential result response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CredentialResultsInner listCredential(String resourceGroupName, String resourceName, + String managedNamespaceName) { + return listCredentialWithResponse(resourceGroupName, resourceName, managedNamespaceName, Context.NONE) + .getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of managed namespaces in the specified managed cluster along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByManagedClusterNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByManagedClusterNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of managed namespaces in the specified managed cluster along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByManagedClusterNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByManagedClusterNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of managed namespaces in the specified managed cluster along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByManagedClusterNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listByManagedClusterNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedNamespacesImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedNamespacesImpl.java new file mode 100644 index 000000000000..56da59ce4149 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedNamespacesImpl.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerservice.generated.fluent.ManagedNamespacesClient; +import com.azure.resourcemanager.containerservice.generated.fluent.models.CredentialResultsInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedNamespaceInner; +import com.azure.resourcemanager.containerservice.generated.models.CredentialResults; +import com.azure.resourcemanager.containerservice.generated.models.ManagedNamespace; +import com.azure.resourcemanager.containerservice.generated.models.ManagedNamespaces; + +public final class ManagedNamespacesImpl implements ManagedNamespaces { + private static final ClientLogger LOGGER = new ClientLogger(ManagedNamespacesImpl.class); + + private final ManagedNamespacesClient innerClient; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + public ManagedNamespacesImpl(ManagedNamespacesClient innerClient, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String resourceName, + String managedNamespaceName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, resourceName, managedNamespaceName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ManagedNamespaceImpl(inner.getValue(), this.manager())); + } + + public ManagedNamespace get(String resourceGroupName, String resourceName, String managedNamespaceName) { + ManagedNamespaceInner inner = this.serviceClient().get(resourceGroupName, resourceName, managedNamespaceName); + if (inner != null) { + return new ManagedNamespaceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String resourceName, String managedNamespaceName) { + this.serviceClient().delete(resourceGroupName, resourceName, managedNamespaceName); + } + + public void delete(String resourceGroupName, String resourceName, String managedNamespaceName, Context context) { + this.serviceClient().delete(resourceGroupName, resourceName, managedNamespaceName, context); + } + + public PagedIterable listByManagedCluster(String resourceGroupName, String resourceName) { + PagedIterable inner + = this.serviceClient().listByManagedCluster(resourceGroupName, resourceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ManagedNamespaceImpl(inner1, this.manager())); + } + + public PagedIterable listByManagedCluster(String resourceGroupName, String resourceName, + Context context) { + PagedIterable inner + = this.serviceClient().listByManagedCluster(resourceGroupName, resourceName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ManagedNamespaceImpl(inner1, this.manager())); + } + + public Response listCredentialWithResponse(String resourceGroupName, String resourceName, + String managedNamespaceName, Context context) { + Response inner = this.serviceClient() + .listCredentialWithResponse(resourceGroupName, resourceName, managedNamespaceName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CredentialResultsImpl(inner.getValue(), this.manager())); + } + + public CredentialResults listCredential(String resourceGroupName, String resourceName, + String managedNamespaceName) { + CredentialResultsInner inner + = this.serviceClient().listCredential(resourceGroupName, resourceName, managedNamespaceName); + if (inner != null) { + return new CredentialResultsImpl(inner, this.manager()); + } else { + return null; + } + } + + public ManagedNamespace getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = ResourceManagerUtils.getValueFromIdByName(id, "managedClusters"); + if (resourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedClusters'.", id))); + } + String managedNamespaceName = ResourceManagerUtils.getValueFromIdByName(id, "managedNamespaces"); + if (managedNamespaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedNamespaces'.", id))); + } + return this.getWithResponse(resourceGroupName, resourceName, managedNamespaceName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = ResourceManagerUtils.getValueFromIdByName(id, "managedClusters"); + if (resourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedClusters'.", id))); + } + String managedNamespaceName = ResourceManagerUtils.getValueFromIdByName(id, "managedNamespaces"); + if (managedNamespaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedNamespaces'.", id))); + } + return this.getWithResponse(resourceGroupName, resourceName, managedNamespaceName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = ResourceManagerUtils.getValueFromIdByName(id, "managedClusters"); + if (resourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedClusters'.", id))); + } + String managedNamespaceName = ResourceManagerUtils.getValueFromIdByName(id, "managedNamespaces"); + if (managedNamespaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedNamespaces'.", id))); + } + this.delete(resourceGroupName, resourceName, managedNamespaceName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = ResourceManagerUtils.getValueFromIdByName(id, "managedClusters"); + if (resourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedClusters'.", id))); + } + String managedNamespaceName = ResourceManagerUtils.getValueFromIdByName(id, "managedNamespaces"); + if (managedNamespaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedNamespaces'.", id))); + } + this.delete(resourceGroupName, resourceName, managedNamespaceName, context); + } + + private ManagedNamespacesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } + + public ManagedNamespaceImpl define(String name) { + return new ManagedNamespaceImpl(name, this.manager()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MeshRevisionProfileImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MeshRevisionProfileImpl.java new file mode 100644 index 000000000000..1b94a60e5398 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MeshRevisionProfileImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.containerservice.generated.fluent.models.MeshRevisionProfileInner; +import com.azure.resourcemanager.containerservice.generated.models.MeshRevisionProfile; +import com.azure.resourcemanager.containerservice.generated.models.MeshRevisionProfileProperties; + +public final class MeshRevisionProfileImpl implements MeshRevisionProfile { + private MeshRevisionProfileInner innerObject; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + MeshRevisionProfileImpl(MeshRevisionProfileInner innerObject, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public MeshRevisionProfileProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public MeshRevisionProfileInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MeshUpgradeProfileImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MeshUpgradeProfileImpl.java new file mode 100644 index 000000000000..03b500268ed2 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MeshUpgradeProfileImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.containerservice.generated.fluent.models.MeshUpgradeProfileInner; +import com.azure.resourcemanager.containerservice.generated.models.MeshUpgradeProfile; +import com.azure.resourcemanager.containerservice.generated.models.MeshUpgradeProfileProperties; + +public final class MeshUpgradeProfileImpl implements MeshUpgradeProfile { + private MeshUpgradeProfileInner innerObject; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + MeshUpgradeProfileImpl(MeshUpgradeProfileInner innerObject, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public MeshUpgradeProfileProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public MeshUpgradeProfileInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OperationValueImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OperationValueImpl.java new file mode 100644 index 000000000000..19e67f407a11 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OperationValueImpl.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.OperationValueInner; +import com.azure.resourcemanager.containerservice.generated.models.OperationValue; + +public final class OperationValueImpl implements OperationValue { + private OperationValueInner innerObject; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + OperationValueImpl(OperationValueInner innerObject, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String origin() { + return this.innerModel().origin(); + } + + public String name() { + return this.innerModel().name(); + } + + public String operation() { + return this.innerModel().operation(); + } + + public String resource() { + return this.innerModel().resource(); + } + + public String description() { + return this.innerModel().description(); + } + + public String provider() { + return this.innerModel().provider(); + } + + public OperationValueInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OperationsClientImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..211c0558a7e1 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OperationsClientImpl.java @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.containerservice.generated.fluent.OperationsClient; +import com.azure.resourcemanager.containerservice.generated.fluent.models.OperationValueInner; +import com.azure.resourcemanager.containerservice.generated.implementation.models.OperationListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ +public final class OperationsClientImpl implements OperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final OperationsService service; + + /** + * The service client containing this operation class. + */ + private final ContainerServiceManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(ContainerServiceManagementClientImpl client) { + this.service + = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerServiceManagementClientOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ContainerServiceManagementClientOperations") + public interface OperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.ContainerService/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.ContainerService/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets a list of operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of operations along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of operations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of operations along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets a list of operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of operations along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets a list of operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Gets a list of operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of operations along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of operations along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of operations along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OperationsImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OperationsImpl.java new file mode 100644 index 000000000000..46bbd1ac8412 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OperationsImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerservice.generated.fluent.OperationsClient; +import com.azure.resourcemanager.containerservice.generated.fluent.models.OperationValueInner; +import com.azure.resourcemanager.containerservice.generated.models.OperationValue; +import com.azure.resourcemanager.containerservice.generated.models.Operations; + +public final class OperationsImpl implements Operations { + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + public OperationsImpl(OperationsClient innerClient, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationValueImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationValueImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OutboundEnvironmentEndpointImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OutboundEnvironmentEndpointImpl.java new file mode 100644 index 000000000000..bea6f269688c --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OutboundEnvironmentEndpointImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.OutboundEnvironmentEndpointInner; +import com.azure.resourcemanager.containerservice.generated.models.EndpointDependency; +import com.azure.resourcemanager.containerservice.generated.models.OutboundEnvironmentEndpoint; +import java.util.Collections; +import java.util.List; + +public final class OutboundEnvironmentEndpointImpl implements OutboundEnvironmentEndpoint { + private OutboundEnvironmentEndpointInner innerObject; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + OutboundEnvironmentEndpointImpl(OutboundEnvironmentEndpointInner innerObject, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String category() { + return this.innerModel().category(); + } + + public List endpoints() { + List inner = this.innerModel().endpoints(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public OutboundEnvironmentEndpointInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateEndpointConnectionImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateEndpointConnectionImpl.java new file mode 100644 index 000000000000..85a502a13195 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateEndpointConnectionImpl.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.containerservice.generated.models.PrivateEndpoint; +import com.azure.resourcemanager.containerservice.generated.models.PrivateEndpointConnection; +import com.azure.resourcemanager.containerservice.generated.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.containerservice.generated.models.PrivateLinkServiceConnectionState; + +public final class PrivateEndpointConnectionImpl implements PrivateEndpointConnection { + private PrivateEndpointConnectionInner innerObject; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + PrivateEndpointConnectionImpl(PrivateEndpointConnectionInner innerObject, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public PrivateEndpoint privateEndpoint() { + return this.innerModel().privateEndpoint(); + } + + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerModel().privateLinkServiceConnectionState(); + } + + public PrivateEndpointConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateEndpointConnectionListResultImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateEndpointConnectionListResultImpl.java new file mode 100644 index 000000000000..b231a03a6f8b --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateEndpointConnectionListResultImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateEndpointConnectionListResultInner; +import com.azure.resourcemanager.containerservice.generated.models.PrivateEndpointConnection; +import com.azure.resourcemanager.containerservice.generated.models.PrivateEndpointConnectionListResult; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class PrivateEndpointConnectionListResultImpl implements PrivateEndpointConnectionListResult { + private PrivateEndpointConnectionListResultInner innerObject; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + PrivateEndpointConnectionListResultImpl(PrivateEndpointConnectionListResultInner innerObject, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public PrivateEndpointConnectionListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateEndpointConnectionsClientImpl.java new file mode 100644 index 000000000000..eaac9edb7959 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateEndpointConnectionsClientImpl.java @@ -0,0 +1,581 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerservice.generated.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateEndpointConnectionListResultInner; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. + */ +public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpointConnectionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final PrivateEndpointConnectionsService service; + + /** + * The service client containing this operation class. + */ + private final ContainerServiceManagementClientImpl client; + + /** + * Initializes an instance of PrivateEndpointConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateEndpointConnectionsClientImpl(ContainerServiceManagementClientImpl client) { + this.service = RestProxy.create(PrivateEndpointConnectionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerServiceManagementClientPrivateEndpointConnections to be used + * by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ContainerServiceManagementClientPrivateEndpointConnections") + public interface PrivateEndpointConnectionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PrivateEndpointConnectionInner parameters, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PrivateEndpointConnectionInner parameters, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets the specified private endpoint connection. + * + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection. + * + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String resourceName, String privateEndpointConnectionName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, privateEndpointConnectionName, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified private endpoint connection. + * + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection. + * + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String resourceName, + String privateEndpointConnectionName) { + return getWithResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the specified private endpoint connection. + * + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection. + * + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String resourceName, + String privateEndpointConnectionName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, resourceName, privateEndpointConnectionName, accept, context); + } + + /** + * Gets the specified private endpoint connection. + * + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection. + * + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner get(String resourceGroupName, String resourceName, + String privateEndpointConnectionName) { + return getWithResponse(resourceGroupName, resourceName, privateEndpointConnectionName, Context.NONE).getValue(); + } + + /** + * Updates a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters The updated private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, + String resourceName, String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, privateEndpointConnectionName, + contentType, accept, parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters The updated private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String resourceName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters) { + return updateWithResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Updates a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters The updated private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse(String resourceGroupName, String resourceName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, privateEndpointConnectionName, + contentType, accept, parameters, context); + } + + /** + * Updates a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters The updated private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner update(String resourceGroupName, String resourceName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters) { + return updateWithResponse(resourceGroupName, resourceName, privateEndpointConnectionName, parameters, + Context.NONE).getValue(); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String resourceName, + String privateEndpointConnectionName) { + return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, privateEndpointConnectionName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String resourceName, + String privateEndpointConnectionName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, privateEndpointConnectionName, + Context.NONE); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String resourceName, + String privateEndpointConnectionName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, privateEndpointConnectionName, context); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String resourceName, + String privateEndpointConnectionName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, + String privateEndpointConnectionName) { + Response response + = deleteWithResponse(resourceGroupName, resourceName, privateEndpointConnectionName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, + String privateEndpointConnectionName, Context context) { + Response response + = deleteWithResponse(resourceGroupName, resourceName, privateEndpointConnectionName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String resourceName, + String privateEndpointConnectionName) { + return beginDeleteAsync(resourceGroupName, resourceName, privateEndpointConnectionName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + beginDelete(resourceGroupName, resourceName, privateEndpointConnectionName).getFinalResult(); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String resourceName, String privateEndpointConnectionName, + Context context) { + beginDelete(resourceGroupName, resourceName, privateEndpointConnectionName, context).getFinalResult(); + } + + /** + * Gets a list of private endpoint connections in the specified managed cluster. + * + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private endpoint connections in the specified managed cluster. + * + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(String resourceGroupName, + String resourceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of private endpoint connections in the specified managed cluster. + * + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private endpoint connections in the specified managed cluster. + * + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceGroupName, String resourceName) { + return listWithResponseAsync(resourceGroupName, resourceName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a list of private endpoint connections in the specified managed cluster. + * + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private endpoint connections in the specified managed cluster. + * + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse(String resourceGroupName, + String resourceName, Context context) { + final String accept = "application/json"; + return service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, resourceName, accept, context); + } + + /** + * Gets a list of private endpoint connections in the specified managed cluster. + * + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private endpoint connections in the specified managed cluster. + * + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionListResultInner list(String resourceGroupName, String resourceName) { + return listWithResponse(resourceGroupName, resourceName, Context.NONE).getValue(); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateEndpointConnectionsImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateEndpointConnectionsImpl.java new file mode 100644 index 000000000000..8f51fd9fd0d6 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateEndpointConnectionsImpl.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerservice.generated.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateEndpointConnectionListResultInner; +import com.azure.resourcemanager.containerservice.generated.models.PrivateEndpointConnection; +import com.azure.resourcemanager.containerservice.generated.models.PrivateEndpointConnectionListResult; +import com.azure.resourcemanager.containerservice.generated.models.PrivateEndpointConnections; + +public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConnections { + private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionsImpl.class); + + private final PrivateEndpointConnectionsClient innerClient; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + public PrivateEndpointConnectionsImpl(PrivateEndpointConnectionsClient innerClient, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String resourceName, + String privateEndpointConnectionName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, resourceName, privateEndpointConnectionName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); + } + + public PrivateEndpointConnection get(String resourceGroupName, String resourceName, + String privateEndpointConnectionName) { + PrivateEndpointConnectionInner inner + = this.serviceClient().get(resourceGroupName, resourceName, privateEndpointConnectionName); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response updateWithResponse(String resourceGroupName, String resourceName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters, Context context) { + Response inner = this.serviceClient() + .updateWithResponse(resourceGroupName, resourceName, privateEndpointConnectionName, parameters, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); + } + + public PrivateEndpointConnection update(String resourceGroupName, String resourceName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters) { + PrivateEndpointConnectionInner inner + = this.serviceClient().update(resourceGroupName, resourceName, privateEndpointConnectionName, parameters); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + this.serviceClient().delete(resourceGroupName, resourceName, privateEndpointConnectionName); + } + + public void delete(String resourceGroupName, String resourceName, String privateEndpointConnectionName, + Context context) { + this.serviceClient().delete(resourceGroupName, resourceName, privateEndpointConnectionName, context); + } + + public Response listWithResponse(String resourceGroupName, String resourceName, + Context context) { + Response inner + = this.serviceClient().listWithResponse(resourceGroupName, resourceName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PrivateEndpointConnectionListResultImpl(inner.getValue(), this.manager())); + } + + public PrivateEndpointConnectionListResult list(String resourceGroupName, String resourceName) { + PrivateEndpointConnectionListResultInner inner = this.serviceClient().list(resourceGroupName, resourceName); + if (inner != null) { + return new PrivateEndpointConnectionListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + private PrivateEndpointConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateLinkResourceImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateLinkResourceImpl.java new file mode 100644 index 000000000000..b9ffe81f2d14 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateLinkResourceImpl.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.containerservice.generated.models.PrivateLinkResource; +import java.util.Collections; +import java.util.List; + +public final class PrivateLinkResourceImpl implements PrivateLinkResource { + private PrivateLinkResourceInner innerObject; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + PrivateLinkResourceImpl(PrivateLinkResourceInner innerObject, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String groupId() { + return this.innerModel().groupId(); + } + + public List requiredMembers() { + List inner = this.innerModel().requiredMembers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String privateLinkServiceID() { + return this.innerModel().privateLinkServiceID(); + } + + public PrivateLinkResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateLinkResourcesClientImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateLinkResourcesClientImpl.java new file mode 100644 index 000000000000..6c615ff37336 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateLinkResourcesClientImpl.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.containerservice.generated.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateLinkResourcesListResultInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. + */ +public final class PrivateLinkResourcesClientImpl implements PrivateLinkResourcesClient { + /** + * The proxy service used to perform REST calls. + */ + private final PrivateLinkResourcesService service; + + /** + * The service client containing this operation class. + */ + private final ContainerServiceManagementClientImpl client; + + /** + * Initializes an instance of PrivateLinkResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateLinkResourcesClientImpl(ContainerServiceManagementClientImpl client) { + this.service = RestProxy.create(PrivateLinkResourcesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerServiceManagementClientPrivateLinkResources to be used by + * the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ContainerServiceManagementClientPrivateLinkResources") + public interface PrivateLinkResourcesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets a list of private link resources in the specified managed cluster. + * + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources in the specified managed cluster. + * + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(String resourceGroupName, + String resourceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of private link resources in the specified managed cluster. + * + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources in the specified managed cluster. + * + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceGroupName, String resourceName) { + return listWithResponseAsync(resourceGroupName, resourceName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a list of private link resources in the specified managed cluster. + * + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources in the specified managed cluster. + * + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse(String resourceGroupName, String resourceName, + Context context) { + final String accept = "application/json"; + return service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, resourceName, accept, context); + } + + /** + * Gets a list of private link resources in the specified managed cluster. + * + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources in the specified managed cluster. + * + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkResourcesListResultInner list(String resourceGroupName, String resourceName) { + return listWithResponse(resourceGroupName, resourceName, Context.NONE).getValue(); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateLinkResourcesImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateLinkResourcesImpl.java new file mode 100644 index 000000000000..845b9b911cda --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateLinkResourcesImpl.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerservice.generated.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateLinkResourcesListResultInner; +import com.azure.resourcemanager.containerservice.generated.models.PrivateLinkResources; +import com.azure.resourcemanager.containerservice.generated.models.PrivateLinkResourcesListResult; + +public final class PrivateLinkResourcesImpl implements PrivateLinkResources { + private static final ClientLogger LOGGER = new ClientLogger(PrivateLinkResourcesImpl.class); + + private final PrivateLinkResourcesClient innerClient; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + public PrivateLinkResourcesImpl(PrivateLinkResourcesClient innerClient, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response listWithResponse(String resourceGroupName, String resourceName, + Context context) { + Response inner + = this.serviceClient().listWithResponse(resourceGroupName, resourceName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PrivateLinkResourcesListResultImpl(inner.getValue(), this.manager())); + } + + public PrivateLinkResourcesListResult list(String resourceGroupName, String resourceName) { + PrivateLinkResourcesListResultInner inner = this.serviceClient().list(resourceGroupName, resourceName); + if (inner != null) { + return new PrivateLinkResourcesListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + private PrivateLinkResourcesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateLinkResourcesListResultImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateLinkResourcesListResultImpl.java new file mode 100644 index 000000000000..957f135176c5 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateLinkResourcesListResultImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateLinkResourcesListResultInner; +import com.azure.resourcemanager.containerservice.generated.models.PrivateLinkResource; +import com.azure.resourcemanager.containerservice.generated.models.PrivateLinkResourcesListResult; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class PrivateLinkResourcesListResultImpl implements PrivateLinkResourcesListResult { + private PrivateLinkResourcesListResultInner innerObject; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + PrivateLinkResourcesListResultImpl(PrivateLinkResourcesListResultInner innerObject, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public PrivateLinkResourcesListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ResolvePrivateLinkServiceIdsClientImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ResolvePrivateLinkServiceIdsClientImpl.java new file mode 100644 index 000000000000..11ab3f7ddba2 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ResolvePrivateLinkServiceIdsClientImpl.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.containerservice.generated.fluent.ResolvePrivateLinkServiceIdsClient; +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateLinkResourceInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ResolvePrivateLinkServiceIdsClient. + */ +public final class ResolvePrivateLinkServiceIdsClientImpl implements ResolvePrivateLinkServiceIdsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ResolvePrivateLinkServiceIdsService service; + + /** + * The service client containing this operation class. + */ + private final ContainerServiceManagementClientImpl client; + + /** + * Initializes an instance of ResolvePrivateLinkServiceIdsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ResolvePrivateLinkServiceIdsClientImpl(ContainerServiceManagementClientImpl client) { + this.service = RestProxy.create(ResolvePrivateLinkServiceIdsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerServiceManagementClientResolvePrivateLinkServiceIds to be + * used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ContainerServiceManagementClientResolvePrivateLinkServiceIds") + public interface ResolvePrivateLinkServiceIdsService { + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> pOST(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PrivateLinkResourceInner parameters, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response pOSTSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PrivateLinkResourceInner parameters, Context context); + } + + /** + * Gets the private link service ID for the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters required in order to resolve a private link service ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link service ID for the specified managed cluster along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> pOSTWithResponseAsync(String resourceGroupName, + String resourceName, PrivateLinkResourceInner parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.pOST(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, contentType, accept, parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the private link service ID for the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters required in order to resolve a private link service ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link service ID for the specified managed cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono pOSTAsync(String resourceGroupName, String resourceName, + PrivateLinkResourceInner parameters) { + return pOSTWithResponseAsync(resourceGroupName, resourceName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the private link service ID for the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters required in order to resolve a private link service ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link service ID for the specified managed cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response pOSTWithResponse(String resourceGroupName, String resourceName, + PrivateLinkResourceInner parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.pOSTSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, resourceName, contentType, accept, parameters, context); + } + + /** + * Gets the private link service ID for the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters required in order to resolve a private link service ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link service ID for the specified managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkResourceInner pOST(String resourceGroupName, String resourceName, + PrivateLinkResourceInner parameters) { + return pOSTWithResponse(resourceGroupName, resourceName, parameters, Context.NONE).getValue(); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ResolvePrivateLinkServiceIdsImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ResolvePrivateLinkServiceIdsImpl.java new file mode 100644 index 000000000000..725730f6265e --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ResolvePrivateLinkServiceIdsImpl.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerservice.generated.fluent.ResolvePrivateLinkServiceIdsClient; +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.containerservice.generated.models.PrivateLinkResource; +import com.azure.resourcemanager.containerservice.generated.models.ResolvePrivateLinkServiceIds; + +public final class ResolvePrivateLinkServiceIdsImpl implements ResolvePrivateLinkServiceIds { + private static final ClientLogger LOGGER = new ClientLogger(ResolvePrivateLinkServiceIdsImpl.class); + + private final ResolvePrivateLinkServiceIdsClient innerClient; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + public ResolvePrivateLinkServiceIdsImpl(ResolvePrivateLinkServiceIdsClient innerClient, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response pOSTWithResponse(String resourceGroupName, String resourceName, + PrivateLinkResourceInner parameters, Context context) { + Response inner + = this.serviceClient().pOSTWithResponse(resourceGroupName, resourceName, parameters, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PrivateLinkResourceImpl(inner.getValue(), this.manager())); + } + + public PrivateLinkResource pOST(String resourceGroupName, String resourceName, + PrivateLinkResourceInner parameters) { + PrivateLinkResourceInner inner = this.serviceClient().pOST(resourceGroupName, resourceName, parameters); + if (inner != null) { + return new PrivateLinkResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + private ResolvePrivateLinkServiceIdsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ResourceManagerUtils.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ResourceManagerUtils.java new file mode 100644 index 000000000000..f9bcb2f323c2 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ResourceManagerUtils.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class ResourceManagerUtils { + private ResourceManagerUtils() { + } + + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (!segments.isEmpty() && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl<>(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super(PagedFlux.create(() -> (continuationToken, pageSize) -> Flux + .fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> new PagedResponseBase(page.getRequest(), page.getStatusCode(), page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl<>(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl<>(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/RunCommandResultImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/RunCommandResultImpl.java new file mode 100644 index 000000000000..485342610529 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/RunCommandResultImpl.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.RunCommandResultInner; +import com.azure.resourcemanager.containerservice.generated.models.RunCommandResult; +import java.time.OffsetDateTime; + +public final class RunCommandResultImpl implements RunCommandResult { + private RunCommandResultInner innerObject; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + RunCommandResultImpl(RunCommandResultInner innerObject, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public Integer exitCode() { + return this.innerModel().exitCode(); + } + + public OffsetDateTime startedAt() { + return this.innerModel().startedAt(); + } + + public OffsetDateTime finishedAt() { + return this.innerModel().finishedAt(); + } + + public String logs() { + return this.innerModel().logs(); + } + + public String reason() { + return this.innerModel().reason(); + } + + public RunCommandResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/SnapshotImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/SnapshotImpl.java new file mode 100644 index 000000000000..20908ebd9756 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/SnapshotImpl.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.fluent.models.SnapshotInner; +import com.azure.resourcemanager.containerservice.generated.models.CreationData; +import com.azure.resourcemanager.containerservice.generated.models.OSSKU; +import com.azure.resourcemanager.containerservice.generated.models.OSType; +import com.azure.resourcemanager.containerservice.generated.models.Snapshot; +import com.azure.resourcemanager.containerservice.generated.models.SnapshotType; +import com.azure.resourcemanager.containerservice.generated.models.TagsObject; +import java.util.Collections; +import java.util.Map; + +public final class SnapshotImpl implements Snapshot, Snapshot.Definition, Snapshot.Update { + private SnapshotInner innerObject; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public CreationData creationData() { + return this.innerModel().creationData(); + } + + public SnapshotType snapshotType() { + return this.innerModel().snapshotType(); + } + + public String kubernetesVersion() { + return this.innerModel().kubernetesVersion(); + } + + public String nodeImageVersion() { + return this.innerModel().nodeImageVersion(); + } + + public OSType osType() { + return this.innerModel().osType(); + } + + public OSSKU osSku() { + return this.innerModel().osSku(); + } + + public String vmSize() { + return this.innerModel().vmSize(); + } + + public Boolean enableFIPS() { + return this.innerModel().enableFIPS(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public SnapshotInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String resourceName; + + private TagsObject updateParameters; + + public SnapshotImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Snapshot create() { + this.innerObject = serviceManager.serviceClient() + .getSnapshots() + .createOrUpdateWithResponse(resourceGroupName, resourceName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Snapshot create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSnapshots() + .createOrUpdateWithResponse(resourceGroupName, resourceName, this.innerModel(), context) + .getValue(); + return this; + } + + SnapshotImpl(String name, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = new SnapshotInner(); + this.serviceManager = serviceManager; + this.resourceName = name; + } + + public SnapshotImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public Snapshot apply() { + this.innerObject = serviceManager.serviceClient() + .getSnapshots() + .updateTagsWithResponse(resourceGroupName, resourceName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public Snapshot apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSnapshots() + .updateTagsWithResponse(resourceGroupName, resourceName, updateParameters, context) + .getValue(); + return this; + } + + SnapshotImpl(SnapshotInner innerObject, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.resourceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "snapshots"); + } + + public Snapshot refresh() { + this.innerObject = serviceManager.serviceClient() + .getSnapshots() + .getByResourceGroupWithResponse(resourceGroupName, resourceName, Context.NONE) + .getValue(); + return this; + } + + public Snapshot refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSnapshots() + .getByResourceGroupWithResponse(resourceGroupName, resourceName, context) + .getValue(); + return this; + } + + public SnapshotImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SnapshotImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SnapshotImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public SnapshotImpl withCreationData(CreationData creationData) { + this.innerModel().withCreationData(creationData); + return this; + } + + public SnapshotImpl withSnapshotType(SnapshotType snapshotType) { + this.innerModel().withSnapshotType(snapshotType); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel() == null || this.innerModel().id() == null; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/SnapshotsClientImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/SnapshotsClientImpl.java new file mode 100644 index 000000000000..fed140da3fe2 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/SnapshotsClientImpl.java @@ -0,0 +1,803 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.containerservice.generated.fluent.SnapshotsClient; +import com.azure.resourcemanager.containerservice.generated.fluent.models.SnapshotInner; +import com.azure.resourcemanager.containerservice.generated.implementation.models.SnapshotListResult; +import com.azure.resourcemanager.containerservice.generated.models.TagsObject; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SnapshotsClient. + */ +public final class SnapshotsClientImpl implements SnapshotsClient { + /** + * The proxy service used to perform REST calls. + */ + private final SnapshotsService service; + + /** + * The service client containing this operation class. + */ + private final ContainerServiceManagementClientImpl client; + + /** + * Initializes an instance of SnapshotsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SnapshotsClientImpl(ContainerServiceManagementClientImpl client) { + this.service + = RestProxy.create(SnapshotsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerServiceManagementClientSnapshots to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ContainerServiceManagementClientSnapshots") + public interface SnapshotsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") SnapshotInner parameters, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") SnapshotInner parameters, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") TagsObject parameters, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateTagsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") TagsObject parameters, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/snapshots") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/snapshots") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets a snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a snapshot along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String resourceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a snapshot on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String resourceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, resourceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a snapshot along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String resourceName, + Context context) { + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context); + } + + /** + * Gets a snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a snapshot. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SnapshotInner getByResourceGroup(String resourceGroupName, String resourceName) { + return getByResourceGroupWithResponse(resourceGroupName, resourceName, Context.NONE).getValue(); + } + + /** + * Creates or updates a snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The snapshot to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a node pool snapshot resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String resourceName, + SnapshotInner parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, contentType, accept, parameters, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The snapshot to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a node pool snapshot resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String resourceName, + SnapshotInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, resourceName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates a snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The snapshot to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a node pool snapshot resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, String resourceName, + SnapshotInner parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, contentType, accept, parameters, context); + } + + /** + * Creates or updates a snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The snapshot to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a node pool snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SnapshotInner createOrUpdate(String resourceGroupName, String resourceName, SnapshotInner parameters) { + return createOrUpdateWithResponse(resourceGroupName, resourceName, parameters, Context.NONE).getValue(); + } + + /** + * Updates tags on a snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update snapshot Tags operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a node pool snapshot resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync(String resourceGroupName, String resourceName, + TagsObject parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.updateTags(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, contentType, accept, parameters, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates tags on a snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update snapshot Tags operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a node pool snapshot resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync(String resourceGroupName, String resourceName, TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, resourceName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Updates tags on a snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update snapshot Tags operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a node pool snapshot resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse(String resourceGroupName, String resourceName, + TagsObject parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateTagsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, contentType, accept, parameters, context); + } + + /** + * Updates tags on a snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update snapshot Tags operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a node pool snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SnapshotInner updateTags(String resourceGroupName, String resourceName, TagsObject parameters) { + return updateTagsWithResponse(resourceGroupName, resourceName, parameters, Context.NONE).getValue(); + } + + /** + * Deletes a snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String resourceName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String resourceName) { + return deleteWithResponseAsync(resourceGroupName, resourceName).flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes a snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String resourceName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, context); + } + + /** + * Deletes a snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String resourceName) { + deleteWithResponse(resourceGroupName, resourceName, Context.NONE); + } + + /** + * Lists snapshots in the specified subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Snapshot list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists snapshots in the specified subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Snapshot list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists snapshots in the specified subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Snapshot list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists snapshots in the specified subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Snapshot list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, Context context) { + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists snapshots in the specified subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Snapshot list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); + } + + /** + * Lists snapshots in the specified subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Snapshot list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); + } + + /** + * Gets a list of snapshots in the specified subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of snapshots in the specified subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of snapshots in the specified subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of snapshots in the specified subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of snapshots in the specified subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of snapshots in the specified subscription along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets a list of snapshots in the specified subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of snapshots in the specified subscription along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets a list of snapshots in the specified subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of snapshots in the specified subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Gets a list of snapshots in the specified subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of snapshots in the specified subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Snapshot list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Snapshot list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Snapshot list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of snapshots in the specified subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of snapshots in the specified subscription along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of snapshots in the specified subscription along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/SnapshotsImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/SnapshotsImpl.java new file mode 100644 index 000000000000..01bb15c36508 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/SnapshotsImpl.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerservice.generated.fluent.SnapshotsClient; +import com.azure.resourcemanager.containerservice.generated.fluent.models.SnapshotInner; +import com.azure.resourcemanager.containerservice.generated.models.Snapshot; +import com.azure.resourcemanager.containerservice.generated.models.Snapshots; + +public final class SnapshotsImpl implements Snapshots { + private static final ClientLogger LOGGER = new ClientLogger(SnapshotsImpl.class); + + private final SnapshotsClient innerClient; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + public SnapshotsImpl(SnapshotsClient innerClient, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String resourceName, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, resourceName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SnapshotImpl(inner.getValue(), this.manager())); + } + + public Snapshot getByResourceGroup(String resourceGroupName, String resourceName) { + SnapshotInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, resourceName); + if (inner != null) { + return new SnapshotImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteByResourceGroupWithResponse(String resourceGroupName, String resourceName, + Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, resourceName, context); + } + + public void deleteByResourceGroup(String resourceGroupName, String resourceName) { + this.serviceClient().delete(resourceGroupName, resourceName); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SnapshotImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SnapshotImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SnapshotImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SnapshotImpl(inner1, this.manager())); + } + + public Snapshot getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = ResourceManagerUtils.getValueFromIdByName(id, "snapshots"); + if (resourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'snapshots'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, resourceName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = ResourceManagerUtils.getValueFromIdByName(id, "snapshots"); + if (resourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'snapshots'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, resourceName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = ResourceManagerUtils.getValueFromIdByName(id, "snapshots"); + if (resourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'snapshots'.", id))); + } + this.deleteByResourceGroupWithResponse(resourceGroupName, resourceName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = ResourceManagerUtils.getValueFromIdByName(id, "snapshots"); + if (resourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'snapshots'.", id))); + } + return this.deleteByResourceGroupWithResponse(resourceGroupName, resourceName, context); + } + + private SnapshotsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } + + public SnapshotImpl define(String name) { + return new SnapshotImpl(name, this.manager()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/TrustedAccessRoleBindingImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/TrustedAccessRoleBindingImpl.java new file mode 100644 index 000000000000..06f342a73e7c --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/TrustedAccessRoleBindingImpl.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.fluent.models.TrustedAccessRoleBindingInner; +import com.azure.resourcemanager.containerservice.generated.models.TrustedAccessRoleBinding; +import com.azure.resourcemanager.containerservice.generated.models.TrustedAccessRoleBindingProvisioningState; +import java.util.Collections; +import java.util.List; + +public final class TrustedAccessRoleBindingImpl + implements TrustedAccessRoleBinding, TrustedAccessRoleBinding.Definition, TrustedAccessRoleBinding.Update { + private TrustedAccessRoleBindingInner innerObject; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public TrustedAccessRoleBindingProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String sourceResourceId() { + return this.innerModel().sourceResourceId(); + } + + public List roles() { + List inner = this.innerModel().roles(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public TrustedAccessRoleBindingInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String resourceName; + + private String trustedAccessRoleBindingName; + + public TrustedAccessRoleBindingImpl withExistingManagedCluster(String resourceGroupName, String resourceName) { + this.resourceGroupName = resourceGroupName; + this.resourceName = resourceName; + return this; + } + + public TrustedAccessRoleBinding create() { + this.innerObject = serviceManager.serviceClient() + .getTrustedAccessRoleBindings() + .createOrUpdate(resourceGroupName, resourceName, trustedAccessRoleBindingName, this.innerModel(), + Context.NONE); + return this; + } + + public TrustedAccessRoleBinding create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getTrustedAccessRoleBindings() + .createOrUpdate(resourceGroupName, resourceName, trustedAccessRoleBindingName, this.innerModel(), context); + return this; + } + + TrustedAccessRoleBindingImpl(String name, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = new TrustedAccessRoleBindingInner(); + this.serviceManager = serviceManager; + this.trustedAccessRoleBindingName = name; + } + + public TrustedAccessRoleBindingImpl update() { + return this; + } + + public TrustedAccessRoleBinding apply() { + this.innerObject = serviceManager.serviceClient() + .getTrustedAccessRoleBindings() + .createOrUpdate(resourceGroupName, resourceName, trustedAccessRoleBindingName, this.innerModel(), + Context.NONE); + return this; + } + + public TrustedAccessRoleBinding apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getTrustedAccessRoleBindings() + .createOrUpdate(resourceGroupName, resourceName, trustedAccessRoleBindingName, this.innerModel(), context); + return this; + } + + TrustedAccessRoleBindingImpl(TrustedAccessRoleBindingInner innerObject, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.resourceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "managedClusters"); + this.trustedAccessRoleBindingName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "trustedAccessRoleBindings"); + } + + public TrustedAccessRoleBinding refresh() { + this.innerObject = serviceManager.serviceClient() + .getTrustedAccessRoleBindings() + .getWithResponse(resourceGroupName, resourceName, trustedAccessRoleBindingName, Context.NONE) + .getValue(); + return this; + } + + public TrustedAccessRoleBinding refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getTrustedAccessRoleBindings() + .getWithResponse(resourceGroupName, resourceName, trustedAccessRoleBindingName, context) + .getValue(); + return this; + } + + public TrustedAccessRoleBindingImpl withSourceResourceId(String sourceResourceId) { + this.innerModel().withSourceResourceId(sourceResourceId); + return this; + } + + public TrustedAccessRoleBindingImpl withRoles(List roles) { + this.innerModel().withRoles(roles); + return this; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/TrustedAccessRoleBindingsClientImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/TrustedAccessRoleBindingsClientImpl.java new file mode 100644 index 000000000000..1e23e40c40c2 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/TrustedAccessRoleBindingsClientImpl.java @@ -0,0 +1,778 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerservice.generated.fluent.TrustedAccessRoleBindingsClient; +import com.azure.resourcemanager.containerservice.generated.fluent.models.TrustedAccessRoleBindingInner; +import com.azure.resourcemanager.containerservice.generated.implementation.models.TrustedAccessRoleBindingListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in TrustedAccessRoleBindingsClient. + */ +public final class TrustedAccessRoleBindingsClientImpl implements TrustedAccessRoleBindingsClient { + /** + * The proxy service used to perform REST calls. + */ + private final TrustedAccessRoleBindingsService service; + + /** + * The service client containing this operation class. + */ + private final ContainerServiceManagementClientImpl client; + + /** + * Initializes an instance of TrustedAccessRoleBindingsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TrustedAccessRoleBindingsClientImpl(ContainerServiceManagementClientImpl client) { + this.service = RestProxy.create(TrustedAccessRoleBindingsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerServiceManagementClientTrustedAccessRoleBindings to be used + * by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ContainerServiceManagementClientTrustedAccessRoleBindings") + public interface TrustedAccessRoleBindingsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("trustedAccessRoleBindingName") String trustedAccessRoleBindingName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("trustedAccessRoleBindingName") String trustedAccessRoleBindingName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("trustedAccessRoleBindingName") String trustedAccessRoleBindingName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") TrustedAccessRoleBindingInner trustedAccessRoleBinding, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("trustedAccessRoleBindingName") String trustedAccessRoleBindingName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") TrustedAccessRoleBindingInner trustedAccessRoleBinding, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("trustedAccessRoleBindingName") String trustedAccessRoleBindingName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("trustedAccessRoleBindingName") String trustedAccessRoleBindingName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a trusted access role binding. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param trustedAccessRoleBindingName The name of trusted access role binding. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a trusted access role binding along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String resourceName, String trustedAccessRoleBindingName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, trustedAccessRoleBindingName, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a trusted access role binding. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param trustedAccessRoleBindingName The name of trusted access role binding. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a trusted access role binding on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String resourceName, + String trustedAccessRoleBindingName) { + return getWithResponseAsync(resourceGroupName, resourceName, trustedAccessRoleBindingName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a trusted access role binding. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param trustedAccessRoleBindingName The name of trusted access role binding. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a trusted access role binding along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String resourceName, + String trustedAccessRoleBindingName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, resourceName, trustedAccessRoleBindingName, accept, context); + } + + /** + * Get a trusted access role binding. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param trustedAccessRoleBindingName The name of trusted access role binding. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a trusted access role binding. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TrustedAccessRoleBindingInner get(String resourceGroupName, String resourceName, + String trustedAccessRoleBindingName) { + return getWithResponse(resourceGroupName, resourceName, trustedAccessRoleBindingName, Context.NONE).getValue(); + } + + /** + * Create or update a trusted access role binding. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param trustedAccessRoleBindingName The name of trusted access role binding. + * @param trustedAccessRoleBinding A trusted access role binding. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines binding between a resource and role along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String resourceName, String trustedAccessRoleBindingName, + TrustedAccessRoleBindingInner trustedAccessRoleBinding) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, trustedAccessRoleBindingName, + contentType, accept, trustedAccessRoleBinding, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a trusted access role binding. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param trustedAccessRoleBindingName The name of trusted access role binding. + * @param trustedAccessRoleBinding A trusted access role binding. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines binding between a resource and role along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String resourceName, + String trustedAccessRoleBindingName, TrustedAccessRoleBindingInner trustedAccessRoleBinding) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, trustedAccessRoleBindingName, contentType, + accept, trustedAccessRoleBinding, Context.NONE); + } + + /** + * Create or update a trusted access role binding. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param trustedAccessRoleBindingName The name of trusted access role binding. + * @param trustedAccessRoleBinding A trusted access role binding. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines binding between a resource and role along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String resourceName, + String trustedAccessRoleBindingName, TrustedAccessRoleBindingInner trustedAccessRoleBinding, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, trustedAccessRoleBindingName, contentType, + accept, trustedAccessRoleBinding, context); + } + + /** + * Create or update a trusted access role binding. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param trustedAccessRoleBindingName The name of trusted access role binding. + * @param trustedAccessRoleBinding A trusted access role binding. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of defines binding between a resource and role. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, TrustedAccessRoleBindingInner> + beginCreateOrUpdateAsync(String resourceGroupName, String resourceName, String trustedAccessRoleBindingName, + TrustedAccessRoleBindingInner trustedAccessRoleBinding) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, resourceName, + trustedAccessRoleBindingName, trustedAccessRoleBinding); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), TrustedAccessRoleBindingInner.class, TrustedAccessRoleBindingInner.class, + this.client.getContext()); + } + + /** + * Create or update a trusted access role binding. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param trustedAccessRoleBindingName The name of trusted access role binding. + * @param trustedAccessRoleBinding A trusted access role binding. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of defines binding between a resource and role. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TrustedAccessRoleBindingInner> beginCreateOrUpdate( + String resourceGroupName, String resourceName, String trustedAccessRoleBindingName, + TrustedAccessRoleBindingInner trustedAccessRoleBinding) { + Response response = createOrUpdateWithResponse(resourceGroupName, resourceName, + trustedAccessRoleBindingName, trustedAccessRoleBinding); + return this.client.getLroResult(response, + TrustedAccessRoleBindingInner.class, TrustedAccessRoleBindingInner.class, Context.NONE); + } + + /** + * Create or update a trusted access role binding. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param trustedAccessRoleBindingName The name of trusted access role binding. + * @param trustedAccessRoleBinding A trusted access role binding. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of defines binding between a resource and role. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TrustedAccessRoleBindingInner> beginCreateOrUpdate( + String resourceGroupName, String resourceName, String trustedAccessRoleBindingName, + TrustedAccessRoleBindingInner trustedAccessRoleBinding, Context context) { + Response response = createOrUpdateWithResponse(resourceGroupName, resourceName, + trustedAccessRoleBindingName, trustedAccessRoleBinding, context); + return this.client.getLroResult(response, + TrustedAccessRoleBindingInner.class, TrustedAccessRoleBindingInner.class, context); + } + + /** + * Create or update a trusted access role binding. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param trustedAccessRoleBindingName The name of trusted access role binding. + * @param trustedAccessRoleBinding A trusted access role binding. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines binding between a resource and role on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String resourceName, + String trustedAccessRoleBindingName, TrustedAccessRoleBindingInner trustedAccessRoleBinding) { + return beginCreateOrUpdateAsync(resourceGroupName, resourceName, trustedAccessRoleBindingName, + trustedAccessRoleBinding).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a trusted access role binding. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param trustedAccessRoleBindingName The name of trusted access role binding. + * @param trustedAccessRoleBinding A trusted access role binding. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines binding between a resource and role. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TrustedAccessRoleBindingInner createOrUpdate(String resourceGroupName, String resourceName, + String trustedAccessRoleBindingName, TrustedAccessRoleBindingInner trustedAccessRoleBinding) { + return beginCreateOrUpdate(resourceGroupName, resourceName, trustedAccessRoleBindingName, + trustedAccessRoleBinding).getFinalResult(); + } + + /** + * Create or update a trusted access role binding. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param trustedAccessRoleBindingName The name of trusted access role binding. + * @param trustedAccessRoleBinding A trusted access role binding. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines binding between a resource and role. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TrustedAccessRoleBindingInner createOrUpdate(String resourceGroupName, String resourceName, + String trustedAccessRoleBindingName, TrustedAccessRoleBindingInner trustedAccessRoleBinding, Context context) { + return beginCreateOrUpdate(resourceGroupName, resourceName, trustedAccessRoleBindingName, + trustedAccessRoleBinding, context).getFinalResult(); + } + + /** + * Delete a trusted access role binding. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param trustedAccessRoleBindingName The name of trusted access role binding. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String resourceName, + String trustedAccessRoleBindingName) { + return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, trustedAccessRoleBindingName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a trusted access role binding. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param trustedAccessRoleBindingName The name of trusted access role binding. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String resourceName, + String trustedAccessRoleBindingName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, trustedAccessRoleBindingName, + Context.NONE); + } + + /** + * Delete a trusted access role binding. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param trustedAccessRoleBindingName The name of trusted access role binding. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String resourceName, + String trustedAccessRoleBindingName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, trustedAccessRoleBindingName, context); + } + + /** + * Delete a trusted access role binding. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param trustedAccessRoleBindingName The name of trusted access role binding. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String resourceName, + String trustedAccessRoleBindingName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, resourceName, trustedAccessRoleBindingName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a trusted access role binding. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param trustedAccessRoleBindingName The name of trusted access role binding. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, + String trustedAccessRoleBindingName) { + Response response + = deleteWithResponse(resourceGroupName, resourceName, trustedAccessRoleBindingName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Delete a trusted access role binding. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param trustedAccessRoleBindingName The name of trusted access role binding. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, + String trustedAccessRoleBindingName, Context context) { + Response response + = deleteWithResponse(resourceGroupName, resourceName, trustedAccessRoleBindingName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Delete a trusted access role binding. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param trustedAccessRoleBindingName The name of trusted access role binding. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String resourceName, String trustedAccessRoleBindingName) { + return beginDeleteAsync(resourceGroupName, resourceName, trustedAccessRoleBindingName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a trusted access role binding. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param trustedAccessRoleBindingName The name of trusted access role binding. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String resourceName, String trustedAccessRoleBindingName) { + beginDelete(resourceGroupName, resourceName, trustedAccessRoleBindingName).getFinalResult(); + } + + /** + * Delete a trusted access role binding. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param trustedAccessRoleBindingName The name of trusted access role binding. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String resourceName, String trustedAccessRoleBindingName, + Context context) { + beginDelete(resourceGroupName, resourceName, trustedAccessRoleBindingName, context).getFinalResult(); + } + + /** + * List trusted access role bindings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TrustedAccessRoleBinding list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String resourceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List trusted access role bindings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TrustedAccessRoleBinding list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String resourceName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, resourceName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List trusted access role bindings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TrustedAccessRoleBinding list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String resourceName) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, resourceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List trusted access role bindings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TrustedAccessRoleBinding list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String resourceName, + Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, resourceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List trusted access role bindings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TrustedAccessRoleBinding list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String resourceName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, resourceName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List trusted access role bindings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TrustedAccessRoleBinding list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String resourceName, + Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, resourceName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TrustedAccessRoleBinding list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TrustedAccessRoleBinding list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TrustedAccessRoleBinding list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/TrustedAccessRoleBindingsImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/TrustedAccessRoleBindingsImpl.java new file mode 100644 index 000000000000..63e3dc3f07ba --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/TrustedAccessRoleBindingsImpl.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerservice.generated.fluent.TrustedAccessRoleBindingsClient; +import com.azure.resourcemanager.containerservice.generated.fluent.models.TrustedAccessRoleBindingInner; +import com.azure.resourcemanager.containerservice.generated.models.TrustedAccessRoleBinding; +import com.azure.resourcemanager.containerservice.generated.models.TrustedAccessRoleBindings; + +public final class TrustedAccessRoleBindingsImpl implements TrustedAccessRoleBindings { + private static final ClientLogger LOGGER = new ClientLogger(TrustedAccessRoleBindingsImpl.class); + + private final TrustedAccessRoleBindingsClient innerClient; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + public TrustedAccessRoleBindingsImpl(TrustedAccessRoleBindingsClient innerClient, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String resourceName, + String trustedAccessRoleBindingName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, resourceName, trustedAccessRoleBindingName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new TrustedAccessRoleBindingImpl(inner.getValue(), this.manager())); + } + + public TrustedAccessRoleBinding get(String resourceGroupName, String resourceName, + String trustedAccessRoleBindingName) { + TrustedAccessRoleBindingInner inner + = this.serviceClient().get(resourceGroupName, resourceName, trustedAccessRoleBindingName); + if (inner != null) { + return new TrustedAccessRoleBindingImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String resourceName, String trustedAccessRoleBindingName) { + this.serviceClient().delete(resourceGroupName, resourceName, trustedAccessRoleBindingName); + } + + public void delete(String resourceGroupName, String resourceName, String trustedAccessRoleBindingName, + Context context) { + this.serviceClient().delete(resourceGroupName, resourceName, trustedAccessRoleBindingName, context); + } + + public PagedIterable list(String resourceGroupName, String resourceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, resourceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new TrustedAccessRoleBindingImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String resourceName, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, resourceName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new TrustedAccessRoleBindingImpl(inner1, this.manager())); + } + + public TrustedAccessRoleBinding getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = ResourceManagerUtils.getValueFromIdByName(id, "managedClusters"); + if (resourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedClusters'.", id))); + } + String trustedAccessRoleBindingName + = ResourceManagerUtils.getValueFromIdByName(id, "trustedAccessRoleBindings"); + if (trustedAccessRoleBindingName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'trustedAccessRoleBindings'.", id))); + } + return this.getWithResponse(resourceGroupName, resourceName, trustedAccessRoleBindingName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = ResourceManagerUtils.getValueFromIdByName(id, "managedClusters"); + if (resourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedClusters'.", id))); + } + String trustedAccessRoleBindingName + = ResourceManagerUtils.getValueFromIdByName(id, "trustedAccessRoleBindings"); + if (trustedAccessRoleBindingName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'trustedAccessRoleBindings'.", id))); + } + return this.getWithResponse(resourceGroupName, resourceName, trustedAccessRoleBindingName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = ResourceManagerUtils.getValueFromIdByName(id, "managedClusters"); + if (resourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedClusters'.", id))); + } + String trustedAccessRoleBindingName + = ResourceManagerUtils.getValueFromIdByName(id, "trustedAccessRoleBindings"); + if (trustedAccessRoleBindingName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'trustedAccessRoleBindings'.", id))); + } + this.delete(resourceGroupName, resourceName, trustedAccessRoleBindingName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = ResourceManagerUtils.getValueFromIdByName(id, "managedClusters"); + if (resourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedClusters'.", id))); + } + String trustedAccessRoleBindingName + = ResourceManagerUtils.getValueFromIdByName(id, "trustedAccessRoleBindings"); + if (trustedAccessRoleBindingName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'trustedAccessRoleBindings'.", id))); + } + this.delete(resourceGroupName, resourceName, trustedAccessRoleBindingName, context); + } + + private TrustedAccessRoleBindingsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } + + public TrustedAccessRoleBindingImpl define(String name) { + return new TrustedAccessRoleBindingImpl(name, this.manager()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/TrustedAccessRoleImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/TrustedAccessRoleImpl.java new file mode 100644 index 000000000000..43d023cfbc0b --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/TrustedAccessRoleImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.TrustedAccessRoleInner; +import com.azure.resourcemanager.containerservice.generated.models.TrustedAccessRole; +import com.azure.resourcemanager.containerservice.generated.models.TrustedAccessRoleRule; +import java.util.Collections; +import java.util.List; + +public final class TrustedAccessRoleImpl implements TrustedAccessRole { + private TrustedAccessRoleInner innerObject; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + TrustedAccessRoleImpl(TrustedAccessRoleInner innerObject, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String sourceResourceType() { + return this.innerModel().sourceResourceType(); + } + + public String name() { + return this.innerModel().name(); + } + + public List rules() { + List inner = this.innerModel().rules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public TrustedAccessRoleInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/TrustedAccessRolesClientImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/TrustedAccessRolesClientImpl.java new file mode 100644 index 000000000000..da5ea0434bbc --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/TrustedAccessRolesClientImpl.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.containerservice.generated.fluent.TrustedAccessRolesClient; +import com.azure.resourcemanager.containerservice.generated.fluent.models.TrustedAccessRoleInner; +import com.azure.resourcemanager.containerservice.generated.implementation.models.TrustedAccessRoleListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in TrustedAccessRolesClient. + */ +public final class TrustedAccessRolesClientImpl implements TrustedAccessRolesClient { + /** + * The proxy service used to perform REST calls. + */ + private final TrustedAccessRolesService service; + + /** + * The service client containing this operation class. + */ + private final ContainerServiceManagementClientImpl client; + + /** + * Initializes an instance of TrustedAccessRolesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TrustedAccessRolesClientImpl(ContainerServiceManagementClientImpl client) { + this.service = RestProxy.create(TrustedAccessRolesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerServiceManagementClientTrustedAccessRoles to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ContainerServiceManagementClientTrustedAccessRoles") + public interface TrustedAccessRolesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/trustedAccessRoles") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/trustedAccessRoles") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List supported trusted access roles. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of trusted access roles along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String location) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List supported trusted access roles. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of trusted access roles as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location) { + return new PagedFlux<>(() -> listSinglePageAsync(location), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List supported trusted access roles. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of trusted access roles along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String location) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), location, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List supported trusted access roles. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of trusted access roles along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String location, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), location, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List supported trusted access roles. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of trusted access roles as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location) { + return new PagedIterable<>(() -> listSinglePage(location), nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List supported trusted access roles. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of trusted access roles as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location, Context context) { + return new PagedIterable<>(() -> listSinglePage(location, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of trusted access roles along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of trusted access roles along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of trusted access roles along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/TrustedAccessRolesImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/TrustedAccessRolesImpl.java new file mode 100644 index 000000000000..f21302035df6 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/TrustedAccessRolesImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerservice.generated.fluent.TrustedAccessRolesClient; +import com.azure.resourcemanager.containerservice.generated.fluent.models.TrustedAccessRoleInner; +import com.azure.resourcemanager.containerservice.generated.models.TrustedAccessRole; +import com.azure.resourcemanager.containerservice.generated.models.TrustedAccessRoles; + +public final class TrustedAccessRolesImpl implements TrustedAccessRoles { + private static final ClientLogger LOGGER = new ClientLogger(TrustedAccessRolesImpl.class); + + private final TrustedAccessRolesClient innerClient; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + public TrustedAccessRolesImpl(TrustedAccessRolesClient innerClient, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String location) { + PagedIterable inner = this.serviceClient().list(location); + return ResourceManagerUtils.mapPage(inner, inner1 -> new TrustedAccessRoleImpl(inner1, this.manager())); + } + + public PagedIterable list(String location, Context context) { + PagedIterable inner = this.serviceClient().list(location, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new TrustedAccessRoleImpl(inner1, this.manager())); + } + + private TrustedAccessRolesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/AgentPoolListResult.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/AgentPoolListResult.java new file mode 100644 index 000000000000..b175cd163a11 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/AgentPoolListResult.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerservice.generated.fluent.models.AgentPoolInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a AgentPool list operation. + */ +@Immutable +public final class AgentPoolListResult implements JsonSerializable { + /* + * The AgentPool items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of AgentPoolListResult class. + */ + private AgentPoolListResult() { + } + + /** + * Get the value property: The AgentPool items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AgentPoolListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AgentPoolListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AgentPoolListResult. + */ + public static AgentPoolListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AgentPoolListResult deserializedAgentPoolListResult = new AgentPoolListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> AgentPoolInner.fromJson(reader1)); + deserializedAgentPoolListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAgentPoolListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAgentPoolListResult; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/MachineListResult.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/MachineListResult.java new file mode 100644 index 000000000000..cba18f109ce0 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/MachineListResult.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerservice.generated.fluent.models.MachineInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a Machine list operation. + */ +@Immutable +public final class MachineListResult implements JsonSerializable { + /* + * The Machine items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of MachineListResult class. + */ + private MachineListResult() { + } + + /** + * Get the value property: The Machine items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MachineListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MachineListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MachineListResult. + */ + public static MachineListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MachineListResult deserializedMachineListResult = new MachineListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> MachineInner.fromJson(reader1)); + deserializedMachineListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedMachineListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMachineListResult; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/MaintenanceConfigurationListResult.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/MaintenanceConfigurationListResult.java new file mode 100644 index 000000000000..6e23d0fe6147 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/MaintenanceConfigurationListResult.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerservice.generated.fluent.models.MaintenanceConfigurationInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a MaintenanceConfiguration list operation. + */ +@Immutable +public final class MaintenanceConfigurationListResult implements JsonSerializable { + /* + * The MaintenanceConfiguration items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of MaintenanceConfigurationListResult class. + */ + private MaintenanceConfigurationListResult() { + } + + /** + * Get the value property: The MaintenanceConfiguration items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MaintenanceConfigurationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MaintenanceConfigurationListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MaintenanceConfigurationListResult. + */ + public static MaintenanceConfigurationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MaintenanceConfigurationListResult deserializedMaintenanceConfigurationListResult + = new MaintenanceConfigurationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> MaintenanceConfigurationInner.fromJson(reader1)); + deserializedMaintenanceConfigurationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedMaintenanceConfigurationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMaintenanceConfigurationListResult; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/ManagedClusterListResult.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/ManagedClusterListResult.java new file mode 100644 index 000000000000..3fcd92d2ea49 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/ManagedClusterListResult.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a ManagedCluster list operation. + */ +@Immutable +public final class ManagedClusterListResult implements JsonSerializable { + /* + * The ManagedCluster items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of ManagedClusterListResult class. + */ + private ManagedClusterListResult() { + } + + /** + * Get the value property: The ManagedCluster items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ManagedClusterListResult. + */ + public static ManagedClusterListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterListResult deserializedManagedClusterListResult = new ManagedClusterListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ManagedClusterInner.fromJson(reader1)); + deserializedManagedClusterListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedManagedClusterListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterListResult; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/ManagedNamespaceListResult.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/ManagedNamespaceListResult.java new file mode 100644 index 000000000000..7139ae44d328 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/ManagedNamespaceListResult.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedNamespaceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a ManagedNamespace list operation. + */ +@Immutable +public final class ManagedNamespaceListResult implements JsonSerializable { + /* + * The ManagedNamespace items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of ManagedNamespaceListResult class. + */ + private ManagedNamespaceListResult() { + } + + /** + * Get the value property: The ManagedNamespace items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedNamespaceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedNamespaceListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ManagedNamespaceListResult. + */ + public static ManagedNamespaceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedNamespaceListResult deserializedManagedNamespaceListResult = new ManagedNamespaceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ManagedNamespaceInner.fromJson(reader1)); + deserializedManagedNamespaceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedManagedNamespaceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedNamespaceListResult; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/MeshRevisionProfileList.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/MeshRevisionProfileList.java new file mode 100644 index 000000000000..0066336a6d60 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/MeshRevisionProfileList.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerservice.generated.fluent.models.MeshRevisionProfileInner; +import java.io.IOException; +import java.util.List; + +/** + * Holds an array of MeshRevisionsProfiles. + */ +@Immutable +public final class MeshRevisionProfileList implements JsonSerializable { + /* + * The MeshRevisionProfile items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of MeshRevisionProfileList class. + */ + private MeshRevisionProfileList() { + } + + /** + * Get the value property: The MeshRevisionProfile items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MeshRevisionProfileList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MeshRevisionProfileList if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MeshRevisionProfileList. + */ + public static MeshRevisionProfileList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MeshRevisionProfileList deserializedMeshRevisionProfileList = new MeshRevisionProfileList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> MeshRevisionProfileInner.fromJson(reader1)); + deserializedMeshRevisionProfileList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedMeshRevisionProfileList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMeshRevisionProfileList; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/MeshUpgradeProfileList.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/MeshUpgradeProfileList.java new file mode 100644 index 000000000000..e3df48f3c8df --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/MeshUpgradeProfileList.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerservice.generated.fluent.models.MeshUpgradeProfileInner; +import java.io.IOException; +import java.util.List; + +/** + * Holds an array of MeshUpgradeProfiles. + */ +@Immutable +public final class MeshUpgradeProfileList implements JsonSerializable { + /* + * The MeshUpgradeProfile items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of MeshUpgradeProfileList class. + */ + private MeshUpgradeProfileList() { + } + + /** + * Get the value property: The MeshUpgradeProfile items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MeshUpgradeProfileList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MeshUpgradeProfileList if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MeshUpgradeProfileList. + */ + public static MeshUpgradeProfileList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MeshUpgradeProfileList deserializedMeshUpgradeProfileList = new MeshUpgradeProfileList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> MeshUpgradeProfileInner.fromJson(reader1)); + deserializedMeshUpgradeProfileList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedMeshUpgradeProfileList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMeshUpgradeProfileList; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/OperationListResult.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/OperationListResult.java new file mode 100644 index 000000000000..44b3c75c0275 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/OperationListResult.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerservice.generated.fluent.models.OperationValueInner; +import java.io.IOException; +import java.util.List; + +/** + * The List Operation response. + */ +@Immutable +public final class OperationListResult implements JsonSerializable { + /* + * The list of operations + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of OperationListResult class. + */ + private OperationListResult() { + } + + /** + * Get the value property: The list of operations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OperationListResult. + */ + public static OperationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationListResult deserializedOperationListResult = new OperationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> OperationValueInner.fromJson(reader1)); + deserializedOperationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOperationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationListResult; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/OutboundEnvironmentEndpointCollection.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/OutboundEnvironmentEndpointCollection.java new file mode 100644 index 000000000000..ced0c0d35201 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/OutboundEnvironmentEndpointCollection.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerservice.generated.fluent.models.OutboundEnvironmentEndpointInner; +import java.io.IOException; +import java.util.List; + +/** + * Collection of OutboundEnvironmentEndpoint. + */ +@Immutable +public final class OutboundEnvironmentEndpointCollection + implements JsonSerializable { + /* + * The OutboundEnvironmentEndpoint items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of OutboundEnvironmentEndpointCollection class. + */ + private OutboundEnvironmentEndpointCollection() { + } + + /** + * Get the value property: The OutboundEnvironmentEndpoint items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OutboundEnvironmentEndpointCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OutboundEnvironmentEndpointCollection if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OutboundEnvironmentEndpointCollection. + */ + public static OutboundEnvironmentEndpointCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OutboundEnvironmentEndpointCollection deserializedOutboundEnvironmentEndpointCollection + = new OutboundEnvironmentEndpointCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> OutboundEnvironmentEndpointInner.fromJson(reader1)); + deserializedOutboundEnvironmentEndpointCollection.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOutboundEnvironmentEndpointCollection.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOutboundEnvironmentEndpointCollection; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/SnapshotListResult.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/SnapshotListResult.java new file mode 100644 index 000000000000..2bd9b244acf2 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/SnapshotListResult.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerservice.generated.fluent.models.SnapshotInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a Snapshot list operation. + */ +@Immutable +public final class SnapshotListResult implements JsonSerializable { + /* + * The Snapshot items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of SnapshotListResult class. + */ + private SnapshotListResult() { + } + + /** + * Get the value property: The Snapshot items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SnapshotListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SnapshotListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SnapshotListResult. + */ + public static SnapshotListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SnapshotListResult deserializedSnapshotListResult = new SnapshotListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> SnapshotInner.fromJson(reader1)); + deserializedSnapshotListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSnapshotListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSnapshotListResult; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/TrustedAccessRoleBindingListResult.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/TrustedAccessRoleBindingListResult.java new file mode 100644 index 000000000000..1b405e318d77 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/TrustedAccessRoleBindingListResult.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerservice.generated.fluent.models.TrustedAccessRoleBindingInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a TrustedAccessRoleBinding list operation. + */ +@Immutable +public final class TrustedAccessRoleBindingListResult implements JsonSerializable { + /* + * The TrustedAccessRoleBinding items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of TrustedAccessRoleBindingListResult class. + */ + private TrustedAccessRoleBindingListResult() { + } + + /** + * Get the value property: The TrustedAccessRoleBinding items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TrustedAccessRoleBindingListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TrustedAccessRoleBindingListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TrustedAccessRoleBindingListResult. + */ + public static TrustedAccessRoleBindingListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TrustedAccessRoleBindingListResult deserializedTrustedAccessRoleBindingListResult + = new TrustedAccessRoleBindingListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> TrustedAccessRoleBindingInner.fromJson(reader1)); + deserializedTrustedAccessRoleBindingListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedTrustedAccessRoleBindingListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTrustedAccessRoleBindingListResult; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/TrustedAccessRoleListResult.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/TrustedAccessRoleListResult.java new file mode 100644 index 000000000000..2129b6dce7b0 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/TrustedAccessRoleListResult.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerservice.generated.fluent.models.TrustedAccessRoleInner; +import java.io.IOException; +import java.util.List; + +/** + * List of trusted access roles. + */ +@Immutable +public final class TrustedAccessRoleListResult implements JsonSerializable { + /* + * The TrustedAccessRole items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of TrustedAccessRoleListResult class. + */ + private TrustedAccessRoleListResult() { + } + + /** + * Get the value property: The TrustedAccessRole items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TrustedAccessRoleListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TrustedAccessRoleListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TrustedAccessRoleListResult. + */ + public static TrustedAccessRoleListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TrustedAccessRoleListResult deserializedTrustedAccessRoleListResult = new TrustedAccessRoleListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> TrustedAccessRoleInner.fromJson(reader1)); + deserializedTrustedAccessRoleListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedTrustedAccessRoleListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTrustedAccessRoleListResult; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/package-info.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/package-info.java new file mode 100644 index 000000000000..178e35806199 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the implementations for ContainerService. + * The Container Service Client. + */ +package com.azure.resourcemanager.containerservice.generated.implementation; diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AbsoluteMonthlySchedule.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AbsoluteMonthlySchedule.java new file mode 100644 index 000000000000..eddd41c19eb0 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AbsoluteMonthlySchedule.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * For schedules like: 'recur every month on the 15th' or 'recur every 3 months on the 20th'. + */ +@Fluent +public final class AbsoluteMonthlySchedule implements JsonSerializable { + /* + * Specifies the number of months between each set of occurrences. + */ + private int intervalMonths; + + /* + * The date of the month. + */ + private int dayOfMonth; + + /** + * Creates an instance of AbsoluteMonthlySchedule class. + */ + public AbsoluteMonthlySchedule() { + } + + /** + * Get the intervalMonths property: Specifies the number of months between each set of occurrences. + * + * @return the intervalMonths value. + */ + public int intervalMonths() { + return this.intervalMonths; + } + + /** + * Set the intervalMonths property: Specifies the number of months between each set of occurrences. + * + * @param intervalMonths the intervalMonths value to set. + * @return the AbsoluteMonthlySchedule object itself. + */ + public AbsoluteMonthlySchedule withIntervalMonths(int intervalMonths) { + this.intervalMonths = intervalMonths; + return this; + } + + /** + * Get the dayOfMonth property: The date of the month. + * + * @return the dayOfMonth value. + */ + public int dayOfMonth() { + return this.dayOfMonth; + } + + /** + * Set the dayOfMonth property: The date of the month. + * + * @param dayOfMonth the dayOfMonth value to set. + * @return the AbsoluteMonthlySchedule object itself. + */ + public AbsoluteMonthlySchedule withDayOfMonth(int dayOfMonth) { + this.dayOfMonth = dayOfMonth; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("intervalMonths", this.intervalMonths); + jsonWriter.writeIntField("dayOfMonth", this.dayOfMonth); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AbsoluteMonthlySchedule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AbsoluteMonthlySchedule if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AbsoluteMonthlySchedule. + */ + public static AbsoluteMonthlySchedule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AbsoluteMonthlySchedule deserializedAbsoluteMonthlySchedule = new AbsoluteMonthlySchedule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("intervalMonths".equals(fieldName)) { + deserializedAbsoluteMonthlySchedule.intervalMonths = reader.getInt(); + } else if ("dayOfMonth".equals(fieldName)) { + deserializedAbsoluteMonthlySchedule.dayOfMonth = reader.getInt(); + } else { + reader.skipChildren(); + } + } + + return deserializedAbsoluteMonthlySchedule; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AccelerationMode.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AccelerationMode.java new file mode 100644 index 000000000000..582d5e4b1655 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AccelerationMode.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enable advanced network acceleration options. This allows users to configure acceleration using BPF host routing. + * This can be enabled only with Cilium dataplane. If not specified, the default value is None (no acceleration). The + * acceleration mode can be changed on a pre-existing cluster. See https://aka.ms/acnsperformance for a detailed + * explanation. + */ +public final class AccelerationMode extends ExpandableStringEnum { + /** + * Enable eBPF host routing with veth device mode. + */ + public static final AccelerationMode BPF_VETH = fromString("BpfVeth"); + + /** + * Disable acceleration options. + */ + public static final AccelerationMode NONE = fromString("None"); + + /** + * Creates a new instance of AccelerationMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AccelerationMode() { + } + + /** + * Creates or finds a AccelerationMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding AccelerationMode. + */ + public static AccelerationMode fromString(String name) { + return fromString(name, AccelerationMode.class); + } + + /** + * Gets known AccelerationMode values. + * + * @return known AccelerationMode values. + */ + public static Collection values() { + return values(AccelerationMode.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AdoptionPolicy.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AdoptionPolicy.java new file mode 100644 index 000000000000..d80c6d9a4b70 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AdoptionPolicy.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Action if Kubernetes namespace with same name already exists. + */ +public final class AdoptionPolicy extends ExpandableStringEnum { + /** + * If the namespace already exists in Kubernetes, attempts to create that same namespace in ARM will fail. + */ + public static final AdoptionPolicy NEVER = fromString("Never"); + + /** + * Take over the existing namespace to be managed by ARM, if there is no difference. + */ + public static final AdoptionPolicy IF_IDENTICAL = fromString("IfIdentical"); + + /** + * Always take over the existing namespace to be managed by ARM, some fields might be overwritten. + */ + public static final AdoptionPolicy ALWAYS = fromString("Always"); + + /** + * Creates a new instance of AdoptionPolicy value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AdoptionPolicy() { + } + + /** + * Creates or finds a AdoptionPolicy from its string representation. + * + * @param name a name to look for. + * @return the corresponding AdoptionPolicy. + */ + public static AdoptionPolicy fromString(String name) { + return fromString(name, AdoptionPolicy.class); + } + + /** + * Gets known AdoptionPolicy values. + * + * @return known AdoptionPolicy values. + */ + public static Collection values() { + return values(AdoptionPolicy.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AdvancedNetworkPolicies.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AdvancedNetworkPolicies.java new file mode 100644 index 000000000000..af779db3fc36 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AdvancedNetworkPolicies.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enable advanced network policies. This allows users to configure Layer 7 network policies (FQDN, HTTP, Kafka). + * Policies themselves must be configured via the Cilium Network Policy resources, see + * https://docs.cilium.io/en/latest/security/policy/index.html. This can be enabled only on cilium-based clusters. If + * not specified, the default value is FQDN if security.enabled is set to true. + */ +public final class AdvancedNetworkPolicies extends ExpandableStringEnum { + /** + * Enable Layer7 network policies (FQDN, HTTP/S, Kafka). This option is a superset of the FQDN option. + */ + public static final AdvancedNetworkPolicies L7 = fromString("L7"); + + /** + * Enable FQDN based network policies. + */ + public static final AdvancedNetworkPolicies FQDN = fromString("FQDN"); + + /** + * Disable Layer 7 network policies (FQDN, HTTP/S, Kafka). + */ + public static final AdvancedNetworkPolicies NONE = fromString("None"); + + /** + * Creates a new instance of AdvancedNetworkPolicies value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AdvancedNetworkPolicies() { + } + + /** + * Creates or finds a AdvancedNetworkPolicies from its string representation. + * + * @param name a name to look for. + * @return the corresponding AdvancedNetworkPolicies. + */ + public static AdvancedNetworkPolicies fromString(String name) { + return fromString(name, AdvancedNetworkPolicies.class); + } + + /** + * Gets known AdvancedNetworkPolicies values. + * + * @return known AdvancedNetworkPolicies values. + */ + public static Collection values() { + return values(AdvancedNetworkPolicies.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AdvancedNetworking.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AdvancedNetworking.java new file mode 100644 index 000000000000..6af7731fc311 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AdvancedNetworking.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Advanced Networking profile for enabling observability and security feature suite on a cluster. For more information + * see aka.ms/aksadvancednetworking. + */ +@Fluent +public final class AdvancedNetworking implements JsonSerializable { + /* + * Indicates the enablement of Advanced Networking functionalities of observability and security on AKS clusters. + * When this is set to true, all observability and security features will be set to enabled unless explicitly + * disabled. If not specified, the default is false. + */ + private Boolean enabled; + + /* + * Observability profile to enable advanced network metrics and flow logs with historical contexts. + */ + private AdvancedNetworkingObservability observability; + + /* + * Security profile to enable security features on cilium based cluster. + */ + private AdvancedNetworkingSecurity security; + + /* + * Profile to enable performance-enhancing features on clusters that use Azure CNI powered by Cilium. + */ + private AdvancedNetworkingPerformance performance; + + /** + * Creates an instance of AdvancedNetworking class. + */ + public AdvancedNetworking() { + } + + /** + * Get the enabled property: Indicates the enablement of Advanced Networking functionalities of observability and + * security on AKS clusters. When this is set to true, all observability and security features will be set to + * enabled unless explicitly disabled. If not specified, the default is false. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Indicates the enablement of Advanced Networking functionalities of observability and + * security on AKS clusters. When this is set to true, all observability and security features will be set to + * enabled unless explicitly disabled. If not specified, the default is false. + * + * @param enabled the enabled value to set. + * @return the AdvancedNetworking object itself. + */ + public AdvancedNetworking withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the observability property: Observability profile to enable advanced network metrics and flow logs with + * historical contexts. + * + * @return the observability value. + */ + public AdvancedNetworkingObservability observability() { + return this.observability; + } + + /** + * Set the observability property: Observability profile to enable advanced network metrics and flow logs with + * historical contexts. + * + * @param observability the observability value to set. + * @return the AdvancedNetworking object itself. + */ + public AdvancedNetworking withObservability(AdvancedNetworkingObservability observability) { + this.observability = observability; + return this; + } + + /** + * Get the security property: Security profile to enable security features on cilium based cluster. + * + * @return the security value. + */ + public AdvancedNetworkingSecurity security() { + return this.security; + } + + /** + * Set the security property: Security profile to enable security features on cilium based cluster. + * + * @param security the security value to set. + * @return the AdvancedNetworking object itself. + */ + public AdvancedNetworking withSecurity(AdvancedNetworkingSecurity security) { + this.security = security; + return this; + } + + /** + * Get the performance property: Profile to enable performance-enhancing features on clusters that use Azure CNI + * powered by Cilium. + * + * @return the performance value. + */ + public AdvancedNetworkingPerformance performance() { + return this.performance; + } + + /** + * Set the performance property: Profile to enable performance-enhancing features on clusters that use Azure CNI + * powered by Cilium. + * + * @param performance the performance value to set. + * @return the AdvancedNetworking object itself. + */ + public AdvancedNetworking withPerformance(AdvancedNetworkingPerformance performance) { + this.performance = performance; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeJsonField("observability", this.observability); + jsonWriter.writeJsonField("security", this.security); + jsonWriter.writeJsonField("performance", this.performance); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AdvancedNetworking from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AdvancedNetworking if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AdvancedNetworking. + */ + public static AdvancedNetworking fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AdvancedNetworking deserializedAdvancedNetworking = new AdvancedNetworking(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedAdvancedNetworking.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("observability".equals(fieldName)) { + deserializedAdvancedNetworking.observability = AdvancedNetworkingObservability.fromJson(reader); + } else if ("security".equals(fieldName)) { + deserializedAdvancedNetworking.security = AdvancedNetworkingSecurity.fromJson(reader); + } else if ("performance".equals(fieldName)) { + deserializedAdvancedNetworking.performance = AdvancedNetworkingPerformance.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAdvancedNetworking; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AdvancedNetworkingObservability.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AdvancedNetworkingObservability.java new file mode 100644 index 000000000000..5b2d235b8466 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AdvancedNetworkingObservability.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Observability profile to enable advanced network metrics and flow logs with historical contexts. + */ +@Fluent +public final class AdvancedNetworkingObservability implements JsonSerializable { + /* + * Indicates the enablement of Advanced Networking observability functionalities on clusters. + */ + private Boolean enabled; + + /** + * Creates an instance of AdvancedNetworkingObservability class. + */ + public AdvancedNetworkingObservability() { + } + + /** + * Get the enabled property: Indicates the enablement of Advanced Networking observability functionalities on + * clusters. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Indicates the enablement of Advanced Networking observability functionalities on + * clusters. + * + * @param enabled the enabled value to set. + * @return the AdvancedNetworkingObservability object itself. + */ + public AdvancedNetworkingObservability withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AdvancedNetworkingObservability from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AdvancedNetworkingObservability if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AdvancedNetworkingObservability. + */ + public static AdvancedNetworkingObservability fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AdvancedNetworkingObservability deserializedAdvancedNetworkingObservability + = new AdvancedNetworkingObservability(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedAdvancedNetworkingObservability.enabled = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedAdvancedNetworkingObservability; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AdvancedNetworkingPerformance.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AdvancedNetworkingPerformance.java new file mode 100644 index 000000000000..a02080d3409f --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AdvancedNetworkingPerformance.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Profile to enable performance-enhancing features on clusters that use Azure CNI powered by Cilium. + */ +@Fluent +public final class AdvancedNetworkingPerformance implements JsonSerializable { + /* + * Enable advanced network acceleration options. This allows users to configure acceleration using BPF host routing. + * This can be enabled only with Cilium dataplane. If not specified, the default value is None (no acceleration). + * The acceleration mode can be changed on a pre-existing cluster. See https://aka.ms/acnsperformance for a detailed + * explanation + */ + private AccelerationMode accelerationMode; + + /** + * Creates an instance of AdvancedNetworkingPerformance class. + */ + public AdvancedNetworkingPerformance() { + } + + /** + * Get the accelerationMode property: Enable advanced network acceleration options. This allows users to configure + * acceleration using BPF host routing. This can be enabled only with Cilium dataplane. If not specified, the + * default value is None (no acceleration). The acceleration mode can be changed on a pre-existing cluster. See + * https://aka.ms/acnsperformance for a detailed explanation. + * + * @return the accelerationMode value. + */ + public AccelerationMode accelerationMode() { + return this.accelerationMode; + } + + /** + * Set the accelerationMode property: Enable advanced network acceleration options. This allows users to configure + * acceleration using BPF host routing. This can be enabled only with Cilium dataplane. If not specified, the + * default value is None (no acceleration). The acceleration mode can be changed on a pre-existing cluster. See + * https://aka.ms/acnsperformance for a detailed explanation. + * + * @param accelerationMode the accelerationMode value to set. + * @return the AdvancedNetworkingPerformance object itself. + */ + public AdvancedNetworkingPerformance withAccelerationMode(AccelerationMode accelerationMode) { + this.accelerationMode = accelerationMode; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("accelerationMode", + this.accelerationMode == null ? null : this.accelerationMode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AdvancedNetworkingPerformance from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AdvancedNetworkingPerformance if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AdvancedNetworkingPerformance. + */ + public static AdvancedNetworkingPerformance fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AdvancedNetworkingPerformance deserializedAdvancedNetworkingPerformance + = new AdvancedNetworkingPerformance(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("accelerationMode".equals(fieldName)) { + deserializedAdvancedNetworkingPerformance.accelerationMode + = AccelerationMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAdvancedNetworkingPerformance; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AdvancedNetworkingSecurity.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AdvancedNetworkingSecurity.java new file mode 100644 index 000000000000..ea732eadc1b2 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AdvancedNetworkingSecurity.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Security profile to enable security features on cilium based cluster. + */ +@Fluent +public final class AdvancedNetworkingSecurity implements JsonSerializable { + /* + * This feature allows user to configure network policy based on DNS (FQDN) names. It can be enabled only on cilium + * based clusters. If not specified, the default is false. + */ + private Boolean enabled; + + /* + * Enable advanced network policies. This allows users to configure Layer 7 network policies (FQDN, HTTP, Kafka). + * Policies themselves must be configured via the Cilium Network Policy resources, see + * https://docs.cilium.io/en/latest/security/policy/index.html. This can be enabled only on cilium-based clusters. + * If not specified, the default value is FQDN if security.enabled is set to true. + */ + private AdvancedNetworkPolicies advancedNetworkPolicies; + + /* + * Encryption configuration for Cilium-based clusters. Once enabled all traffic between Cilium managed pods will be + * encrypted when it leaves the node boundary. + */ + private AdvancedNetworkingSecurityTransitEncryption transitEncryption; + + /** + * Creates an instance of AdvancedNetworkingSecurity class. + */ + public AdvancedNetworkingSecurity() { + } + + /** + * Get the enabled property: This feature allows user to configure network policy based on DNS (FQDN) names. It can + * be enabled only on cilium based clusters. If not specified, the default is false. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: This feature allows user to configure network policy based on DNS (FQDN) names. It can + * be enabled only on cilium based clusters. If not specified, the default is false. + * + * @param enabled the enabled value to set. + * @return the AdvancedNetworkingSecurity object itself. + */ + public AdvancedNetworkingSecurity withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the advancedNetworkPolicies property: Enable advanced network policies. This allows users to configure Layer + * 7 network policies (FQDN, HTTP, Kafka). Policies themselves must be configured via the Cilium Network Policy + * resources, see https://docs.cilium.io/en/latest/security/policy/index.html. This can be enabled only on + * cilium-based clusters. If not specified, the default value is FQDN if security.enabled is set to true. + * + * @return the advancedNetworkPolicies value. + */ + public AdvancedNetworkPolicies advancedNetworkPolicies() { + return this.advancedNetworkPolicies; + } + + /** + * Set the advancedNetworkPolicies property: Enable advanced network policies. This allows users to configure Layer + * 7 network policies (FQDN, HTTP, Kafka). Policies themselves must be configured via the Cilium Network Policy + * resources, see https://docs.cilium.io/en/latest/security/policy/index.html. This can be enabled only on + * cilium-based clusters. If not specified, the default value is FQDN if security.enabled is set to true. + * + * @param advancedNetworkPolicies the advancedNetworkPolicies value to set. + * @return the AdvancedNetworkingSecurity object itself. + */ + public AdvancedNetworkingSecurity withAdvancedNetworkPolicies(AdvancedNetworkPolicies advancedNetworkPolicies) { + this.advancedNetworkPolicies = advancedNetworkPolicies; + return this; + } + + /** + * Get the transitEncryption property: Encryption configuration for Cilium-based clusters. Once enabled all traffic + * between Cilium managed pods will be encrypted when it leaves the node boundary. + * + * @return the transitEncryption value. + */ + public AdvancedNetworkingSecurityTransitEncryption transitEncryption() { + return this.transitEncryption; + } + + /** + * Set the transitEncryption property: Encryption configuration for Cilium-based clusters. Once enabled all traffic + * between Cilium managed pods will be encrypted when it leaves the node boundary. + * + * @param transitEncryption the transitEncryption value to set. + * @return the AdvancedNetworkingSecurity object itself. + */ + public AdvancedNetworkingSecurity + withTransitEncryption(AdvancedNetworkingSecurityTransitEncryption transitEncryption) { + this.transitEncryption = transitEncryption; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeStringField("advancedNetworkPolicies", + this.advancedNetworkPolicies == null ? null : this.advancedNetworkPolicies.toString()); + jsonWriter.writeJsonField("transitEncryption", this.transitEncryption); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AdvancedNetworkingSecurity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AdvancedNetworkingSecurity if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AdvancedNetworkingSecurity. + */ + public static AdvancedNetworkingSecurity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AdvancedNetworkingSecurity deserializedAdvancedNetworkingSecurity = new AdvancedNetworkingSecurity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedAdvancedNetworkingSecurity.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("advancedNetworkPolicies".equals(fieldName)) { + deserializedAdvancedNetworkingSecurity.advancedNetworkPolicies + = AdvancedNetworkPolicies.fromString(reader.getString()); + } else if ("transitEncryption".equals(fieldName)) { + deserializedAdvancedNetworkingSecurity.transitEncryption + = AdvancedNetworkingSecurityTransitEncryption.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAdvancedNetworkingSecurity; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AdvancedNetworkingSecurityTransitEncryption.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AdvancedNetworkingSecurityTransitEncryption.java new file mode 100644 index 000000000000..84db42a6d577 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AdvancedNetworkingSecurityTransitEncryption.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Encryption configuration for Cilium-based clusters. Once enabled all traffic between Cilium managed pods will be + * encrypted when it leaves the node boundary. + */ +@Fluent +public final class AdvancedNetworkingSecurityTransitEncryption + implements JsonSerializable { + /* + * Configures pod-to-pod encryption. This can be enabled only on Cilium-based clusters. If not specified, the + * default value is None. + */ + private TransitEncryptionType type; + + /** + * Creates an instance of AdvancedNetworkingSecurityTransitEncryption class. + */ + public AdvancedNetworkingSecurityTransitEncryption() { + } + + /** + * Get the type property: Configures pod-to-pod encryption. This can be enabled only on Cilium-based clusters. If + * not specified, the default value is None. + * + * @return the type value. + */ + public TransitEncryptionType type() { + return this.type; + } + + /** + * Set the type property: Configures pod-to-pod encryption. This can be enabled only on Cilium-based clusters. If + * not specified, the default value is None. + * + * @param type the type value to set. + * @return the AdvancedNetworkingSecurityTransitEncryption object itself. + */ + public AdvancedNetworkingSecurityTransitEncryption withType(TransitEncryptionType type) { + this.type = type; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AdvancedNetworkingSecurityTransitEncryption from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AdvancedNetworkingSecurityTransitEncryption if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AdvancedNetworkingSecurityTransitEncryption. + */ + public static AdvancedNetworkingSecurityTransitEncryption fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AdvancedNetworkingSecurityTransitEncryption deserializedAdvancedNetworkingSecurityTransitEncryption + = new AdvancedNetworkingSecurityTransitEncryption(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedAdvancedNetworkingSecurityTransitEncryption.type + = TransitEncryptionType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAdvancedNetworkingSecurityTransitEncryption; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPool.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPool.java new file mode 100644 index 000000000000..d6cebbea3a62 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPool.java @@ -0,0 +1,2351 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.fluent.models.AgentPoolInner; +import java.util.List; +import java.util.Map; + +/** + * An immutable client-side representation of AgentPool. + */ +public interface AgentPool { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the eTag property: Unique read-only string used to implement optimistic concurrency. The eTag value will + * change when the resource is updated. Specify an if-match or if-none-match header with the eTag value for a + * subsequent request to enable optimistic concurrency per the normal eTag convention. + * + * @return the eTag value. + */ + String eTag(); + + /** + * Gets the count property: 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. + * + * @return the count value. + */ + Integer count(); + + /** + * Gets the vmSize property: The size of the agent pool VMs. 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. + * + * @return the vmSize value. + */ + String vmSize(); + + /** + * Gets the osDiskSizeGB property: 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. + * + * @return the osDiskSizeGB value. + */ + Integer osDiskSizeGB(); + + /** + * Gets the osDiskType property: The OS disk type to be used for machines in the agent pool. 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). + * + * @return the osDiskType value. + */ + OSDiskType osDiskType(); + + /** + * Gets the kubeletDiskType property: Determines the placement of emptyDir volumes, container runtime data root, and + * Kubelet ephemeral storage. + * + * @return the kubeletDiskType value. + */ + KubeletDiskType kubeletDiskType(); + + /** + * Gets the workloadRuntime property: Determines the type of workload a node can run. + * + * @return the workloadRuntime value. + */ + WorkloadRuntime workloadRuntime(); + + /** + * Gets the messageOfTheDay property: Message of the day for Linux nodes, base64-encoded. A base64-encoded string + * which will be written to /etc/motd after decoding. This allows customization of the message of the day for Linux + * nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be printed raw and not + * be executed as a script). + * + * @return the messageOfTheDay value. + */ + String messageOfTheDay(); + + /** + * Gets the vnetSubnetID property: The ID of the subnet which agent pool nodes and optionally pods will join on + * startup. 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}. + * + * @return the vnetSubnetID value. + */ + String vnetSubnetID(); + + /** + * Gets the podSubnetID property: The ID of the subnet which pods will join when launched. 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}. + * + * @return the podSubnetID value. + */ + String podSubnetID(); + + /** + * Gets the podIPAllocationMode property: Pod IP Allocation Mode. The IP allocation mode for pods in the agent pool. + * Must be used with podSubnetId. The default is 'DynamicIndividual'. + * + * @return the podIPAllocationMode value. + */ + PodIPAllocationMode podIPAllocationMode(); + + /** + * Gets the maxPods property: The maximum number of pods that can run on a node. + * + * @return the maxPods value. + */ + Integer maxPods(); + + /** + * Gets the osType property: The operating system type. The default is Linux. + * + * @return the osType value. + */ + OSType osType(); + + /** + * Gets the osSKU property: 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. + * + * @return the osSKU value. + */ + OSSKU osSKU(); + + /** + * Gets the maxCount property: The maximum number of nodes for auto-scaling. + * + * @return the maxCount value. + */ + Integer maxCount(); + + /** + * Gets the minCount property: The minimum number of nodes for auto-scaling. + * + * @return the minCount value. + */ + Integer minCount(); + + /** + * Gets the enableAutoScaling property: Whether to enable auto-scaler. + * + * @return the enableAutoScaling value. + */ + Boolean enableAutoScaling(); + + /** + * Gets the scaleDownMode property: The scale down mode to use when scaling the Agent Pool. This also effects the + * cluster autoscaler behavior. If not specified, it defaults to Delete. + * + * @return the scaleDownMode value. + */ + ScaleDownMode scaleDownMode(); + + /** + * Gets the typePropertiesType property: The type of Agent Pool. + * + * @return the typePropertiesType value. + */ + AgentPoolType typePropertiesType(); + + /** + * Gets the mode property: The mode of an 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. + * + * @return the mode value. + */ + AgentPoolMode mode(); + + /** + * Gets the orchestratorVersion property: The version of Kubernetes specified by the user. 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). + * + * @return the orchestratorVersion value. + */ + String orchestratorVersion(); + + /** + * Gets the currentOrchestratorVersion property: The version of Kubernetes the Agent Pool is running. 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. + * + * @return the currentOrchestratorVersion value. + */ + String currentOrchestratorVersion(); + + /** + * Gets the nodeImageVersion property: The version of node image. + * + * @return the nodeImageVersion value. + */ + String nodeImageVersion(); + + /** + * Gets the upgradeSettings property: Settings for upgrading the agentpool. + * + * @return the upgradeSettings value. + */ + AgentPoolUpgradeSettings upgradeSettings(); + + /** + * Gets the provisioningState property: The current deployment or provisioning state. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the powerState property: Whether the Agent Pool is running or stopped. 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. + * + * @return the powerState value. + */ + PowerState powerState(); + + /** + * Gets the availabilityZones property: The list of Availability zones to use for nodes. This can only be specified + * if the AgentPoolType property is 'VirtualMachineScaleSets'. + * + * @return the availabilityZones value. + */ + List availabilityZones(); + + /** + * Gets the enableNodePublicIP property: Whether each node is allocated its own public IP. 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. + * + * @return the enableNodePublicIP value. + */ + Boolean enableNodePublicIP(); + + /** + * Gets the nodePublicIPPrefixID property: The public IP prefix ID which VM nodes should use IPs from. This is of + * the form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + * + * @return the nodePublicIPPrefixID value. + */ + String nodePublicIPPrefixID(); + + /** + * Gets the scaleSetPriority property: The Virtual Machine Scale Set priority. + * + * @return the scaleSetPriority value. + */ + ScaleSetPriority scaleSetPriority(); + + /** + * Gets the scaleSetEvictionPolicy property: The Virtual Machine Scale Set eviction policy. 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). + * + * @return the scaleSetEvictionPolicy value. + */ + ScaleSetEvictionPolicy scaleSetEvictionPolicy(); + + /** + * Gets the spotMaxPrice property: The max price (in US Dollars) you are willing to pay for spot instances. Possible + * values are any decimal value greater than zero or -1 which indicates default price to be up-to on-demand. + * 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). + * + * @return the spotMaxPrice value. + */ + Double spotMaxPrice(); + + /** + * Gets the tags property: The tags to be persisted on the agent pool virtual machine scale set. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the nodeLabels property: The node labels to be persisted across all nodes in agent pool. + * + * @return the nodeLabels value. + */ + Map nodeLabels(); + + /** + * Gets the nodeTaints property: The taints added to new nodes during node pool create and scale. For example, + * key=value:NoSchedule. + * + * @return the nodeTaints value. + */ + List nodeTaints(); + + /** + * Gets the proximityPlacementGroupID property: The ID for Proximity Placement Group. + * + * @return the proximityPlacementGroupID value. + */ + String proximityPlacementGroupID(); + + /** + * Gets the kubeletConfig property: The Kubelet configuration on the agent pool nodes. + * + * @return the kubeletConfig value. + */ + KubeletConfig kubeletConfig(); + + /** + * Gets the linuxOSConfig property: The OS configuration of Linux agent nodes. + * + * @return the linuxOSConfig value. + */ + LinuxOSConfig linuxOSConfig(); + + /** + * Gets the enableEncryptionAtHost property: Whether to enable host based OS and data drive encryption. 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. + * + * @return the enableEncryptionAtHost value. + */ + Boolean enableEncryptionAtHost(); + + /** + * Gets the enableUltraSSD property: Whether to enable UltraSSD. + * + * @return the enableUltraSSD value. + */ + Boolean enableUltraSSD(); + + /** + * Gets the enableFIPS property: Whether to use a FIPS-enabled OS. 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. + * + * @return the enableFIPS value. + */ + Boolean enableFIPS(); + + /** + * Gets the gpuInstanceProfile property: GPUInstanceProfile to be used to specify GPU MIG instance profile for + * supported GPU VM SKU. + * + * @return the gpuInstanceProfile value. + */ + GPUInstanceProfile gpuInstanceProfile(); + + /** + * Gets the creationData property: CreationData to be used to specify the source Snapshot ID if the node pool will + * be created/upgraded using a snapshot. + * + * @return the creationData value. + */ + CreationData creationData(); + + /** + * Gets the capacityReservationGroupID property: The fully qualified resource ID of the Capacity Reservation Group + * to provide virtual machines from a reserved group of Virtual Machines. This is of the form: + * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Compute/capacityreservationgroups/{capacityReservationGroupName}' + * Customers use it to create an agentpool with a specified CRG. For more information see [Capacity + * Reservation](https://learn.microsoft.com/en-us/azure/virtual-machines/capacity-reservation-overview). + * + * @return the capacityReservationGroupID value. + */ + String capacityReservationGroupID(); + + /** + * Gets the hostGroupID property: The fully qualified resource ID of the Dedicated Host Group to provision virtual + * machines from, used only in creation scenario and not allowed to changed once 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). + * + * @return the hostGroupID value. + */ + String hostGroupID(); + + /** + * Gets the networkProfile property: Network-related settings of an agent pool. + * + * @return the networkProfile value. + */ + AgentPoolNetworkProfile networkProfile(); + + /** + * Gets the windowsProfile property: The Windows agent pool's specific profile. + * + * @return the windowsProfile value. + */ + AgentPoolWindowsProfile windowsProfile(); + + /** + * Gets the securityProfile property: The security settings of an agent pool. + * + * @return the securityProfile value. + */ + AgentPoolSecurityProfile securityProfile(); + + /** + * Gets the gpuProfile property: GPU settings for the Agent Pool. + * + * @return the gpuProfile value. + */ + GPUProfile gpuProfile(); + + /** + * Gets the gatewayProfile property: Profile specific to a managed agent pool in Gateway mode. This field cannot be + * set if agent pool mode is not Gateway. + * + * @return the gatewayProfile value. + */ + AgentPoolGatewayProfile gatewayProfile(); + + /** + * Gets the virtualMachinesProfile property: Specifications on VirtualMachines agent pool. + * + * @return the virtualMachinesProfile value. + */ + VirtualMachinesProfile virtualMachinesProfile(); + + /** + * Gets the virtualMachineNodesStatus property: The status of nodes in a VirtualMachines agent pool. + * + * @return the virtualMachineNodesStatus value. + */ + List virtualMachineNodesStatus(); + + /** + * Gets the status property: Contains read-only information about the Agent Pool. + * + * @return the status value. + */ + AgentPoolStatus status(); + + /** + * Gets the localDNSProfile property: Configures the per-node local DNS, with VnetDNS and KubeDNS overrides. + * LocalDNS helps improve performance and reliability of DNS resolution in an AKS cluster. For more details see + * aka.ms/aks/localdns. + * + * @return the localDNSProfile value. + */ + LocalDNSProfile localDNSProfile(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.containerservice.generated.fluent.models.AgentPoolInner object. + * + * @return the inner object. + */ + AgentPoolInner innerModel(); + + /** + * The entirety of the AgentPool definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The AgentPool definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the AgentPool definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the AgentPool definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, resourceName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @return the next definition stage. + */ + WithCreate withExistingManagedCluster(String resourceGroupName, String resourceName); + } + + /** + * The stage of the AgentPool definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithCount, DefinitionStages.WithVmSize, + DefinitionStages.WithOsDiskSizeGB, DefinitionStages.WithOsDiskType, DefinitionStages.WithKubeletDiskType, + DefinitionStages.WithWorkloadRuntime, DefinitionStages.WithMessageOfTheDay, + DefinitionStages.WithVnetSubnetID, DefinitionStages.WithPodSubnetID, + DefinitionStages.WithPodIPAllocationMode, DefinitionStages.WithMaxPods, DefinitionStages.WithOsType, + DefinitionStages.WithOsSKU, DefinitionStages.WithMaxCount, DefinitionStages.WithMinCount, + DefinitionStages.WithEnableAutoScaling, DefinitionStages.WithScaleDownMode, + DefinitionStages.WithTypePropertiesType, DefinitionStages.WithMode, + DefinitionStages.WithOrchestratorVersion, DefinitionStages.WithUpgradeSettings, + DefinitionStages.WithPowerState, DefinitionStages.WithAvailabilityZones, + DefinitionStages.WithEnableNodePublicIP, DefinitionStages.WithNodePublicIPPrefixID, + DefinitionStages.WithScaleSetPriority, DefinitionStages.WithScaleSetEvictionPolicy, + DefinitionStages.WithSpotMaxPrice, DefinitionStages.WithNodeLabels, DefinitionStages.WithNodeTaints, + DefinitionStages.WithProximityPlacementGroupID, DefinitionStages.WithKubeletConfig, + DefinitionStages.WithLinuxOSConfig, DefinitionStages.WithEnableEncryptionAtHost, + DefinitionStages.WithEnableUltraSSD, DefinitionStages.WithEnableFIPS, + DefinitionStages.WithGpuInstanceProfile, DefinitionStages.WithCreationData, + DefinitionStages.WithCapacityReservationGroupID, DefinitionStages.WithHostGroupID, + DefinitionStages.WithNetworkProfile, DefinitionStages.WithWindowsProfile, + DefinitionStages.WithSecurityProfile, DefinitionStages.WithGpuProfile, DefinitionStages.WithGatewayProfile, + DefinitionStages.WithVirtualMachinesProfile, DefinitionStages.WithVirtualMachineNodesStatus, + DefinitionStages.WithStatus, DefinitionStages.WithLocalDNSProfile, DefinitionStages.WithIfMatch, + DefinitionStages.WithIfNoneMatch { + /** + * Executes the create request. + * + * @return the created resource. + */ + AgentPool create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + AgentPool create(Context context); + } + + /** + * The stage of the AgentPool definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: The tags to be persisted on the agent pool virtual machine scale set.. + * + * @param tags The tags to be persisted on the agent pool virtual machine scale set. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the AgentPool definition allowing to specify count. + */ + interface WithCount { + /** + * Specifies the count property: 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.. + * + * @param count 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. + * @return the next definition stage. + */ + WithCreate withCount(Integer count); + } + + /** + * The stage of the AgentPool definition allowing to specify vmSize. + */ + interface WithVmSize { + /** + * Specifies the vmSize property: The size of the agent pool VMs. 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. + * + * @param vmSize The size of the agent pool VMs. 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. + * @return the next definition stage. + */ + WithCreate withVmSize(String vmSize); + } + + /** + * The stage of the AgentPool definition allowing to specify osDiskSizeGB. + */ + interface WithOsDiskSizeGB { + /** + * Specifies the osDiskSizeGB property: 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.. + * + * @param osDiskSizeGB 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. + * @return the next definition stage. + */ + WithCreate withOsDiskSizeGB(Integer osDiskSizeGB); + } + + /** + * The stage of the AgentPool definition allowing to specify osDiskType. + */ + interface WithOsDiskType { + /** + * Specifies the osDiskType property: The OS disk type to be used for machines in the agent pool. 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).. + * + * @param osDiskType The OS disk type to be used for machines in the agent pool. 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). + * @return the next definition stage. + */ + WithCreate withOsDiskType(OSDiskType osDiskType); + } + + /** + * The stage of the AgentPool definition allowing to specify kubeletDiskType. + */ + interface WithKubeletDiskType { + /** + * Specifies the kubeletDiskType property: Determines the placement of emptyDir volumes, container runtime + * data root, and Kubelet ephemeral storage.. + * + * @param kubeletDiskType Determines the placement of emptyDir volumes, container runtime data root, and + * Kubelet ephemeral storage. + * @return the next definition stage. + */ + WithCreate withKubeletDiskType(KubeletDiskType kubeletDiskType); + } + + /** + * The stage of the AgentPool definition allowing to specify workloadRuntime. + */ + interface WithWorkloadRuntime { + /** + * Specifies the workloadRuntime property: Determines the type of workload a node can run.. + * + * @param workloadRuntime Determines the type of workload a node can run. + * @return the next definition stage. + */ + WithCreate withWorkloadRuntime(WorkloadRuntime workloadRuntime); + } + + /** + * The stage of the AgentPool definition allowing to specify messageOfTheDay. + */ + interface WithMessageOfTheDay { + /** + * Specifies the messageOfTheDay property: Message of the day for Linux nodes, base64-encoded. A + * base64-encoded string which will be written to /etc/motd after decoding. This allows customization of the + * message of the day for Linux nodes. It must not be specified for Windows nodes. It must be a static + * string (i.e., will be printed raw and not be executed as a script).. + * + * @param messageOfTheDay Message of the day for Linux nodes, base64-encoded. A base64-encoded string which + * will be written to /etc/motd after decoding. This allows customization of the message of the day for + * Linux nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be + * printed raw and not be executed as a script). + * @return the next definition stage. + */ + WithCreate withMessageOfTheDay(String messageOfTheDay); + } + + /** + * The stage of the AgentPool definition allowing to specify vnetSubnetID. + */ + interface WithVnetSubnetID { + /** + * Specifies the vnetSubnetID property: The ID of the subnet which agent pool nodes and optionally pods will + * join on startup. 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}. + * + * @param vnetSubnetID The ID of the subnet which agent pool nodes and optionally pods will join on startup. + * 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}. + * @return the next definition stage. + */ + WithCreate withVnetSubnetID(String vnetSubnetID); + } + + /** + * The stage of the AgentPool definition allowing to specify podSubnetID. + */ + interface WithPodSubnetID { + /** + * Specifies the podSubnetID property: The ID of the subnet which pods will join when launched. 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}. + * + * @param podSubnetID The ID of the subnet which pods will join when launched. 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}. + * @return the next definition stage. + */ + WithCreate withPodSubnetID(String podSubnetID); + } + + /** + * The stage of the AgentPool definition allowing to specify podIPAllocationMode. + */ + interface WithPodIPAllocationMode { + /** + * Specifies the podIPAllocationMode property: Pod IP Allocation Mode. The IP allocation mode for pods in + * the agent pool. Must be used with podSubnetId. The default is 'DynamicIndividual'.. + * + * @param podIPAllocationMode Pod IP Allocation Mode. The IP allocation mode for pods in the agent pool. + * Must be used with podSubnetId. The default is 'DynamicIndividual'. + * @return the next definition stage. + */ + WithCreate withPodIPAllocationMode(PodIPAllocationMode podIPAllocationMode); + } + + /** + * The stage of the AgentPool definition allowing to specify maxPods. + */ + interface WithMaxPods { + /** + * Specifies the maxPods property: The maximum number of pods that can run on a node.. + * + * @param maxPods The maximum number of pods that can run on a node. + * @return the next definition stage. + */ + WithCreate withMaxPods(Integer maxPods); + } + + /** + * The stage of the AgentPool definition allowing to specify osType. + */ + interface WithOsType { + /** + * Specifies the osType property: The operating system type. The default is Linux.. + * + * @param osType The operating system type. The default is Linux. + * @return the next definition stage. + */ + WithCreate withOsType(OSType osType); + } + + /** + * The stage of the AgentPool definition allowing to specify osSKU. + */ + interface WithOsSKU { + /** + * Specifies the osSKU property: 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.. + * + * @param osSKU 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. + * @return the next definition stage. + */ + WithCreate withOsSKU(OSSKU osSKU); + } + + /** + * The stage of the AgentPool definition allowing to specify maxCount. + */ + interface WithMaxCount { + /** + * Specifies the maxCount property: The maximum number of nodes for auto-scaling. + * + * @param maxCount The maximum number of nodes for auto-scaling. + * @return the next definition stage. + */ + WithCreate withMaxCount(Integer maxCount); + } + + /** + * The stage of the AgentPool definition allowing to specify minCount. + */ + interface WithMinCount { + /** + * Specifies the minCount property: The minimum number of nodes for auto-scaling. + * + * @param minCount The minimum number of nodes for auto-scaling. + * @return the next definition stage. + */ + WithCreate withMinCount(Integer minCount); + } + + /** + * The stage of the AgentPool definition allowing to specify enableAutoScaling. + */ + interface WithEnableAutoScaling { + /** + * Specifies the enableAutoScaling property: Whether to enable auto-scaler. + * + * @param enableAutoScaling Whether to enable auto-scaler. + * @return the next definition stage. + */ + WithCreate withEnableAutoScaling(Boolean enableAutoScaling); + } + + /** + * The stage of the AgentPool definition allowing to specify scaleDownMode. + */ + interface WithScaleDownMode { + /** + * Specifies the scaleDownMode property: The scale down mode to use when scaling the Agent Pool. This also + * effects the cluster autoscaler behavior. If not specified, it defaults to Delete.. + * + * @param scaleDownMode The scale down mode to use when scaling the Agent Pool. This also effects the + * cluster autoscaler behavior. If not specified, it defaults to Delete. + * @return the next definition stage. + */ + WithCreate withScaleDownMode(ScaleDownMode scaleDownMode); + } + + /** + * The stage of the AgentPool definition allowing to specify typePropertiesType. + */ + interface WithTypePropertiesType { + /** + * Specifies the typePropertiesType property: The type of Agent Pool.. + * + * @param typePropertiesType The type of Agent Pool. + * @return the next definition stage. + */ + WithCreate withTypePropertiesType(AgentPoolType typePropertiesType); + } + + /** + * The stage of the AgentPool definition allowing to specify mode. + */ + interface WithMode { + /** + * Specifies the mode property: The mode of an 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. + * + * @param mode The mode of an 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. + * @return the next definition stage. + */ + WithCreate withMode(AgentPoolMode mode); + } + + /** + * The stage of the AgentPool definition allowing to specify orchestratorVersion. + */ + interface WithOrchestratorVersion { + /** + * Specifies the orchestratorVersion property: The version of Kubernetes specified by the user. 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).. + * + * @param orchestratorVersion The version of Kubernetes specified by the user. 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). + * @return the next definition stage. + */ + WithCreate withOrchestratorVersion(String orchestratorVersion); + } + + /** + * The stage of the AgentPool definition allowing to specify upgradeSettings. + */ + interface WithUpgradeSettings { + /** + * Specifies the upgradeSettings property: Settings for upgrading the agentpool. + * + * @param upgradeSettings Settings for upgrading the agentpool. + * @return the next definition stage. + */ + WithCreate withUpgradeSettings(AgentPoolUpgradeSettings upgradeSettings); + } + + /** + * The stage of the AgentPool definition allowing to specify powerState. + */ + interface WithPowerState { + /** + * Specifies the powerState property: Whether the Agent Pool is running or stopped. 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. + * + * @param powerState Whether the Agent Pool is running or stopped. 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. + * @return the next definition stage. + */ + WithCreate withPowerState(PowerState powerState); + } + + /** + * The stage of the AgentPool definition allowing to specify availabilityZones. + */ + interface WithAvailabilityZones { + /** + * Specifies the availabilityZones property: The list of Availability zones to use for nodes. This can only + * be specified if the AgentPoolType property is 'VirtualMachineScaleSets'.. + * + * @param availabilityZones The list of Availability zones to use for nodes. This can only be specified if + * the AgentPoolType property is 'VirtualMachineScaleSets'. + * @return the next definition stage. + */ + WithCreate withAvailabilityZones(List availabilityZones); + } + + /** + * The stage of the AgentPool definition allowing to specify enableNodePublicIP. + */ + interface WithEnableNodePublicIP { + /** + * Specifies the enableNodePublicIP property: Whether each node is allocated its own public IP. 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.. + * + * @param enableNodePublicIP Whether each node is allocated its own public IP. 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. + * @return the next definition stage. + */ + WithCreate withEnableNodePublicIP(Boolean enableNodePublicIP); + } + + /** + * The stage of the AgentPool definition allowing to specify nodePublicIPPrefixID. + */ + interface WithNodePublicIPPrefixID { + /** + * Specifies the nodePublicIPPrefixID property: The public IP prefix ID which VM nodes should use IPs from. + * This is of the form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + * + * @param nodePublicIPPrefixID The public IP prefix ID which VM nodes should use IPs from. This is of the + * form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + * @return the next definition stage. + */ + WithCreate withNodePublicIPPrefixID(String nodePublicIPPrefixID); + } + + /** + * The stage of the AgentPool definition allowing to specify scaleSetPriority. + */ + interface WithScaleSetPriority { + /** + * Specifies the scaleSetPriority property: The Virtual Machine Scale Set priority.. + * + * @param scaleSetPriority The Virtual Machine Scale Set priority. + * @return the next definition stage. + */ + WithCreate withScaleSetPriority(ScaleSetPriority scaleSetPriority); + } + + /** + * The stage of the AgentPool definition allowing to specify scaleSetEvictionPolicy. + */ + interface WithScaleSetEvictionPolicy { + /** + * Specifies the scaleSetEvictionPolicy property: The Virtual Machine Scale Set eviction policy. 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). + * + * @param scaleSetEvictionPolicy The Virtual Machine Scale Set eviction policy. 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). + * @return the next definition stage. + */ + WithCreate withScaleSetEvictionPolicy(ScaleSetEvictionPolicy scaleSetEvictionPolicy); + } + + /** + * The stage of the AgentPool definition allowing to specify spotMaxPrice. + */ + interface WithSpotMaxPrice { + /** + * Specifies the spotMaxPrice property: The max price (in US Dollars) you are willing to pay for spot + * instances. Possible values are any decimal value greater than zero or -1 which indicates default price to + * be up-to on-demand. 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). + * + * @param spotMaxPrice The max price (in US Dollars) you are willing to pay for spot instances. Possible + * values are any decimal value greater than zero or -1 which indicates default price to be up-to on-demand. + * 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). + * @return the next definition stage. + */ + WithCreate withSpotMaxPrice(Double spotMaxPrice); + } + + /** + * The stage of the AgentPool definition allowing to specify nodeLabels. + */ + interface WithNodeLabels { + /** + * Specifies the nodeLabels property: The node labels to be persisted across all nodes in agent pool.. + * + * @param nodeLabels The node labels to be persisted across all nodes in agent pool. + * @return the next definition stage. + */ + WithCreate withNodeLabels(Map nodeLabels); + } + + /** + * The stage of the AgentPool definition allowing to specify nodeTaints. + */ + interface WithNodeTaints { + /** + * Specifies the nodeTaints property: The taints added to new nodes during node pool create and scale. For + * example, key=value:NoSchedule.. + * + * @param nodeTaints The taints added to new nodes during node pool create and scale. For example, + * key=value:NoSchedule. + * @return the next definition stage. + */ + WithCreate withNodeTaints(List nodeTaints); + } + + /** + * The stage of the AgentPool definition allowing to specify proximityPlacementGroupID. + */ + interface WithProximityPlacementGroupID { + /** + * Specifies the proximityPlacementGroupID property: The ID for Proximity Placement Group.. + * + * @param proximityPlacementGroupID The ID for Proximity Placement Group. + * @return the next definition stage. + */ + WithCreate withProximityPlacementGroupID(String proximityPlacementGroupID); + } + + /** + * The stage of the AgentPool definition allowing to specify kubeletConfig. + */ + interface WithKubeletConfig { + /** + * Specifies the kubeletConfig property: The Kubelet configuration on the agent pool nodes.. + * + * @param kubeletConfig The Kubelet configuration on the agent pool nodes. + * @return the next definition stage. + */ + WithCreate withKubeletConfig(KubeletConfig kubeletConfig); + } + + /** + * The stage of the AgentPool definition allowing to specify linuxOSConfig. + */ + interface WithLinuxOSConfig { + /** + * Specifies the linuxOSConfig property: The OS configuration of Linux agent nodes.. + * + * @param linuxOSConfig The OS configuration of Linux agent nodes. + * @return the next definition stage. + */ + WithCreate withLinuxOSConfig(LinuxOSConfig linuxOSConfig); + } + + /** + * The stage of the AgentPool definition allowing to specify enableEncryptionAtHost. + */ + interface WithEnableEncryptionAtHost { + /** + * Specifies the enableEncryptionAtHost property: Whether to enable host based OS and data drive encryption. + * 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. + * + * @param enableEncryptionAtHost Whether to enable host based OS and data drive encryption. 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. + * @return the next definition stage. + */ + WithCreate withEnableEncryptionAtHost(Boolean enableEncryptionAtHost); + } + + /** + * The stage of the AgentPool definition allowing to specify enableUltraSSD. + */ + interface WithEnableUltraSSD { + /** + * Specifies the enableUltraSSD property: Whether to enable UltraSSD. + * + * @param enableUltraSSD Whether to enable UltraSSD. + * @return the next definition stage. + */ + WithCreate withEnableUltraSSD(Boolean enableUltraSSD); + } + + /** + * The stage of the AgentPool definition allowing to specify enableFIPS. + */ + interface WithEnableFIPS { + /** + * Specifies the enableFIPS property: Whether to use a FIPS-enabled OS. 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.. + * + * @param enableFIPS Whether to use a FIPS-enabled OS. 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. + * @return the next definition stage. + */ + WithCreate withEnableFIPS(Boolean enableFIPS); + } + + /** + * The stage of the AgentPool definition allowing to specify gpuInstanceProfile. + */ + interface WithGpuInstanceProfile { + /** + * Specifies the gpuInstanceProfile property: GPUInstanceProfile to be used to specify GPU MIG instance + * profile for supported GPU VM SKU.. + * + * @param gpuInstanceProfile GPUInstanceProfile to be used to specify GPU MIG instance profile for supported + * GPU VM SKU. + * @return the next definition stage. + */ + WithCreate withGpuInstanceProfile(GPUInstanceProfile gpuInstanceProfile); + } + + /** + * The stage of the AgentPool definition allowing to specify creationData. + */ + interface WithCreationData { + /** + * Specifies the creationData property: CreationData to be used to specify the source Snapshot ID if the + * node pool will be created/upgraded using a snapshot.. + * + * @param creationData CreationData to be used to specify the source Snapshot ID if the node pool will be + * created/upgraded using a snapshot. + * @return the next definition stage. + */ + WithCreate withCreationData(CreationData creationData); + } + + /** + * The stage of the AgentPool definition allowing to specify capacityReservationGroupID. + */ + interface WithCapacityReservationGroupID { + /** + * Specifies the capacityReservationGroupID property: The fully qualified resource ID of the Capacity + * Reservation Group to provide virtual machines from a reserved group of Virtual Machines. This is of the + * form: + * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Compute/capacityreservationgroups/{capacityReservationGroupName}' + * Customers use it to create an agentpool with a specified CRG. For more information see [Capacity + * Reservation](https://learn.microsoft.com/en-us/azure/virtual-machines/capacity-reservation-overview). + * + * @param capacityReservationGroupID The fully qualified resource ID of the Capacity Reservation Group to + * provide virtual machines from a reserved group of Virtual Machines. This is of the form: + * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Compute/capacityreservationgroups/{capacityReservationGroupName}' + * Customers use it to create an agentpool with a specified CRG. For more information see [Capacity + * Reservation](https://learn.microsoft.com/en-us/azure/virtual-machines/capacity-reservation-overview). + * @return the next definition stage. + */ + WithCreate withCapacityReservationGroupID(String capacityReservationGroupID); + } + + /** + * The stage of the AgentPool definition allowing to specify hostGroupID. + */ + interface WithHostGroupID { + /** + * Specifies the hostGroupID property: The fully qualified resource ID of the Dedicated Host Group to + * provision virtual machines from, used only in creation scenario and not allowed to changed once 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).. + * + * @param hostGroupID The fully qualified resource ID of the Dedicated Host Group to provision virtual + * machines from, used only in creation scenario and not allowed to changed once 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). + * @return the next definition stage. + */ + WithCreate withHostGroupID(String hostGroupID); + } + + /** + * The stage of the AgentPool definition allowing to specify networkProfile. + */ + interface WithNetworkProfile { + /** + * Specifies the networkProfile property: Network-related settings of an agent pool.. + * + * @param networkProfile Network-related settings of an agent pool. + * @return the next definition stage. + */ + WithCreate withNetworkProfile(AgentPoolNetworkProfile networkProfile); + } + + /** + * The stage of the AgentPool definition allowing to specify windowsProfile. + */ + interface WithWindowsProfile { + /** + * Specifies the windowsProfile property: The Windows agent pool's specific profile.. + * + * @param windowsProfile The Windows agent pool's specific profile. + * @return the next definition stage. + */ + WithCreate withWindowsProfile(AgentPoolWindowsProfile windowsProfile); + } + + /** + * The stage of the AgentPool definition allowing to specify securityProfile. + */ + interface WithSecurityProfile { + /** + * Specifies the securityProfile property: The security settings of an agent pool.. + * + * @param securityProfile The security settings of an agent pool. + * @return the next definition stage. + */ + WithCreate withSecurityProfile(AgentPoolSecurityProfile securityProfile); + } + + /** + * The stage of the AgentPool definition allowing to specify gpuProfile. + */ + interface WithGpuProfile { + /** + * Specifies the gpuProfile property: GPU settings for the Agent Pool.. + * + * @param gpuProfile GPU settings for the Agent Pool. + * @return the next definition stage. + */ + WithCreate withGpuProfile(GPUProfile gpuProfile); + } + + /** + * The stage of the AgentPool definition allowing to specify gatewayProfile. + */ + interface WithGatewayProfile { + /** + * Specifies the gatewayProfile property: Profile specific to a managed agent pool in Gateway mode. This + * field cannot be set if agent pool mode is not Gateway.. + * + * @param gatewayProfile Profile specific to a managed agent pool in Gateway mode. This field cannot be set + * if agent pool mode is not Gateway. + * @return the next definition stage. + */ + WithCreate withGatewayProfile(AgentPoolGatewayProfile gatewayProfile); + } + + /** + * The stage of the AgentPool definition allowing to specify virtualMachinesProfile. + */ + interface WithVirtualMachinesProfile { + /** + * Specifies the virtualMachinesProfile property: Specifications on VirtualMachines agent pool.. + * + * @param virtualMachinesProfile Specifications on VirtualMachines agent pool. + * @return the next definition stage. + */ + WithCreate withVirtualMachinesProfile(VirtualMachinesProfile virtualMachinesProfile); + } + + /** + * The stage of the AgentPool definition allowing to specify virtualMachineNodesStatus. + */ + interface WithVirtualMachineNodesStatus { + /** + * Specifies the virtualMachineNodesStatus property: The status of nodes in a VirtualMachines agent pool.. + * + * @param virtualMachineNodesStatus The status of nodes in a VirtualMachines agent pool. + * @return the next definition stage. + */ + WithCreate withVirtualMachineNodesStatus(List virtualMachineNodesStatus); + } + + /** + * The stage of the AgentPool definition allowing to specify status. + */ + interface WithStatus { + /** + * Specifies the status property: Contains read-only information about the Agent Pool.. + * + * @param status Contains read-only information about the Agent Pool. + * @return the next definition stage. + */ + WithCreate withStatus(AgentPoolStatus status); + } + + /** + * The stage of the AgentPool definition allowing to specify localDNSProfile. + */ + interface WithLocalDNSProfile { + /** + * Specifies the localDNSProfile property: Configures the per-node local DNS, with VnetDNS and KubeDNS + * overrides. LocalDNS helps improve performance and reliability of DNS resolution in an AKS cluster. For + * more details see aka.ms/aks/localdns.. + * + * @param localDNSProfile Configures the per-node local DNS, with VnetDNS and KubeDNS overrides. LocalDNS + * helps improve performance and reliability of DNS resolution in an AKS cluster. For more details see + * aka.ms/aks/localdns. + * @return the next definition stage. + */ + WithCreate withLocalDNSProfile(LocalDNSProfile localDNSProfile); + } + + /** + * The stage of the AgentPool definition allowing to specify ifMatch. + */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: The request should only proceed if an entity matches this string.. + * + * @param ifMatch The request should only proceed if an entity matches this string. + * @return the next definition stage. + */ + WithCreate withIfMatch(String ifMatch); + } + + /** + * The stage of the AgentPool definition allowing to specify ifNoneMatch. + */ + interface WithIfNoneMatch { + /** + * Specifies the ifNoneMatch property: The request should only proceed if no entity matches this string.. + * + * @param ifNoneMatch The request should only proceed if no entity matches this string. + * @return the next definition stage. + */ + WithCreate withIfNoneMatch(String ifNoneMatch); + } + } + + /** + * Begins update for the AgentPool resource. + * + * @return the stage of resource update. + */ + AgentPool.Update update(); + + /** + * The template for AgentPool update. + */ + interface Update + extends UpdateStages.WithTags, UpdateStages.WithCount, UpdateStages.WithVmSize, UpdateStages.WithOsDiskSizeGB, + UpdateStages.WithOsDiskType, UpdateStages.WithKubeletDiskType, UpdateStages.WithWorkloadRuntime, + UpdateStages.WithMessageOfTheDay, UpdateStages.WithVnetSubnetID, UpdateStages.WithPodSubnetID, + UpdateStages.WithPodIPAllocationMode, UpdateStages.WithMaxPods, UpdateStages.WithOsType, UpdateStages.WithOsSKU, + UpdateStages.WithMaxCount, UpdateStages.WithMinCount, UpdateStages.WithEnableAutoScaling, + UpdateStages.WithScaleDownMode, UpdateStages.WithTypePropertiesType, UpdateStages.WithMode, + UpdateStages.WithOrchestratorVersion, UpdateStages.WithUpgradeSettings, UpdateStages.WithPowerState, + UpdateStages.WithAvailabilityZones, UpdateStages.WithEnableNodePublicIP, UpdateStages.WithNodePublicIPPrefixID, + UpdateStages.WithScaleSetPriority, UpdateStages.WithScaleSetEvictionPolicy, UpdateStages.WithSpotMaxPrice, + UpdateStages.WithNodeLabels, UpdateStages.WithNodeTaints, UpdateStages.WithProximityPlacementGroupID, + UpdateStages.WithKubeletConfig, UpdateStages.WithLinuxOSConfig, UpdateStages.WithEnableEncryptionAtHost, + UpdateStages.WithEnableUltraSSD, UpdateStages.WithEnableFIPS, UpdateStages.WithGpuInstanceProfile, + UpdateStages.WithCreationData, UpdateStages.WithCapacityReservationGroupID, UpdateStages.WithHostGroupID, + UpdateStages.WithNetworkProfile, UpdateStages.WithWindowsProfile, UpdateStages.WithSecurityProfile, + UpdateStages.WithGpuProfile, UpdateStages.WithGatewayProfile, UpdateStages.WithVirtualMachinesProfile, + UpdateStages.WithVirtualMachineNodesStatus, UpdateStages.WithStatus, UpdateStages.WithLocalDNSProfile, + UpdateStages.WithIfMatch, UpdateStages.WithIfNoneMatch { + /** + * Executes the update request. + * + * @return the updated resource. + */ + AgentPool apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + AgentPool apply(Context context); + } + + /** + * The AgentPool update stages. + */ + interface UpdateStages { + /** + * The stage of the AgentPool update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: The tags to be persisted on the agent pool virtual machine scale set.. + * + * @param tags The tags to be persisted on the agent pool virtual machine scale set. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + + /** + * The stage of the AgentPool update allowing to specify count. + */ + interface WithCount { + /** + * Specifies the count property: 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.. + * + * @param count 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. + * @return the next definition stage. + */ + Update withCount(Integer count); + } + + /** + * The stage of the AgentPool update allowing to specify vmSize. + */ + interface WithVmSize { + /** + * Specifies the vmSize property: The size of the agent pool VMs. 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. + * + * @param vmSize The size of the agent pool VMs. 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. + * @return the next definition stage. + */ + Update withVmSize(String vmSize); + } + + /** + * The stage of the AgentPool update allowing to specify osDiskSizeGB. + */ + interface WithOsDiskSizeGB { + /** + * Specifies the osDiskSizeGB property: 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.. + * + * @param osDiskSizeGB 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. + * @return the next definition stage. + */ + Update withOsDiskSizeGB(Integer osDiskSizeGB); + } + + /** + * The stage of the AgentPool update allowing to specify osDiskType. + */ + interface WithOsDiskType { + /** + * Specifies the osDiskType property: The OS disk type to be used for machines in the agent pool. 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).. + * + * @param osDiskType The OS disk type to be used for machines in the agent pool. 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). + * @return the next definition stage. + */ + Update withOsDiskType(OSDiskType osDiskType); + } + + /** + * The stage of the AgentPool update allowing to specify kubeletDiskType. + */ + interface WithKubeletDiskType { + /** + * Specifies the kubeletDiskType property: Determines the placement of emptyDir volumes, container runtime + * data root, and Kubelet ephemeral storage.. + * + * @param kubeletDiskType Determines the placement of emptyDir volumes, container runtime data root, and + * Kubelet ephemeral storage. + * @return the next definition stage. + */ + Update withKubeletDiskType(KubeletDiskType kubeletDiskType); + } + + /** + * The stage of the AgentPool update allowing to specify workloadRuntime. + */ + interface WithWorkloadRuntime { + /** + * Specifies the workloadRuntime property: Determines the type of workload a node can run.. + * + * @param workloadRuntime Determines the type of workload a node can run. + * @return the next definition stage. + */ + Update withWorkloadRuntime(WorkloadRuntime workloadRuntime); + } + + /** + * The stage of the AgentPool update allowing to specify messageOfTheDay. + */ + interface WithMessageOfTheDay { + /** + * Specifies the messageOfTheDay property: Message of the day for Linux nodes, base64-encoded. A + * base64-encoded string which will be written to /etc/motd after decoding. This allows customization of the + * message of the day for Linux nodes. It must not be specified for Windows nodes. It must be a static + * string (i.e., will be printed raw and not be executed as a script).. + * + * @param messageOfTheDay Message of the day for Linux nodes, base64-encoded. A base64-encoded string which + * will be written to /etc/motd after decoding. This allows customization of the message of the day for + * Linux nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be + * printed raw and not be executed as a script). + * @return the next definition stage. + */ + Update withMessageOfTheDay(String messageOfTheDay); + } + + /** + * The stage of the AgentPool update allowing to specify vnetSubnetID. + */ + interface WithVnetSubnetID { + /** + * Specifies the vnetSubnetID property: The ID of the subnet which agent pool nodes and optionally pods will + * join on startup. 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}. + * + * @param vnetSubnetID The ID of the subnet which agent pool nodes and optionally pods will join on startup. + * 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}. + * @return the next definition stage. + */ + Update withVnetSubnetID(String vnetSubnetID); + } + + /** + * The stage of the AgentPool update allowing to specify podSubnetID. + */ + interface WithPodSubnetID { + /** + * Specifies the podSubnetID property: The ID of the subnet which pods will join when launched. 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}. + * + * @param podSubnetID The ID of the subnet which pods will join when launched. 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}. + * @return the next definition stage. + */ + Update withPodSubnetID(String podSubnetID); + } + + /** + * The stage of the AgentPool update allowing to specify podIPAllocationMode. + */ + interface WithPodIPAllocationMode { + /** + * Specifies the podIPAllocationMode property: Pod IP Allocation Mode. The IP allocation mode for pods in + * the agent pool. Must be used with podSubnetId. The default is 'DynamicIndividual'.. + * + * @param podIPAllocationMode Pod IP Allocation Mode. The IP allocation mode for pods in the agent pool. + * Must be used with podSubnetId. The default is 'DynamicIndividual'. + * @return the next definition stage. + */ + Update withPodIPAllocationMode(PodIPAllocationMode podIPAllocationMode); + } + + /** + * The stage of the AgentPool update allowing to specify maxPods. + */ + interface WithMaxPods { + /** + * Specifies the maxPods property: The maximum number of pods that can run on a node.. + * + * @param maxPods The maximum number of pods that can run on a node. + * @return the next definition stage. + */ + Update withMaxPods(Integer maxPods); + } + + /** + * The stage of the AgentPool update allowing to specify osType. + */ + interface WithOsType { + /** + * Specifies the osType property: The operating system type. The default is Linux.. + * + * @param osType The operating system type. The default is Linux. + * @return the next definition stage. + */ + Update withOsType(OSType osType); + } + + /** + * The stage of the AgentPool update allowing to specify osSKU. + */ + interface WithOsSKU { + /** + * Specifies the osSKU property: 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.. + * + * @param osSKU 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. + * @return the next definition stage. + */ + Update withOsSKU(OSSKU osSKU); + } + + /** + * The stage of the AgentPool update allowing to specify maxCount. + */ + interface WithMaxCount { + /** + * Specifies the maxCount property: The maximum number of nodes for auto-scaling. + * + * @param maxCount The maximum number of nodes for auto-scaling. + * @return the next definition stage. + */ + Update withMaxCount(Integer maxCount); + } + + /** + * The stage of the AgentPool update allowing to specify minCount. + */ + interface WithMinCount { + /** + * Specifies the minCount property: The minimum number of nodes for auto-scaling. + * + * @param minCount The minimum number of nodes for auto-scaling. + * @return the next definition stage. + */ + Update withMinCount(Integer minCount); + } + + /** + * The stage of the AgentPool update allowing to specify enableAutoScaling. + */ + interface WithEnableAutoScaling { + /** + * Specifies the enableAutoScaling property: Whether to enable auto-scaler. + * + * @param enableAutoScaling Whether to enable auto-scaler. + * @return the next definition stage. + */ + Update withEnableAutoScaling(Boolean enableAutoScaling); + } + + /** + * The stage of the AgentPool update allowing to specify scaleDownMode. + */ + interface WithScaleDownMode { + /** + * Specifies the scaleDownMode property: The scale down mode to use when scaling the Agent Pool. This also + * effects the cluster autoscaler behavior. If not specified, it defaults to Delete.. + * + * @param scaleDownMode The scale down mode to use when scaling the Agent Pool. This also effects the + * cluster autoscaler behavior. If not specified, it defaults to Delete. + * @return the next definition stage. + */ + Update withScaleDownMode(ScaleDownMode scaleDownMode); + } + + /** + * The stage of the AgentPool update allowing to specify typePropertiesType. + */ + interface WithTypePropertiesType { + /** + * Specifies the typePropertiesType property: The type of Agent Pool.. + * + * @param typePropertiesType The type of Agent Pool. + * @return the next definition stage. + */ + Update withTypePropertiesType(AgentPoolType typePropertiesType); + } + + /** + * The stage of the AgentPool update allowing to specify mode. + */ + interface WithMode { + /** + * Specifies the mode property: The mode of an 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. + * + * @param mode The mode of an 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. + * @return the next definition stage. + */ + Update withMode(AgentPoolMode mode); + } + + /** + * The stage of the AgentPool update allowing to specify orchestratorVersion. + */ + interface WithOrchestratorVersion { + /** + * Specifies the orchestratorVersion property: The version of Kubernetes specified by the user. 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).. + * + * @param orchestratorVersion The version of Kubernetes specified by the user. 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). + * @return the next definition stage. + */ + Update withOrchestratorVersion(String orchestratorVersion); + } + + /** + * The stage of the AgentPool update allowing to specify upgradeSettings. + */ + interface WithUpgradeSettings { + /** + * Specifies the upgradeSettings property: Settings for upgrading the agentpool. + * + * @param upgradeSettings Settings for upgrading the agentpool. + * @return the next definition stage. + */ + Update withUpgradeSettings(AgentPoolUpgradeSettings upgradeSettings); + } + + /** + * The stage of the AgentPool update allowing to specify powerState. + */ + interface WithPowerState { + /** + * Specifies the powerState property: Whether the Agent Pool is running or stopped. 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. + * + * @param powerState Whether the Agent Pool is running or stopped. 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. + * @return the next definition stage. + */ + Update withPowerState(PowerState powerState); + } + + /** + * The stage of the AgentPool update allowing to specify availabilityZones. + */ + interface WithAvailabilityZones { + /** + * Specifies the availabilityZones property: The list of Availability zones to use for nodes. This can only + * be specified if the AgentPoolType property is 'VirtualMachineScaleSets'.. + * + * @param availabilityZones The list of Availability zones to use for nodes. This can only be specified if + * the AgentPoolType property is 'VirtualMachineScaleSets'. + * @return the next definition stage. + */ + Update withAvailabilityZones(List availabilityZones); + } + + /** + * The stage of the AgentPool update allowing to specify enableNodePublicIP. + */ + interface WithEnableNodePublicIP { + /** + * Specifies the enableNodePublicIP property: Whether each node is allocated its own public IP. 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.. + * + * @param enableNodePublicIP Whether each node is allocated its own public IP. 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. + * @return the next definition stage. + */ + Update withEnableNodePublicIP(Boolean enableNodePublicIP); + } + + /** + * The stage of the AgentPool update allowing to specify nodePublicIPPrefixID. + */ + interface WithNodePublicIPPrefixID { + /** + * Specifies the nodePublicIPPrefixID property: The public IP prefix ID which VM nodes should use IPs from. + * This is of the form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + * + * @param nodePublicIPPrefixID The public IP prefix ID which VM nodes should use IPs from. This is of the + * form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + * @return the next definition stage. + */ + Update withNodePublicIPPrefixID(String nodePublicIPPrefixID); + } + + /** + * The stage of the AgentPool update allowing to specify scaleSetPriority. + */ + interface WithScaleSetPriority { + /** + * Specifies the scaleSetPriority property: The Virtual Machine Scale Set priority.. + * + * @param scaleSetPriority The Virtual Machine Scale Set priority. + * @return the next definition stage. + */ + Update withScaleSetPriority(ScaleSetPriority scaleSetPriority); + } + + /** + * The stage of the AgentPool update allowing to specify scaleSetEvictionPolicy. + */ + interface WithScaleSetEvictionPolicy { + /** + * Specifies the scaleSetEvictionPolicy property: The Virtual Machine Scale Set eviction policy. 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). + * + * @param scaleSetEvictionPolicy The Virtual Machine Scale Set eviction policy. 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). + * @return the next definition stage. + */ + Update withScaleSetEvictionPolicy(ScaleSetEvictionPolicy scaleSetEvictionPolicy); + } + + /** + * The stage of the AgentPool update allowing to specify spotMaxPrice. + */ + interface WithSpotMaxPrice { + /** + * Specifies the spotMaxPrice property: The max price (in US Dollars) you are willing to pay for spot + * instances. Possible values are any decimal value greater than zero or -1 which indicates default price to + * be up-to on-demand. 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). + * + * @param spotMaxPrice The max price (in US Dollars) you are willing to pay for spot instances. Possible + * values are any decimal value greater than zero or -1 which indicates default price to be up-to on-demand. + * 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). + * @return the next definition stage. + */ + Update withSpotMaxPrice(Double spotMaxPrice); + } + + /** + * The stage of the AgentPool update allowing to specify nodeLabels. + */ + interface WithNodeLabels { + /** + * Specifies the nodeLabels property: The node labels to be persisted across all nodes in agent pool.. + * + * @param nodeLabels The node labels to be persisted across all nodes in agent pool. + * @return the next definition stage. + */ + Update withNodeLabels(Map nodeLabels); + } + + /** + * The stage of the AgentPool update allowing to specify nodeTaints. + */ + interface WithNodeTaints { + /** + * Specifies the nodeTaints property: The taints added to new nodes during node pool create and scale. For + * example, key=value:NoSchedule.. + * + * @param nodeTaints The taints added to new nodes during node pool create and scale. For example, + * key=value:NoSchedule. + * @return the next definition stage. + */ + Update withNodeTaints(List nodeTaints); + } + + /** + * The stage of the AgentPool update allowing to specify proximityPlacementGroupID. + */ + interface WithProximityPlacementGroupID { + /** + * Specifies the proximityPlacementGroupID property: The ID for Proximity Placement Group.. + * + * @param proximityPlacementGroupID The ID for Proximity Placement Group. + * @return the next definition stage. + */ + Update withProximityPlacementGroupID(String proximityPlacementGroupID); + } + + /** + * The stage of the AgentPool update allowing to specify kubeletConfig. + */ + interface WithKubeletConfig { + /** + * Specifies the kubeletConfig property: The Kubelet configuration on the agent pool nodes.. + * + * @param kubeletConfig The Kubelet configuration on the agent pool nodes. + * @return the next definition stage. + */ + Update withKubeletConfig(KubeletConfig kubeletConfig); + } + + /** + * The stage of the AgentPool update allowing to specify linuxOSConfig. + */ + interface WithLinuxOSConfig { + /** + * Specifies the linuxOSConfig property: The OS configuration of Linux agent nodes.. + * + * @param linuxOSConfig The OS configuration of Linux agent nodes. + * @return the next definition stage. + */ + Update withLinuxOSConfig(LinuxOSConfig linuxOSConfig); + } + + /** + * The stage of the AgentPool update allowing to specify enableEncryptionAtHost. + */ + interface WithEnableEncryptionAtHost { + /** + * Specifies the enableEncryptionAtHost property: Whether to enable host based OS and data drive encryption. + * 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. + * + * @param enableEncryptionAtHost Whether to enable host based OS and data drive encryption. 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. + * @return the next definition stage. + */ + Update withEnableEncryptionAtHost(Boolean enableEncryptionAtHost); + } + + /** + * The stage of the AgentPool update allowing to specify enableUltraSSD. + */ + interface WithEnableUltraSSD { + /** + * Specifies the enableUltraSSD property: Whether to enable UltraSSD. + * + * @param enableUltraSSD Whether to enable UltraSSD. + * @return the next definition stage. + */ + Update withEnableUltraSSD(Boolean enableUltraSSD); + } + + /** + * The stage of the AgentPool update allowing to specify enableFIPS. + */ + interface WithEnableFIPS { + /** + * Specifies the enableFIPS property: Whether to use a FIPS-enabled OS. 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.. + * + * @param enableFIPS Whether to use a FIPS-enabled OS. 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. + * @return the next definition stage. + */ + Update withEnableFIPS(Boolean enableFIPS); + } + + /** + * The stage of the AgentPool update allowing to specify gpuInstanceProfile. + */ + interface WithGpuInstanceProfile { + /** + * Specifies the gpuInstanceProfile property: GPUInstanceProfile to be used to specify GPU MIG instance + * profile for supported GPU VM SKU.. + * + * @param gpuInstanceProfile GPUInstanceProfile to be used to specify GPU MIG instance profile for supported + * GPU VM SKU. + * @return the next definition stage. + */ + Update withGpuInstanceProfile(GPUInstanceProfile gpuInstanceProfile); + } + + /** + * The stage of the AgentPool update allowing to specify creationData. + */ + interface WithCreationData { + /** + * Specifies the creationData property: CreationData to be used to specify the source Snapshot ID if the + * node pool will be created/upgraded using a snapshot.. + * + * @param creationData CreationData to be used to specify the source Snapshot ID if the node pool will be + * created/upgraded using a snapshot. + * @return the next definition stage. + */ + Update withCreationData(CreationData creationData); + } + + /** + * The stage of the AgentPool update allowing to specify capacityReservationGroupID. + */ + interface WithCapacityReservationGroupID { + /** + * Specifies the capacityReservationGroupID property: The fully qualified resource ID of the Capacity + * Reservation Group to provide virtual machines from a reserved group of Virtual Machines. This is of the + * form: + * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Compute/capacityreservationgroups/{capacityReservationGroupName}' + * Customers use it to create an agentpool with a specified CRG. For more information see [Capacity + * Reservation](https://learn.microsoft.com/en-us/azure/virtual-machines/capacity-reservation-overview). + * + * @param capacityReservationGroupID The fully qualified resource ID of the Capacity Reservation Group to + * provide virtual machines from a reserved group of Virtual Machines. This is of the form: + * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Compute/capacityreservationgroups/{capacityReservationGroupName}' + * Customers use it to create an agentpool with a specified CRG. For more information see [Capacity + * Reservation](https://learn.microsoft.com/en-us/azure/virtual-machines/capacity-reservation-overview). + * @return the next definition stage. + */ + Update withCapacityReservationGroupID(String capacityReservationGroupID); + } + + /** + * The stage of the AgentPool update allowing to specify hostGroupID. + */ + interface WithHostGroupID { + /** + * Specifies the hostGroupID property: The fully qualified resource ID of the Dedicated Host Group to + * provision virtual machines from, used only in creation scenario and not allowed to changed once 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).. + * + * @param hostGroupID The fully qualified resource ID of the Dedicated Host Group to provision virtual + * machines from, used only in creation scenario and not allowed to changed once 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). + * @return the next definition stage. + */ + Update withHostGroupID(String hostGroupID); + } + + /** + * The stage of the AgentPool update allowing to specify networkProfile. + */ + interface WithNetworkProfile { + /** + * Specifies the networkProfile property: Network-related settings of an agent pool.. + * + * @param networkProfile Network-related settings of an agent pool. + * @return the next definition stage. + */ + Update withNetworkProfile(AgentPoolNetworkProfile networkProfile); + } + + /** + * The stage of the AgentPool update allowing to specify windowsProfile. + */ + interface WithWindowsProfile { + /** + * Specifies the windowsProfile property: The Windows agent pool's specific profile.. + * + * @param windowsProfile The Windows agent pool's specific profile. + * @return the next definition stage. + */ + Update withWindowsProfile(AgentPoolWindowsProfile windowsProfile); + } + + /** + * The stage of the AgentPool update allowing to specify securityProfile. + */ + interface WithSecurityProfile { + /** + * Specifies the securityProfile property: The security settings of an agent pool.. + * + * @param securityProfile The security settings of an agent pool. + * @return the next definition stage. + */ + Update withSecurityProfile(AgentPoolSecurityProfile securityProfile); + } + + /** + * The stage of the AgentPool update allowing to specify gpuProfile. + */ + interface WithGpuProfile { + /** + * Specifies the gpuProfile property: GPU settings for the Agent Pool.. + * + * @param gpuProfile GPU settings for the Agent Pool. + * @return the next definition stage. + */ + Update withGpuProfile(GPUProfile gpuProfile); + } + + /** + * The stage of the AgentPool update allowing to specify gatewayProfile. + */ + interface WithGatewayProfile { + /** + * Specifies the gatewayProfile property: Profile specific to a managed agent pool in Gateway mode. This + * field cannot be set if agent pool mode is not Gateway.. + * + * @param gatewayProfile Profile specific to a managed agent pool in Gateway mode. This field cannot be set + * if agent pool mode is not Gateway. + * @return the next definition stage. + */ + Update withGatewayProfile(AgentPoolGatewayProfile gatewayProfile); + } + + /** + * The stage of the AgentPool update allowing to specify virtualMachinesProfile. + */ + interface WithVirtualMachinesProfile { + /** + * Specifies the virtualMachinesProfile property: Specifications on VirtualMachines agent pool.. + * + * @param virtualMachinesProfile Specifications on VirtualMachines agent pool. + * @return the next definition stage. + */ + Update withVirtualMachinesProfile(VirtualMachinesProfile virtualMachinesProfile); + } + + /** + * The stage of the AgentPool update allowing to specify virtualMachineNodesStatus. + */ + interface WithVirtualMachineNodesStatus { + /** + * Specifies the virtualMachineNodesStatus property: The status of nodes in a VirtualMachines agent pool.. + * + * @param virtualMachineNodesStatus The status of nodes in a VirtualMachines agent pool. + * @return the next definition stage. + */ + Update withVirtualMachineNodesStatus(List virtualMachineNodesStatus); + } + + /** + * The stage of the AgentPool update allowing to specify status. + */ + interface WithStatus { + /** + * Specifies the status property: Contains read-only information about the Agent Pool.. + * + * @param status Contains read-only information about the Agent Pool. + * @return the next definition stage. + */ + Update withStatus(AgentPoolStatus status); + } + + /** + * The stage of the AgentPool update allowing to specify localDNSProfile. + */ + interface WithLocalDNSProfile { + /** + * Specifies the localDNSProfile property: Configures the per-node local DNS, with VnetDNS and KubeDNS + * overrides. LocalDNS helps improve performance and reliability of DNS resolution in an AKS cluster. For + * more details see aka.ms/aks/localdns.. + * + * @param localDNSProfile Configures the per-node local DNS, with VnetDNS and KubeDNS overrides. LocalDNS + * helps improve performance and reliability of DNS resolution in an AKS cluster. For more details see + * aka.ms/aks/localdns. + * @return the next definition stage. + */ + Update withLocalDNSProfile(LocalDNSProfile localDNSProfile); + } + + /** + * The stage of the AgentPool update allowing to specify ifMatch. + */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: The request should only proceed if an entity matches this string.. + * + * @param ifMatch The request should only proceed if an entity matches this string. + * @return the next definition stage. + */ + Update withIfMatch(String ifMatch); + } + + /** + * The stage of the AgentPool update allowing to specify ifNoneMatch. + */ + interface WithIfNoneMatch { + /** + * Specifies the ifNoneMatch property: The request should only proceed if no entity matches this string.. + * + * @param ifNoneMatch The request should only proceed if no entity matches this string. + * @return the next definition stage. + */ + Update withIfNoneMatch(String ifNoneMatch); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + AgentPool refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + AgentPool refresh(Context context); + + /** + * Aborts last operation running on agent pool. + * + * 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. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void abortLatestOperation(); + + /** + * Aborts last operation running on agent pool. + * + * 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. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void abortLatestOperation(Context context); + + /** + * Deletes specific machines in an agent pool. + * + * @param machines A list of machines from the agent pool to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteMachines(AgentPoolDeleteMachinesParameter machines); + + /** + * Deletes specific machines in an agent pool. + * + * @param machines A list of machines from the agent pool to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteMachines(AgentPoolDeleteMachinesParameter machines, Context context); + + /** + * Upgrades the node image version of an agent pool to the latest. + * + * 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. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void upgradeNodeImageVersion(); + + /** + * Upgrades the node image version of an agent pool to the latest. + * + * 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. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void upgradeNodeImageVersion(Context context); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolAvailableVersions.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolAvailableVersions.java new file mode 100644 index 000000000000..e9b5e35decef --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolAvailableVersions.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.AgentPoolAvailableVersionsInner; +import java.util.List; + +/** + * An immutable client-side representation of AgentPoolAvailableVersions. + */ +public interface AgentPoolAvailableVersions { + /** + * Gets the id property: The ID of the agent pool version list. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the agent pool version list. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: Type of the agent pool version list. + * + * @return the type value. + */ + String type(); + + /** + * Gets the agentPoolVersions property: List of versions available for agent pool. + * + * @return the agentPoolVersions value. + */ + List agentPoolVersions(); + + /** + * Gets the inner com.azure.resourcemanager.containerservice.generated.fluent.models.AgentPoolAvailableVersionsInner + * object. + * + * @return the inner object. + */ + AgentPoolAvailableVersionsInner innerModel(); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem.java new file mode 100644 index 000000000000..04d16ead0ca4 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Available version information for an agent pool. + */ +@Immutable +public final class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem + implements JsonSerializable { + /* + * Whether this version is the default agent pool version. + */ + private Boolean defaultProperty; + + /* + * The Kubernetes version (major.minor.patch). + */ + private String kubernetesVersion; + + /* + * Whether Kubernetes version is currently in preview. + */ + private Boolean isPreview; + + /** + * Creates an instance of AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem class. + */ + private AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem() { + } + + /** + * Get the defaultProperty property: Whether this version is the default agent pool version. + * + * @return the defaultProperty value. + */ + public Boolean defaultProperty() { + return this.defaultProperty; + } + + /** + * Get the kubernetesVersion property: The Kubernetes version (major.minor.patch). + * + * @return the kubernetesVersion value. + */ + public String kubernetesVersion() { + return this.kubernetesVersion; + } + + /** + * Get the isPreview property: Whether Kubernetes version is currently in preview. + * + * @return the isPreview value. + */ + public Boolean isPreview() { + return this.isPreview; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("default", this.defaultProperty); + jsonWriter.writeStringField("kubernetesVersion", this.kubernetesVersion); + jsonWriter.writeBooleanField("isPreview", this.isPreview); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem if the JsonReader was pointing + * to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. + */ + public static AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem deserializedAgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem + = new AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("default".equals(fieldName)) { + deserializedAgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem.defaultProperty + = reader.getNullable(JsonReader::getBoolean); + } else if ("kubernetesVersion".equals(fieldName)) { + deserializedAgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem.kubernetesVersion + = reader.getString(); + } else if ("isPreview".equals(fieldName)) { + deserializedAgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem.isPreview + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedAgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolDeleteMachinesParameter.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolDeleteMachinesParameter.java new file mode 100644 index 000000000000..f46de3b0a13c --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolDeleteMachinesParameter.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Specifies a list of machine names from the agent pool to be deleted. + */ +@Fluent +public final class AgentPoolDeleteMachinesParameter implements JsonSerializable { + /* + * The agent pool machine names. + */ + private List machineNames; + + /** + * Creates an instance of AgentPoolDeleteMachinesParameter class. + */ + public AgentPoolDeleteMachinesParameter() { + } + + /** + * Get the machineNames property: The agent pool machine names. + * + * @return the machineNames value. + */ + public List machineNames() { + return this.machineNames; + } + + /** + * Set the machineNames property: The agent pool machine names. + * + * @param machineNames the machineNames value to set. + * @return the AgentPoolDeleteMachinesParameter object itself. + */ + public AgentPoolDeleteMachinesParameter withMachineNames(List machineNames) { + this.machineNames = machineNames; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("machineNames", this.machineNames, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AgentPoolDeleteMachinesParameter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AgentPoolDeleteMachinesParameter if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AgentPoolDeleteMachinesParameter. + */ + public static AgentPoolDeleteMachinesParameter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AgentPoolDeleteMachinesParameter deserializedAgentPoolDeleteMachinesParameter + = new AgentPoolDeleteMachinesParameter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("machineNames".equals(fieldName)) { + List machineNames = reader.readArray(reader1 -> reader1.getString()); + deserializedAgentPoolDeleteMachinesParameter.machineNames = machineNames; + } else { + reader.skipChildren(); + } + } + + return deserializedAgentPoolDeleteMachinesParameter; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolGatewayProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolGatewayProfile.java new file mode 100644 index 000000000000..716f698153f9 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolGatewayProfile.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Profile of the managed cluster gateway agent pool. + */ +@Fluent +public final class AgentPoolGatewayProfile implements JsonSerializable { + /* + * The Gateway agent pool associates one public IPPrefix for each static egress gateway to provide public egress. + * The size of Public IPPrefix should be selected by the user. Each node in the agent pool is assigned with one IP + * from the IPPrefix. The IPPrefix size thus serves as a cap on the size of the Gateway agent pool. Due to Azure + * public IPPrefix size limitation, the valid value range is [28, 31] (/31 = 2 nodes/IPs, /30 = 4 nodes/IPs, /29 = 8 + * nodes/IPs, /28 = 16 nodes/IPs). The default value is 31. + */ + private Integer publicIPPrefixSize; + + /** + * Creates an instance of AgentPoolGatewayProfile class. + */ + public AgentPoolGatewayProfile() { + } + + /** + * Get the publicIPPrefixSize property: The Gateway agent pool associates one public IPPrefix for each static egress + * gateway to provide public egress. The size of Public IPPrefix should be selected by the user. Each node in the + * agent pool is assigned with one IP from the IPPrefix. The IPPrefix size thus serves as a cap on the size of the + * Gateway agent pool. Due to Azure public IPPrefix size limitation, the valid value range is [28, 31] (/31 = 2 + * nodes/IPs, /30 = 4 nodes/IPs, /29 = 8 nodes/IPs, /28 = 16 nodes/IPs). The default value is 31. + * + * @return the publicIPPrefixSize value. + */ + public Integer publicIPPrefixSize() { + return this.publicIPPrefixSize; + } + + /** + * Set the publicIPPrefixSize property: The Gateway agent pool associates one public IPPrefix for each static egress + * gateway to provide public egress. The size of Public IPPrefix should be selected by the user. Each node in the + * agent pool is assigned with one IP from the IPPrefix. The IPPrefix size thus serves as a cap on the size of the + * Gateway agent pool. Due to Azure public IPPrefix size limitation, the valid value range is [28, 31] (/31 = 2 + * nodes/IPs, /30 = 4 nodes/IPs, /29 = 8 nodes/IPs, /28 = 16 nodes/IPs). The default value is 31. + * + * @param publicIPPrefixSize the publicIPPrefixSize value to set. + * @return the AgentPoolGatewayProfile object itself. + */ + public AgentPoolGatewayProfile withPublicIPPrefixSize(Integer publicIPPrefixSize) { + this.publicIPPrefixSize = publicIPPrefixSize; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("publicIPPrefixSize", this.publicIPPrefixSize); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AgentPoolGatewayProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AgentPoolGatewayProfile if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AgentPoolGatewayProfile. + */ + public static AgentPoolGatewayProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AgentPoolGatewayProfile deserializedAgentPoolGatewayProfile = new AgentPoolGatewayProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("publicIPPrefixSize".equals(fieldName)) { + deserializedAgentPoolGatewayProfile.publicIPPrefixSize = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedAgentPoolGatewayProfile; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolMode.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolMode.java new file mode 100644 index 000000000000..1eb3db537c1a --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolMode.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The mode of an 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. + */ +public final class AgentPoolMode extends ExpandableStringEnum { + /** + * 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 final AgentPoolMode SYSTEM = fromString("System"); + + /** + * User agent pools are primarily for hosting your application pods. + */ + public static final AgentPoolMode USER = fromString("User"); + + /** + * Gateway agent pools are dedicated to providing static egress IPs to pods. For more details, see + * https://aka.ms/aks/static-egress-gateway. + */ + public static final AgentPoolMode GATEWAY = fromString("Gateway"); + + /** + * Creates a new instance of AgentPoolMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AgentPoolMode() { + } + + /** + * Creates or finds a AgentPoolMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding AgentPoolMode. + */ + public static AgentPoolMode fromString(String name) { + return fromString(name, AgentPoolMode.class); + } + + /** + * Gets known AgentPoolMode values. + * + * @return known AgentPoolMode values. + */ + public static Collection values() { + return values(AgentPoolMode.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolNetworkProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolNetworkProfile.java new file mode 100644 index 000000000000..e61d9828383b --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolNetworkProfile.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Network settings of an agent pool. + */ +@Fluent +public final class AgentPoolNetworkProfile implements JsonSerializable { + /* + * IPTags of instance-level public IPs. + */ + private List nodePublicIPTags; + + /* + * The port ranges that are allowed to access. The specified ranges are allowed to overlap. + */ + private List allowedHostPorts; + + /* + * The IDs of the application security groups which agent pool will associate when created. + */ + private List applicationSecurityGroups; + + /** + * Creates an instance of AgentPoolNetworkProfile class. + */ + public AgentPoolNetworkProfile() { + } + + /** + * Get the nodePublicIPTags property: IPTags of instance-level public IPs. + * + * @return the nodePublicIPTags value. + */ + public List nodePublicIPTags() { + return this.nodePublicIPTags; + } + + /** + * Set the nodePublicIPTags property: IPTags of instance-level public IPs. + * + * @param nodePublicIPTags the nodePublicIPTags value to set. + * @return the AgentPoolNetworkProfile object itself. + */ + public AgentPoolNetworkProfile withNodePublicIPTags(List nodePublicIPTags) { + this.nodePublicIPTags = nodePublicIPTags; + return this; + } + + /** + * Get the allowedHostPorts property: The port ranges that are allowed to access. The specified ranges are allowed + * to overlap. + * + * @return the allowedHostPorts value. + */ + public List allowedHostPorts() { + return this.allowedHostPorts; + } + + /** + * Set the allowedHostPorts property: The port ranges that are allowed to access. The specified ranges are allowed + * to overlap. + * + * @param allowedHostPorts the allowedHostPorts value to set. + * @return the AgentPoolNetworkProfile object itself. + */ + public AgentPoolNetworkProfile withAllowedHostPorts(List allowedHostPorts) { + this.allowedHostPorts = allowedHostPorts; + return this; + } + + /** + * Get the applicationSecurityGroups property: The IDs of the application security groups which agent pool will + * associate when created. + * + * @return the applicationSecurityGroups value. + */ + public List applicationSecurityGroups() { + return this.applicationSecurityGroups; + } + + /** + * Set the applicationSecurityGroups property: The IDs of the application security groups which agent pool will + * associate when created. + * + * @param applicationSecurityGroups the applicationSecurityGroups value to set. + * @return the AgentPoolNetworkProfile object itself. + */ + public AgentPoolNetworkProfile withApplicationSecurityGroups(List applicationSecurityGroups) { + this.applicationSecurityGroups = applicationSecurityGroups; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("nodePublicIPTags", this.nodePublicIPTags, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("allowedHostPorts", this.allowedHostPorts, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("applicationSecurityGroups", this.applicationSecurityGroups, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AgentPoolNetworkProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AgentPoolNetworkProfile if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AgentPoolNetworkProfile. + */ + public static AgentPoolNetworkProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AgentPoolNetworkProfile deserializedAgentPoolNetworkProfile = new AgentPoolNetworkProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nodePublicIPTags".equals(fieldName)) { + List nodePublicIPTags = reader.readArray(reader1 -> IPTag.fromJson(reader1)); + deserializedAgentPoolNetworkProfile.nodePublicIPTags = nodePublicIPTags; + } else if ("allowedHostPorts".equals(fieldName)) { + List allowedHostPorts = reader.readArray(reader1 -> PortRange.fromJson(reader1)); + deserializedAgentPoolNetworkProfile.allowedHostPorts = allowedHostPorts; + } else if ("applicationSecurityGroups".equals(fieldName)) { + List applicationSecurityGroups = reader.readArray(reader1 -> reader1.getString()); + deserializedAgentPoolNetworkProfile.applicationSecurityGroups = applicationSecurityGroups; + } else { + reader.skipChildren(); + } + } + + return deserializedAgentPoolNetworkProfile; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolSSHAccess.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolSSHAccess.java new file mode 100644 index 000000000000..90c6fd753316 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolSSHAccess.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * SSH access method of an agent pool. + */ +public final class AgentPoolSSHAccess extends ExpandableStringEnum { + /** + * Can SSH onto the node as a local user using private key. + */ + public static final AgentPoolSSHAccess LOCAL_USER = fromString("LocalUser"); + + /** + * SSH service will be turned off on the node. + */ + public static final AgentPoolSSHAccess DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of AgentPoolSSHAccess value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AgentPoolSSHAccess() { + } + + /** + * Creates or finds a AgentPoolSSHAccess from its string representation. + * + * @param name a name to look for. + * @return the corresponding AgentPoolSSHAccess. + */ + public static AgentPoolSSHAccess fromString(String name) { + return fromString(name, AgentPoolSSHAccess.class); + } + + /** + * Gets known AgentPoolSSHAccess values. + * + * @return known AgentPoolSSHAccess values. + */ + public static Collection values() { + return values(AgentPoolSSHAccess.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolSecurityProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolSecurityProfile.java new file mode 100644 index 000000000000..96b6f36f8b14 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolSecurityProfile.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The security settings of an agent pool. + */ +@Fluent +public final class AgentPoolSecurityProfile implements JsonSerializable { + /* + * vTPM is a Trusted Launch feature for configuring a dedicated secure vault for keys and measurements held locally + * on the node. For more details, see aka.ms/aks/trustedlaunch. If not specified, the default is false. + */ + private Boolean enableVTPM; + + /* + * Secure Boot is a feature of Trusted Launch which ensures that only signed operating systems and drivers can boot. + * For more details, see aka.ms/aks/trustedlaunch. If not specified, the default is false. + */ + private Boolean enableSecureBoot; + + /* + * SSH access method of an agent pool. + */ + private AgentPoolSSHAccess sshAccess; + + /** + * Creates an instance of AgentPoolSecurityProfile class. + */ + public AgentPoolSecurityProfile() { + } + + /** + * Get the enableVTPM property: vTPM is a Trusted Launch feature for configuring a dedicated secure vault for keys + * and measurements held locally on the node. For more details, see aka.ms/aks/trustedlaunch. If not specified, the + * default is false. + * + * @return the enableVTPM value. + */ + public Boolean enableVTPM() { + return this.enableVTPM; + } + + /** + * Set the enableVTPM property: vTPM is a Trusted Launch feature for configuring a dedicated secure vault for keys + * and measurements held locally on the node. For more details, see aka.ms/aks/trustedlaunch. If not specified, the + * default is false. + * + * @param enableVTPM the enableVTPM value to set. + * @return the AgentPoolSecurityProfile object itself. + */ + public AgentPoolSecurityProfile withEnableVTPM(Boolean enableVTPM) { + this.enableVTPM = enableVTPM; + return this; + } + + /** + * Get the enableSecureBoot property: Secure Boot is a feature of Trusted Launch which ensures that only signed + * operating systems and drivers can boot. For more details, see aka.ms/aks/trustedlaunch. If not specified, the + * default is false. + * + * @return the enableSecureBoot value. + */ + public Boolean enableSecureBoot() { + return this.enableSecureBoot; + } + + /** + * Set the enableSecureBoot property: Secure Boot is a feature of Trusted Launch which ensures that only signed + * operating systems and drivers can boot. For more details, see aka.ms/aks/trustedlaunch. If not specified, the + * default is false. + * + * @param enableSecureBoot the enableSecureBoot value to set. + * @return the AgentPoolSecurityProfile object itself. + */ + public AgentPoolSecurityProfile withEnableSecureBoot(Boolean enableSecureBoot) { + this.enableSecureBoot = enableSecureBoot; + return this; + } + + /** + * Get the sshAccess property: SSH access method of an agent pool. + * + * @return the sshAccess value. + */ + public AgentPoolSSHAccess sshAccess() { + return this.sshAccess; + } + + /** + * Set the sshAccess property: SSH access method of an agent pool. + * + * @param sshAccess the sshAccess value to set. + * @return the AgentPoolSecurityProfile object itself. + */ + public AgentPoolSecurityProfile withSshAccess(AgentPoolSSHAccess sshAccess) { + this.sshAccess = sshAccess; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enableVTPM", this.enableVTPM); + jsonWriter.writeBooleanField("enableSecureBoot", this.enableSecureBoot); + jsonWriter.writeStringField("sshAccess", this.sshAccess == null ? null : this.sshAccess.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AgentPoolSecurityProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AgentPoolSecurityProfile if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AgentPoolSecurityProfile. + */ + public static AgentPoolSecurityProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AgentPoolSecurityProfile deserializedAgentPoolSecurityProfile = new AgentPoolSecurityProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enableVTPM".equals(fieldName)) { + deserializedAgentPoolSecurityProfile.enableVTPM = reader.getNullable(JsonReader::getBoolean); + } else if ("enableSecureBoot".equals(fieldName)) { + deserializedAgentPoolSecurityProfile.enableSecureBoot = reader.getNullable(JsonReader::getBoolean); + } else if ("sshAccess".equals(fieldName)) { + deserializedAgentPoolSecurityProfile.sshAccess = AgentPoolSSHAccess.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAgentPoolSecurityProfile; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolStatus.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolStatus.java new file mode 100644 index 000000000000..9c751ad720e6 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolStatus.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.exception.ManagementError; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Contains read-only information about the Agent Pool. + */ +@Immutable +public final class AgentPoolStatus implements JsonSerializable { + /* + * The error detail information of the agent pool. Preserves the detailed info of failure. If there was no error, + * this field is omitted. + */ + private ManagementError provisioningError; + + /** + * Creates an instance of AgentPoolStatus class. + */ + public AgentPoolStatus() { + } + + /** + * Get the provisioningError property: The error detail information of the agent pool. Preserves the detailed info + * of failure. If there was no error, this field is omitted. + * + * @return the provisioningError value. + */ + public ManagementError provisioningError() { + return this.provisioningError; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AgentPoolStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AgentPoolStatus if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AgentPoolStatus. + */ + public static AgentPoolStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AgentPoolStatus deserializedAgentPoolStatus = new AgentPoolStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningError".equals(fieldName)) { + deserializedAgentPoolStatus.provisioningError = ManagementError.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAgentPoolStatus; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolType.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolType.java new file mode 100644 index 000000000000..f7c40893f660 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The type of Agent Pool. + */ +public final class AgentPoolType extends ExpandableStringEnum { + /** + * Create an Agent Pool backed by a Virtual Machine Scale Set. + */ + public static final AgentPoolType VIRTUAL_MACHINE_SCALE_SETS = fromString("VirtualMachineScaleSets"); + + /** + * Use of this is strongly discouraged. + */ + public static final AgentPoolType AVAILABILITY_SET = fromString("AvailabilitySet"); + + /** + * Create an Agent Pool backed by a Single Instance VM orchestration mode. + */ + public static final AgentPoolType VIRTUAL_MACHINES = fromString("VirtualMachines"); + + /** + * Creates a new instance of AgentPoolType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AgentPoolType() { + } + + /** + * Creates or finds a AgentPoolType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AgentPoolType. + */ + public static AgentPoolType fromString(String name) { + return fromString(name, AgentPoolType.class); + } + + /** + * Gets known AgentPoolType values. + * + * @return known AgentPoolType values. + */ + public static Collection values() { + return values(AgentPoolType.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolUpgradeProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolUpgradeProfile.java new file mode 100644 index 000000000000..c17dafa76d53 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolUpgradeProfile.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.containerservice.generated.fluent.models.AgentPoolUpgradeProfileInner; +import java.util.List; + +/** + * An immutable client-side representation of AgentPoolUpgradeProfile. + */ +public interface AgentPoolUpgradeProfile { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the kubernetesVersion property: The Kubernetes version (major.minor.patch). + * + * @return the kubernetesVersion value. + */ + String kubernetesVersion(); + + /** + * Gets the osType property: The operating system type. The default is Linux. + * + * @return the osType value. + */ + OSType osType(); + + /** + * Gets the upgrades property: List of orchestrator types and versions available for upgrade. + * + * @return the upgrades value. + */ + List upgrades(); + + /** + * Gets the latestNodeImageVersion property: The latest AKS supported node image version. + * + * @return the latestNodeImageVersion value. + */ + String latestNodeImageVersion(); + + /** + * Gets the inner com.azure.resourcemanager.containerservice.generated.fluent.models.AgentPoolUpgradeProfileInner + * object. + * + * @return the inner object. + */ + AgentPoolUpgradeProfileInner innerModel(); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolUpgradeProfilePropertiesUpgradesItem.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolUpgradeProfilePropertiesUpgradesItem.java new file mode 100644 index 000000000000..2dee6607e02a --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolUpgradeProfilePropertiesUpgradesItem.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Available upgrades for an AgentPool. + */ +@Immutable +public final class AgentPoolUpgradeProfilePropertiesUpgradesItem + implements JsonSerializable { + /* + * The Kubernetes version (major.minor.patch). + */ + private String kubernetesVersion; + + /* + * Whether the Kubernetes version is currently in preview. + */ + private Boolean isPreview; + + /** + * Creates an instance of AgentPoolUpgradeProfilePropertiesUpgradesItem class. + */ + private AgentPoolUpgradeProfilePropertiesUpgradesItem() { + } + + /** + * Get the kubernetesVersion property: The Kubernetes version (major.minor.patch). + * + * @return the kubernetesVersion value. + */ + public String kubernetesVersion() { + return this.kubernetesVersion; + } + + /** + * Get the isPreview property: Whether the Kubernetes version is currently in preview. + * + * @return the isPreview value. + */ + public Boolean isPreview() { + return this.isPreview; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kubernetesVersion", this.kubernetesVersion); + jsonWriter.writeBooleanField("isPreview", this.isPreview); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AgentPoolUpgradeProfilePropertiesUpgradesItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AgentPoolUpgradeProfilePropertiesUpgradesItem if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AgentPoolUpgradeProfilePropertiesUpgradesItem. + */ + public static AgentPoolUpgradeProfilePropertiesUpgradesItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AgentPoolUpgradeProfilePropertiesUpgradesItem deserializedAgentPoolUpgradeProfilePropertiesUpgradesItem + = new AgentPoolUpgradeProfilePropertiesUpgradesItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kubernetesVersion".equals(fieldName)) { + deserializedAgentPoolUpgradeProfilePropertiesUpgradesItem.kubernetesVersion = reader.getString(); + } else if ("isPreview".equals(fieldName)) { + deserializedAgentPoolUpgradeProfilePropertiesUpgradesItem.isPreview + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedAgentPoolUpgradeProfilePropertiesUpgradesItem; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolUpgradeSettings.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolUpgradeSettings.java new file mode 100644 index 000000000000..d4e3fc486f96 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolUpgradeSettings.java @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Settings for upgrading an agentpool. + */ +@Fluent +public final class AgentPoolUpgradeSettings implements JsonSerializable { + /* + * The maximum number or percentage of nodes that are surged during upgrade. 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 10%. For more information, including best practices, see: + * https://learn.microsoft.com/en-us/azure/aks/upgrade-cluster + */ + private String maxSurge; + + /* + * The maximum number or percentage of nodes that can be simultaneously unavailable during upgrade. This can either + * be set to an integer (e.g. '1') or a percentage (e.g. '5%'). 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 0. For more information, including best practices, see: + * https://learn.microsoft.com/en-us/azure/aks/upgrade-cluster + */ + private String maxUnavailable; + + /* + * The drain timeout for a node. 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. + */ + private Integer drainTimeoutInMinutes; + + /* + * The soak duration for a node. The amount of time (in minutes) to wait after draining a node and before reimaging + * it and moving on to next node. If not specified, the default is 0 minutes. + */ + private Integer nodeSoakDurationInMinutes; + + /* + * Defines the behavior for undrainable nodes during upgrade. The most common cause of undrainable nodes is Pod + * Disruption Budgets (PDBs), but other issues, such as pod termination grace period is exceeding the remaining + * per-node drain timeout or pod is still being in a running state, can also cause undrainable nodes. + */ + private UndrainableNodeBehavior undrainableNodeBehavior; + + /** + * Creates an instance of AgentPoolUpgradeSettings class. + */ + public AgentPoolUpgradeSettings() { + } + + /** + * Get the maxSurge property: The maximum number or percentage of nodes that are surged during upgrade. 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 10%. For more information, including best practices, see: + * https://learn.microsoft.com/en-us/azure/aks/upgrade-cluster. + * + * @return the maxSurge value. + */ + public String maxSurge() { + return this.maxSurge; + } + + /** + * Set the maxSurge property: The maximum number or percentage of nodes that are surged during upgrade. 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 10%. For more information, including best practices, see: + * https://learn.microsoft.com/en-us/azure/aks/upgrade-cluster. + * + * @param maxSurge the maxSurge value to set. + * @return the AgentPoolUpgradeSettings object itself. + */ + public AgentPoolUpgradeSettings withMaxSurge(String maxSurge) { + this.maxSurge = maxSurge; + return this; + } + + /** + * Get the maxUnavailable property: The maximum number or percentage of nodes that can be simultaneously unavailable + * during upgrade. This can either be set to an integer (e.g. '1') or a percentage (e.g. '5%'). 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 0. For more information, including best + * practices, see: https://learn.microsoft.com/en-us/azure/aks/upgrade-cluster. + * + * @return the maxUnavailable value. + */ + public String maxUnavailable() { + return this.maxUnavailable; + } + + /** + * Set the maxUnavailable property: The maximum number or percentage of nodes that can be simultaneously unavailable + * during upgrade. This can either be set to an integer (e.g. '1') or a percentage (e.g. '5%'). 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 0. For more information, including best + * practices, see: https://learn.microsoft.com/en-us/azure/aks/upgrade-cluster. + * + * @param maxUnavailable the maxUnavailable value to set. + * @return the AgentPoolUpgradeSettings object itself. + */ + public AgentPoolUpgradeSettings withMaxUnavailable(String maxUnavailable) { + this.maxUnavailable = maxUnavailable; + return this; + } + + /** + * Get the drainTimeoutInMinutes property: The drain timeout for a node. 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. + * + * @return the drainTimeoutInMinutes value. + */ + public Integer drainTimeoutInMinutes() { + return this.drainTimeoutInMinutes; + } + + /** + * Set the drainTimeoutInMinutes property: The drain timeout for a node. 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. + * + * @param drainTimeoutInMinutes the drainTimeoutInMinutes value to set. + * @return the AgentPoolUpgradeSettings object itself. + */ + public AgentPoolUpgradeSettings withDrainTimeoutInMinutes(Integer drainTimeoutInMinutes) { + this.drainTimeoutInMinutes = drainTimeoutInMinutes; + return this; + } + + /** + * Get the nodeSoakDurationInMinutes property: The soak duration for a node. The amount of time (in minutes) to wait + * after draining a node and before reimaging it and moving on to next node. If not specified, the default is 0 + * minutes. + * + * @return the nodeSoakDurationInMinutes value. + */ + public Integer nodeSoakDurationInMinutes() { + return this.nodeSoakDurationInMinutes; + } + + /** + * Set the nodeSoakDurationInMinutes property: The soak duration for a node. The amount of time (in minutes) to wait + * after draining a node and before reimaging it and moving on to next node. If not specified, the default is 0 + * minutes. + * + * @param nodeSoakDurationInMinutes the nodeSoakDurationInMinutes value to set. + * @return the AgentPoolUpgradeSettings object itself. + */ + public AgentPoolUpgradeSettings withNodeSoakDurationInMinutes(Integer nodeSoakDurationInMinutes) { + this.nodeSoakDurationInMinutes = nodeSoakDurationInMinutes; + return this; + } + + /** + * Get the undrainableNodeBehavior property: Defines the behavior for undrainable nodes during upgrade. The most + * common cause of undrainable nodes is Pod Disruption Budgets (PDBs), but other issues, such as pod termination + * grace period is exceeding the remaining per-node drain timeout or pod is still being in a running state, can also + * cause undrainable nodes. + * + * @return the undrainableNodeBehavior value. + */ + public UndrainableNodeBehavior undrainableNodeBehavior() { + return this.undrainableNodeBehavior; + } + + /** + * Set the undrainableNodeBehavior property: Defines the behavior for undrainable nodes during upgrade. The most + * common cause of undrainable nodes is Pod Disruption Budgets (PDBs), but other issues, such as pod termination + * grace period is exceeding the remaining per-node drain timeout or pod is still being in a running state, can also + * cause undrainable nodes. + * + * @param undrainableNodeBehavior the undrainableNodeBehavior value to set. + * @return the AgentPoolUpgradeSettings object itself. + */ + public AgentPoolUpgradeSettings withUndrainableNodeBehavior(UndrainableNodeBehavior undrainableNodeBehavior) { + this.undrainableNodeBehavior = undrainableNodeBehavior; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("maxSurge", this.maxSurge); + jsonWriter.writeStringField("maxUnavailable", this.maxUnavailable); + jsonWriter.writeNumberField("drainTimeoutInMinutes", this.drainTimeoutInMinutes); + jsonWriter.writeNumberField("nodeSoakDurationInMinutes", this.nodeSoakDurationInMinutes); + jsonWriter.writeStringField("undrainableNodeBehavior", + this.undrainableNodeBehavior == null ? null : this.undrainableNodeBehavior.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AgentPoolUpgradeSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AgentPoolUpgradeSettings if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AgentPoolUpgradeSettings. + */ + public static AgentPoolUpgradeSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AgentPoolUpgradeSettings deserializedAgentPoolUpgradeSettings = new AgentPoolUpgradeSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("maxSurge".equals(fieldName)) { + deserializedAgentPoolUpgradeSettings.maxSurge = reader.getString(); + } else if ("maxUnavailable".equals(fieldName)) { + deserializedAgentPoolUpgradeSettings.maxUnavailable = reader.getString(); + } else if ("drainTimeoutInMinutes".equals(fieldName)) { + deserializedAgentPoolUpgradeSettings.drainTimeoutInMinutes = reader.getNullable(JsonReader::getInt); + } else if ("nodeSoakDurationInMinutes".equals(fieldName)) { + deserializedAgentPoolUpgradeSettings.nodeSoakDurationInMinutes + = reader.getNullable(JsonReader::getInt); + } else if ("undrainableNodeBehavior".equals(fieldName)) { + deserializedAgentPoolUpgradeSettings.undrainableNodeBehavior + = UndrainableNodeBehavior.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAgentPoolUpgradeSettings; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolWindowsProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolWindowsProfile.java new file mode 100644 index 000000000000..83f85316a293 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolWindowsProfile.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The Windows agent pool's specific profile. + */ +@Fluent +public final class AgentPoolWindowsProfile implements JsonSerializable { + /* + * Whether to disable OutboundNAT in windows nodes. The default value is false. Outbound NAT can only be disabled if + * the cluster outboundType is NAT Gateway and the Windows agent pool does not have node public IP enabled. + */ + private Boolean disableOutboundNat; + + /** + * Creates an instance of AgentPoolWindowsProfile class. + */ + public AgentPoolWindowsProfile() { + } + + /** + * Get the disableOutboundNat property: Whether to disable OutboundNAT in windows nodes. The default value is false. + * Outbound NAT can only be disabled if the cluster outboundType is NAT Gateway and the Windows agent pool does not + * have node public IP enabled. + * + * @return the disableOutboundNat value. + */ + public Boolean disableOutboundNat() { + return this.disableOutboundNat; + } + + /** + * Set the disableOutboundNat property: Whether to disable OutboundNAT in windows nodes. The default value is false. + * Outbound NAT can only be disabled if the cluster outboundType is NAT Gateway and the Windows agent pool does not + * have node public IP enabled. + * + * @param disableOutboundNat the disableOutboundNat value to set. + * @return the AgentPoolWindowsProfile object itself. + */ + public AgentPoolWindowsProfile withDisableOutboundNat(Boolean disableOutboundNat) { + this.disableOutboundNat = disableOutboundNat; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("disableOutboundNat", this.disableOutboundNat); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AgentPoolWindowsProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AgentPoolWindowsProfile if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AgentPoolWindowsProfile. + */ + public static AgentPoolWindowsProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AgentPoolWindowsProfile deserializedAgentPoolWindowsProfile = new AgentPoolWindowsProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("disableOutboundNat".equals(fieldName)) { + deserializedAgentPoolWindowsProfile.disableOutboundNat = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedAgentPoolWindowsProfile; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPools.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPools.java new file mode 100644 index 000000000000..bd2709a37c5e --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPools.java @@ -0,0 +1,312 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of AgentPools. + */ +public interface AgentPools { + /** + * Gets the specified managed cluster agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified managed cluster agent pool along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String resourceName, String agentPoolName, + Context context); + + /** + * Gets the specified managed cluster agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified managed cluster agent pool. + */ + AgentPool get(String resourceGroupName, String resourceName, String agentPoolName); + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String resourceName, String agentPoolName); + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param ignorePodDisruptionBudget ignore-pod-disruption-budget=true to delete those pods on a node without + * considering Pod Disruption Budget. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String resourceName, String agentPoolName, Boolean ignorePodDisruptionBudget, + String ifMatch, Context context); + + /** + * Gets a list of agent pools in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of agent pools in the specified managed cluster as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String resourceName); + + /** + * Gets a list of agent pools in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of agent pools in the specified managed cluster as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String resourceName, Context context); + + /** + * Aborts last operation running on agent pool. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void abortLatestOperation(String resourceGroupName, String resourceName, String agentPoolName); + + /** + * Aborts last operation running on agent pool. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void abortLatestOperation(String resourceGroupName, String resourceName, String agentPoolName, Context context); + + /** + * Deletes specific machines in an agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param machines A list of machines from the agent pool to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteMachines(String resourceGroupName, String resourceName, String agentPoolName, + AgentPoolDeleteMachinesParameter machines); + + /** + * Deletes specific machines in an agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param machines A list of machines from the agent pool to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteMachines(String resourceGroupName, String resourceName, String agentPoolName, + AgentPoolDeleteMachinesParameter machines, Context context); + + /** + * Upgrades the node image version of an agent pool to the latest. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void upgradeNodeImageVersion(String resourceGroupName, String resourceName, String agentPoolName); + + /** + * Upgrades the node image version of an agent pool to the latest. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void upgradeNodeImageVersion(String resourceGroupName, String resourceName, String agentPoolName, Context context); + + /** + * Gets a list of supported Kubernetes versions for the specified agent pool. + * + * See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more + * details about the version lifecycle. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of supported Kubernetes versions for the specified agent pool. + * + * See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more + * details about the version lifecycle along with {@link Response}. + */ + Response getAvailableAgentPoolVersionsWithResponse(String resourceGroupName, + String resourceName, Context context); + + /** + * Gets a list of supported Kubernetes versions for the specified agent pool. + * + * See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more + * details about the version lifecycle. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of supported Kubernetes versions for the specified agent pool. + * + * See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more + * details about the version lifecycle. + */ + AgentPoolAvailableVersions getAvailableAgentPoolVersions(String resourceGroupName, String resourceName); + + /** + * Gets the upgrade profile for an agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upgrade profile for an agent pool along with {@link Response}. + */ + Response getUpgradeProfileWithResponse(String resourceGroupName, String resourceName, + String agentPoolName, Context context); + + /** + * Gets the upgrade profile for an agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upgrade profile for an agent pool. + */ + AgentPoolUpgradeProfile getUpgradeProfile(String resourceGroupName, String resourceName, String agentPoolName); + + /** + * Gets the specified managed cluster agent pool. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified managed cluster agent pool along with {@link Response}. + */ + AgentPool getById(String id); + + /** + * Gets the specified managed cluster agent pool. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified managed cluster agent pool along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param id the resource ID. + * @param ignorePodDisruptionBudget ignore-pod-disruption-budget=true to delete those pods on a node without + * considering Pod Disruption Budget. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Boolean ignorePodDisruptionBudget, String ifMatch, Context context); + + /** + * Begins definition for a new AgentPool resource. + * + * @param name resource name. + * @return the first stage of the new AgentPool definition. + */ + AgentPool.DefinitionStages.Blank define(String name); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ArtifactSource.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ArtifactSource.java new file mode 100644 index 000000000000..ffe7aed97c8e --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ArtifactSource.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The artifact source. The source where the artifacts are downloaded from. + */ +public final class ArtifactSource extends ExpandableStringEnum { + /** + * pull images from Azure Container Registry with cache. + */ + public static final ArtifactSource CACHE = fromString("Cache"); + + /** + * pull images from Microsoft Artifact Registry. + */ + public static final ArtifactSource DIRECT = fromString("Direct"); + + /** + * Creates a new instance of ArtifactSource value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ArtifactSource() { + } + + /** + * Creates or finds a ArtifactSource from its string representation. + * + * @param name a name to look for. + * @return the corresponding ArtifactSource. + */ + public static ArtifactSource fromString(String name) { + return fromString(name, ArtifactSource.class); + } + + /** + * Gets known ArtifactSource values. + * + * @return known ArtifactSource values. + */ + public static Collection values() { + return values(ArtifactSource.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AzureKeyVaultKms.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AzureKeyVaultKms.java new file mode 100644 index 000000000000..b4dbb92a1d70 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AzureKeyVaultKms.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Azure Key Vault key management service settings for the security profile. + */ +@Fluent +public final class AzureKeyVaultKms implements JsonSerializable { + /* + * Whether to enable Azure Key Vault key management service. The default is false. + */ + private Boolean enabled; + + /* + * 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. + */ + private String keyId; + + /* + * Network access of the key vault. 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`. + */ + private KeyVaultNetworkAccessTypes keyVaultNetworkAccess; + + /* + * 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. + */ + private String keyVaultResourceId; + + /** + * Creates an instance of AzureKeyVaultKms class. + */ + public AzureKeyVaultKms() { + } + + /** + * Get the enabled property: Whether to enable Azure Key Vault key management service. The default is false. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Whether to enable Azure Key Vault key management service. The default is false. + * + * @param enabled the enabled value to set. + * @return the AzureKeyVaultKms object itself. + */ + public AzureKeyVaultKms withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the keyId property: 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. + * + * @return the keyId value. + */ + public String keyId() { + return this.keyId; + } + + /** + * Set the keyId property: 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. + * + * @param keyId the keyId value to set. + * @return the AzureKeyVaultKms object itself. + */ + public AzureKeyVaultKms withKeyId(String keyId) { + this.keyId = keyId; + return this; + } + + /** + * Get the keyVaultNetworkAccess property: Network access of the key vault. 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`. + * + * @return the keyVaultNetworkAccess value. + */ + public KeyVaultNetworkAccessTypes keyVaultNetworkAccess() { + return this.keyVaultNetworkAccess; + } + + /** + * Set the keyVaultNetworkAccess property: Network access of the key vault. 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`. + * + * @param keyVaultNetworkAccess the keyVaultNetworkAccess value to set. + * @return the AzureKeyVaultKms object itself. + */ + public AzureKeyVaultKms withKeyVaultNetworkAccess(KeyVaultNetworkAccessTypes keyVaultNetworkAccess) { + this.keyVaultNetworkAccess = keyVaultNetworkAccess; + return this; + } + + /** + * Get the keyVaultResourceId property: 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. + * + * @return the keyVaultResourceId value. + */ + public String keyVaultResourceId() { + return this.keyVaultResourceId; + } + + /** + * Set the keyVaultResourceId property: 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. + * + * @param keyVaultResourceId the keyVaultResourceId value to set. + * @return the AzureKeyVaultKms object itself. + */ + public AzureKeyVaultKms withKeyVaultResourceId(String keyVaultResourceId) { + this.keyVaultResourceId = keyVaultResourceId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeStringField("keyId", this.keyId); + jsonWriter.writeStringField("keyVaultNetworkAccess", + this.keyVaultNetworkAccess == null ? null : this.keyVaultNetworkAccess.toString()); + jsonWriter.writeStringField("keyVaultResourceId", this.keyVaultResourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureKeyVaultKms from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureKeyVaultKms if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureKeyVaultKms. + */ + public static AzureKeyVaultKms fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureKeyVaultKms deserializedAzureKeyVaultKms = new AzureKeyVaultKms(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedAzureKeyVaultKms.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("keyId".equals(fieldName)) { + deserializedAzureKeyVaultKms.keyId = reader.getString(); + } else if ("keyVaultNetworkAccess".equals(fieldName)) { + deserializedAzureKeyVaultKms.keyVaultNetworkAccess + = KeyVaultNetworkAccessTypes.fromString(reader.getString()); + } else if ("keyVaultResourceId".equals(fieldName)) { + deserializedAzureKeyVaultKms.keyVaultResourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureKeyVaultKms; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/BackendPoolType.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/BackendPoolType.java new file mode 100644 index 000000000000..d76e51a7287e --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/BackendPoolType.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The type of the managed inbound Load Balancer BackendPool. + */ +public final class BackendPoolType extends ExpandableStringEnum { + /** + * The type of the managed inbound Load Balancer BackendPool. + * https://cloud-provider-azure.sigs.k8s.io/topics/loadbalancer/#configure-load-balancer-backend. + */ + public static final BackendPoolType NODE_IPCONFIGURATION = fromString("NodeIPConfiguration"); + + /** + * The type of the managed inbound Load Balancer BackendPool. + * https://cloud-provider-azure.sigs.k8s.io/topics/loadbalancer/#configure-load-balancer-backend. + */ + public static final BackendPoolType NODE_IP = fromString("NodeIP"); + + /** + * Creates a new instance of BackendPoolType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BackendPoolType() { + } + + /** + * Creates or finds a BackendPoolType from its string representation. + * + * @param name a name to look for. + * @return the corresponding BackendPoolType. + */ + public static BackendPoolType fromString(String name) { + return fromString(name, BackendPoolType.class); + } + + /** + * Gets known BackendPoolType values. + * + * @return known BackendPoolType values. + */ + public static Collection values() { + return values(BackendPoolType.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ClusterUpgradeSettings.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ClusterUpgradeSettings.java new file mode 100644 index 000000000000..801b4c4a462c --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ClusterUpgradeSettings.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Settings for upgrading a cluster. + */ +@Fluent +public final class ClusterUpgradeSettings implements JsonSerializable { + /* + * Settings for overrides. + */ + private UpgradeOverrideSettings overrideSettings; + + /** + * Creates an instance of ClusterUpgradeSettings class. + */ + public ClusterUpgradeSettings() { + } + + /** + * Get the overrideSettings property: Settings for overrides. + * + * @return the overrideSettings value. + */ + public UpgradeOverrideSettings overrideSettings() { + return this.overrideSettings; + } + + /** + * Set the overrideSettings property: Settings for overrides. + * + * @param overrideSettings the overrideSettings value to set. + * @return the ClusterUpgradeSettings object itself. + */ + public ClusterUpgradeSettings withOverrideSettings(UpgradeOverrideSettings overrideSettings) { + this.overrideSettings = overrideSettings; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("overrideSettings", this.overrideSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterUpgradeSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterUpgradeSettings if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ClusterUpgradeSettings. + */ + public static ClusterUpgradeSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterUpgradeSettings deserializedClusterUpgradeSettings = new ClusterUpgradeSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("overrideSettings".equals(fieldName)) { + deserializedClusterUpgradeSettings.overrideSettings = UpgradeOverrideSettings.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterUpgradeSettings; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Code.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Code.java new file mode 100644 index 000000000000..f5749076b416 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Code.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Tells whether the cluster is Running or Stopped. + */ +public final class Code extends ExpandableStringEnum { + /** + * The cluster is running. + */ + public static final Code RUNNING = fromString("Running"); + + /** + * The cluster is stopped. + */ + public static final Code STOPPED = fromString("Stopped"); + + /** + * Creates a new instance of Code value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Code() { + } + + /** + * Creates or finds a Code from its string representation. + * + * @param name a name to look for. + * @return the corresponding Code. + */ + public static Code fromString(String name) { + return fromString(name, Code.class); + } + + /** + * Gets known Code values. + * + * @return known Code values. + */ + public static Collection values() { + return values(Code.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/CompatibleVersions.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/CompatibleVersions.java new file mode 100644 index 000000000000..abcca41683ca --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/CompatibleVersions.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Version information about a product/service that is compatible with a service mesh revision. + */ +@Immutable +public final class CompatibleVersions implements JsonSerializable { + /* + * The product/service name. + */ + private String name; + + /* + * Product/service versions compatible with a service mesh add-on revision. + */ + private List versions; + + /** + * Creates an instance of CompatibleVersions class. + */ + private CompatibleVersions() { + } + + /** + * Get the name property: The product/service name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the versions property: Product/service versions compatible with a service mesh add-on revision. + * + * @return the versions value. + */ + public List versions() { + return this.versions; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeArrayField("versions", this.versions, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CompatibleVersions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CompatibleVersions if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the CompatibleVersions. + */ + public static CompatibleVersions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CompatibleVersions deserializedCompatibleVersions = new CompatibleVersions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedCompatibleVersions.name = reader.getString(); + } else if ("versions".equals(fieldName)) { + List versions = reader.readArray(reader1 -> reader1.getString()); + deserializedCompatibleVersions.versions = versions; + } else { + reader.skipChildren(); + } + } + + return deserializedCompatibleVersions; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ConnectionStatus.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ConnectionStatus.java new file mode 100644 index 000000000000..a8d3dd1e2eb7 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ConnectionStatus.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The private link service connection status. + */ +public final class ConnectionStatus extends ExpandableStringEnum { + /** + * Connection is pending approval. + */ + public static final ConnectionStatus PENDING = fromString("Pending"); + + /** + * Connection is approved. + */ + public static final ConnectionStatus APPROVED = fromString("Approved"); + + /** + * Connection is rejected. + */ + public static final ConnectionStatus REJECTED = fromString("Rejected"); + + /** + * Connection is disconnected. + */ + public static final ConnectionStatus DISCONNECTED = fromString("Disconnected"); + + /** + * Creates a new instance of ConnectionStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ConnectionStatus() { + } + + /** + * Creates or finds a ConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConnectionStatus. + */ + public static ConnectionStatus fromString(String name) { + return fromString(name, ConnectionStatus.class); + } + + /** + * Gets known ConnectionStatus values. + * + * @return known ConnectionStatus values. + */ + public static Collection values() { + return values(ConnectionStatus.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceLinuxProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceLinuxProfile.java new file mode 100644 index 000000000000..88c329cb1360 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceLinuxProfile.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Profile for Linux VMs in the container service cluster. + */ +@Fluent +public final class ContainerServiceLinuxProfile implements JsonSerializable { + /* + * The administrator username to use for Linux VMs. + */ + private String adminUsername; + + /* + * The SSH configuration for Linux-based VMs running on Azure. + */ + private ContainerServiceSshConfiguration ssh; + + /** + * Creates an instance of ContainerServiceLinuxProfile class. + */ + public ContainerServiceLinuxProfile() { + } + + /** + * Get the adminUsername property: The administrator username to use for Linux VMs. + * + * @return the adminUsername value. + */ + public String adminUsername() { + return this.adminUsername; + } + + /** + * Set the adminUsername property: The administrator username to use for Linux VMs. + * + * @param adminUsername the adminUsername value to set. + * @return the ContainerServiceLinuxProfile object itself. + */ + public ContainerServiceLinuxProfile withAdminUsername(String adminUsername) { + this.adminUsername = adminUsername; + return this; + } + + /** + * Get the ssh property: The SSH configuration for Linux-based VMs running on Azure. + * + * @return the ssh value. + */ + public ContainerServiceSshConfiguration ssh() { + return this.ssh; + } + + /** + * Set the ssh property: The SSH configuration for Linux-based VMs running on Azure. + * + * @param ssh the ssh value to set. + * @return the ContainerServiceLinuxProfile object itself. + */ + public ContainerServiceLinuxProfile withSsh(ContainerServiceSshConfiguration ssh) { + this.ssh = ssh; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("adminUsername", this.adminUsername); + jsonWriter.writeJsonField("ssh", this.ssh); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerServiceLinuxProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerServiceLinuxProfile if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ContainerServiceLinuxProfile. + */ + public static ContainerServiceLinuxProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerServiceLinuxProfile deserializedContainerServiceLinuxProfile = new ContainerServiceLinuxProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("adminUsername".equals(fieldName)) { + deserializedContainerServiceLinuxProfile.adminUsername = reader.getString(); + } else if ("ssh".equals(fieldName)) { + deserializedContainerServiceLinuxProfile.ssh = ContainerServiceSshConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerServiceLinuxProfile; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceNetworkProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceNetworkProfile.java new file mode 100644 index 000000000000..f89c1e128046 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceNetworkProfile.java @@ -0,0 +1,595 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Profile of network configuration. + */ +@Fluent +public final class ContainerServiceNetworkProfile implements JsonSerializable { + /* + * Network plugin used for building the Kubernetes network. + */ + private NetworkPlugin networkPlugin; + + /* + * The mode the network plugin should use. + */ + private NetworkPluginMode networkPluginMode; + + /* + * Network policy used for building the Kubernetes network. + */ + private NetworkPolicy networkPolicy; + + /* + * The network mode Azure CNI is configured with. This cannot be specified if networkPlugin is anything other than + * 'azure'. + */ + private NetworkMode networkMode; + + /* + * Network dataplane used in the Kubernetes cluster. + */ + private NetworkDataplane networkDataplane; + + /* + * Advanced Networking profile for enabling observability and security feature suite on a cluster. For more + * information see aka.ms/aksadvancednetworking. + */ + private AdvancedNetworking advancedNetworking; + + /* + * A CIDR notation IP range from which to assign pod IPs when kubenet is used. + */ + private String podCidr; + + /* + * A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. + */ + private String serviceCidr; + + /* + * An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range + * specified in serviceCidr. + */ + private String dnsServiceIP; + + /* + * The outbound (egress) routing method. 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). + */ + private OutboundType outboundType; + + /* + * The load balancer sku for the managed cluster. 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. + */ + private LoadBalancerSku loadBalancerSku; + + /* + * Profile of the cluster load balancer. + */ + private ManagedClusterLoadBalancerProfile loadBalancerProfile; + + /* + * Profile of the cluster NAT gateway. + */ + private ManagedClusterNATGatewayProfile natGatewayProfile; + + /* + * The profile for Static Egress Gateway addon. For more details about Static Egress Gateway, see + * https://aka.ms/aks/static-egress-gateway. + */ + private ManagedClusterStaticEgressGatewayProfile staticEgressGatewayProfile; + + /* + * The CIDR notation IP ranges from which to assign pod IPs. One IPv4 CIDR is expected for single-stack networking. + * Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. + */ + private List podCidrs; + + /* + * The CIDR notation IP ranges from which to assign service cluster IPs. 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. + */ + private List serviceCidrs; + + /* + * The IP families used to specify IP versions available to the cluster. 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. + */ + private List ipFamilies; + + /** + * Creates an instance of ContainerServiceNetworkProfile class. + */ + public ContainerServiceNetworkProfile() { + } + + /** + * Get the networkPlugin property: Network plugin used for building the Kubernetes network. + * + * @return the networkPlugin value. + */ + public NetworkPlugin networkPlugin() { + return this.networkPlugin; + } + + /** + * Set the networkPlugin property: Network plugin used for building the Kubernetes network. + * + * @param networkPlugin the networkPlugin value to set. + * @return the ContainerServiceNetworkProfile object itself. + */ + public ContainerServiceNetworkProfile withNetworkPlugin(NetworkPlugin networkPlugin) { + this.networkPlugin = networkPlugin; + return this; + } + + /** + * Get the networkPluginMode property: The mode the network plugin should use. + * + * @return the networkPluginMode value. + */ + public NetworkPluginMode networkPluginMode() { + return this.networkPluginMode; + } + + /** + * Set the networkPluginMode property: The mode the network plugin should use. + * + * @param networkPluginMode the networkPluginMode value to set. + * @return the ContainerServiceNetworkProfile object itself. + */ + public ContainerServiceNetworkProfile withNetworkPluginMode(NetworkPluginMode networkPluginMode) { + this.networkPluginMode = networkPluginMode; + return this; + } + + /** + * Get the networkPolicy property: Network policy used for building the Kubernetes network. + * + * @return the networkPolicy value. + */ + public NetworkPolicy networkPolicy() { + return this.networkPolicy; + } + + /** + * Set the networkPolicy property: Network policy used for building the Kubernetes network. + * + * @param networkPolicy the networkPolicy value to set. + * @return the ContainerServiceNetworkProfile object itself. + */ + public ContainerServiceNetworkProfile withNetworkPolicy(NetworkPolicy networkPolicy) { + this.networkPolicy = networkPolicy; + return this; + } + + /** + * Get the networkMode property: The network mode Azure CNI is configured with. This cannot be specified if + * networkPlugin is anything other than 'azure'. + * + * @return the networkMode value. + */ + public NetworkMode networkMode() { + return this.networkMode; + } + + /** + * Set the networkMode property: The network mode Azure CNI is configured with. This cannot be specified if + * networkPlugin is anything other than 'azure'. + * + * @param networkMode the networkMode value to set. + * @return the ContainerServiceNetworkProfile object itself. + */ + public ContainerServiceNetworkProfile withNetworkMode(NetworkMode networkMode) { + this.networkMode = networkMode; + return this; + } + + /** + * Get the networkDataplane property: Network dataplane used in the Kubernetes cluster. + * + * @return the networkDataplane value. + */ + public NetworkDataplane networkDataplane() { + return this.networkDataplane; + } + + /** + * Set the networkDataplane property: Network dataplane used in the Kubernetes cluster. + * + * @param networkDataplane the networkDataplane value to set. + * @return the ContainerServiceNetworkProfile object itself. + */ + public ContainerServiceNetworkProfile withNetworkDataplane(NetworkDataplane networkDataplane) { + this.networkDataplane = networkDataplane; + return this; + } + + /** + * Get the advancedNetworking property: Advanced Networking profile for enabling observability and security feature + * suite on a cluster. For more information see aka.ms/aksadvancednetworking. + * + * @return the advancedNetworking value. + */ + public AdvancedNetworking advancedNetworking() { + return this.advancedNetworking; + } + + /** + * Set the advancedNetworking property: Advanced Networking profile for enabling observability and security feature + * suite on a cluster. For more information see aka.ms/aksadvancednetworking. + * + * @param advancedNetworking the advancedNetworking value to set. + * @return the ContainerServiceNetworkProfile object itself. + */ + public ContainerServiceNetworkProfile withAdvancedNetworking(AdvancedNetworking advancedNetworking) { + this.advancedNetworking = advancedNetworking; + return this; + } + + /** + * Get the podCidr property: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + * + * @return the podCidr value. + */ + public String podCidr() { + return this.podCidr; + } + + /** + * Set the podCidr property: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + * + * @param podCidr the podCidr value to set. + * @return the ContainerServiceNetworkProfile object itself. + */ + public ContainerServiceNetworkProfile withPodCidr(String podCidr) { + this.podCidr = podCidr; + return this; + } + + /** + * Get the serviceCidr property: A CIDR notation IP range from which to assign service cluster IPs. It must not + * overlap with any Subnet IP ranges. + * + * @return the serviceCidr value. + */ + public String serviceCidr() { + return this.serviceCidr; + } + + /** + * Set the serviceCidr property: A CIDR notation IP range from which to assign service cluster IPs. It must not + * overlap with any Subnet IP ranges. + * + * @param serviceCidr the serviceCidr value to set. + * @return the ContainerServiceNetworkProfile object itself. + */ + public ContainerServiceNetworkProfile withServiceCidr(String serviceCidr) { + this.serviceCidr = serviceCidr; + return this; + } + + /** + * Get the dnsServiceIP property: An IP address assigned to the Kubernetes DNS service. It must be within the + * Kubernetes service address range specified in serviceCidr. + * + * @return the dnsServiceIP value. + */ + public String dnsServiceIP() { + return this.dnsServiceIP; + } + + /** + * Set the dnsServiceIP property: An IP address assigned to the Kubernetes DNS service. It must be within the + * Kubernetes service address range specified in serviceCidr. + * + * @param dnsServiceIP the dnsServiceIP value to set. + * @return the ContainerServiceNetworkProfile object itself. + */ + public ContainerServiceNetworkProfile withDnsServiceIP(String dnsServiceIP) { + this.dnsServiceIP = dnsServiceIP; + return this; + } + + /** + * Get the outboundType property: The outbound (egress) routing method. 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). + * + * @return the outboundType value. + */ + public OutboundType outboundType() { + return this.outboundType; + } + + /** + * Set the outboundType property: The outbound (egress) routing method. 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). + * + * @param outboundType the outboundType value to set. + * @return the ContainerServiceNetworkProfile object itself. + */ + public ContainerServiceNetworkProfile withOutboundType(OutboundType outboundType) { + this.outboundType = outboundType; + return this; + } + + /** + * Get the loadBalancerSku property: The load balancer sku for the managed cluster. 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. + * + * @return the loadBalancerSku value. + */ + public LoadBalancerSku loadBalancerSku() { + return this.loadBalancerSku; + } + + /** + * Set the loadBalancerSku property: The load balancer sku for the managed cluster. 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. + * + * @param loadBalancerSku the loadBalancerSku value to set. + * @return the ContainerServiceNetworkProfile object itself. + */ + public ContainerServiceNetworkProfile withLoadBalancerSku(LoadBalancerSku loadBalancerSku) { + this.loadBalancerSku = loadBalancerSku; + return this; + } + + /** + * Get the loadBalancerProfile property: Profile of the cluster load balancer. + * + * @return the loadBalancerProfile value. + */ + public ManagedClusterLoadBalancerProfile loadBalancerProfile() { + return this.loadBalancerProfile; + } + + /** + * Set the loadBalancerProfile property: Profile of the cluster load balancer. + * + * @param loadBalancerProfile the loadBalancerProfile value to set. + * @return the ContainerServiceNetworkProfile object itself. + */ + public ContainerServiceNetworkProfile + withLoadBalancerProfile(ManagedClusterLoadBalancerProfile loadBalancerProfile) { + this.loadBalancerProfile = loadBalancerProfile; + return this; + } + + /** + * Get the natGatewayProfile property: Profile of the cluster NAT gateway. + * + * @return the natGatewayProfile value. + */ + public ManagedClusterNATGatewayProfile natGatewayProfile() { + return this.natGatewayProfile; + } + + /** + * Set the natGatewayProfile property: Profile of the cluster NAT gateway. + * + * @param natGatewayProfile the natGatewayProfile value to set. + * @return the ContainerServiceNetworkProfile object itself. + */ + public ContainerServiceNetworkProfile withNatGatewayProfile(ManagedClusterNATGatewayProfile natGatewayProfile) { + this.natGatewayProfile = natGatewayProfile; + return this; + } + + /** + * Get the staticEgressGatewayProfile property: The profile for Static Egress Gateway addon. For more details about + * Static Egress Gateway, see https://aka.ms/aks/static-egress-gateway. + * + * @return the staticEgressGatewayProfile value. + */ + public ManagedClusterStaticEgressGatewayProfile staticEgressGatewayProfile() { + return this.staticEgressGatewayProfile; + } + + /** + * Set the staticEgressGatewayProfile property: The profile for Static Egress Gateway addon. For more details about + * Static Egress Gateway, see https://aka.ms/aks/static-egress-gateway. + * + * @param staticEgressGatewayProfile the staticEgressGatewayProfile value to set. + * @return the ContainerServiceNetworkProfile object itself. + */ + public ContainerServiceNetworkProfile + withStaticEgressGatewayProfile(ManagedClusterStaticEgressGatewayProfile staticEgressGatewayProfile) { + this.staticEgressGatewayProfile = staticEgressGatewayProfile; + return this; + } + + /** + * Get the podCidrs property: The CIDR notation IP ranges from which to assign pod IPs. One IPv4 CIDR is expected + * for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack + * networking. + * + * @return the podCidrs value. + */ + public List podCidrs() { + return this.podCidrs; + } + + /** + * Set the podCidrs property: The CIDR notation IP ranges from which to assign pod IPs. One IPv4 CIDR is expected + * for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack + * networking. + * + * @param podCidrs the podCidrs value to set. + * @return the ContainerServiceNetworkProfile object itself. + */ + public ContainerServiceNetworkProfile withPodCidrs(List podCidrs) { + this.podCidrs = podCidrs; + return this; + } + + /** + * Get the serviceCidrs property: The CIDR notation IP ranges from which to assign service cluster IPs. 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. + * + * @return the serviceCidrs value. + */ + public List serviceCidrs() { + return this.serviceCidrs; + } + + /** + * Set the serviceCidrs property: The CIDR notation IP ranges from which to assign service cluster IPs. 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. + * + * @param serviceCidrs the serviceCidrs value to set. + * @return the ContainerServiceNetworkProfile object itself. + */ + public ContainerServiceNetworkProfile withServiceCidrs(List serviceCidrs) { + this.serviceCidrs = serviceCidrs; + return this; + } + + /** + * Get the ipFamilies property: The IP families used to specify IP versions available to the cluster. 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. + * + * @return the ipFamilies value. + */ + public List ipFamilies() { + return this.ipFamilies; + } + + /** + * Set the ipFamilies property: The IP families used to specify IP versions available to the cluster. 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. + * + * @param ipFamilies the ipFamilies value to set. + * @return the ContainerServiceNetworkProfile object itself. + */ + public ContainerServiceNetworkProfile withIpFamilies(List ipFamilies) { + this.ipFamilies = ipFamilies; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("networkPlugin", this.networkPlugin == null ? null : this.networkPlugin.toString()); + jsonWriter.writeStringField("networkPluginMode", + this.networkPluginMode == null ? null : this.networkPluginMode.toString()); + jsonWriter.writeStringField("networkPolicy", this.networkPolicy == null ? null : this.networkPolicy.toString()); + jsonWriter.writeStringField("networkMode", this.networkMode == null ? null : this.networkMode.toString()); + jsonWriter.writeStringField("networkDataplane", + this.networkDataplane == null ? null : this.networkDataplane.toString()); + jsonWriter.writeJsonField("advancedNetworking", this.advancedNetworking); + jsonWriter.writeStringField("podCidr", this.podCidr); + jsonWriter.writeStringField("serviceCidr", this.serviceCidr); + jsonWriter.writeStringField("dnsServiceIP", this.dnsServiceIP); + jsonWriter.writeStringField("outboundType", this.outboundType == null ? null : this.outboundType.toString()); + jsonWriter.writeStringField("loadBalancerSku", + this.loadBalancerSku == null ? null : this.loadBalancerSku.toString()); + jsonWriter.writeJsonField("loadBalancerProfile", this.loadBalancerProfile); + jsonWriter.writeJsonField("natGatewayProfile", this.natGatewayProfile); + jsonWriter.writeJsonField("staticEgressGatewayProfile", this.staticEgressGatewayProfile); + jsonWriter.writeArrayField("podCidrs", this.podCidrs, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("serviceCidrs", this.serviceCidrs, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("ipFamilies", this.ipFamilies, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerServiceNetworkProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerServiceNetworkProfile if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ContainerServiceNetworkProfile. + */ + public static ContainerServiceNetworkProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerServiceNetworkProfile deserializedContainerServiceNetworkProfile + = new ContainerServiceNetworkProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("networkPlugin".equals(fieldName)) { + deserializedContainerServiceNetworkProfile.networkPlugin + = NetworkPlugin.fromString(reader.getString()); + } else if ("networkPluginMode".equals(fieldName)) { + deserializedContainerServiceNetworkProfile.networkPluginMode + = NetworkPluginMode.fromString(reader.getString()); + } else if ("networkPolicy".equals(fieldName)) { + deserializedContainerServiceNetworkProfile.networkPolicy + = NetworkPolicy.fromString(reader.getString()); + } else if ("networkMode".equals(fieldName)) { + deserializedContainerServiceNetworkProfile.networkMode = NetworkMode.fromString(reader.getString()); + } else if ("networkDataplane".equals(fieldName)) { + deserializedContainerServiceNetworkProfile.networkDataplane + = NetworkDataplane.fromString(reader.getString()); + } else if ("advancedNetworking".equals(fieldName)) { + deserializedContainerServiceNetworkProfile.advancedNetworking = AdvancedNetworking.fromJson(reader); + } else if ("podCidr".equals(fieldName)) { + deserializedContainerServiceNetworkProfile.podCidr = reader.getString(); + } else if ("serviceCidr".equals(fieldName)) { + deserializedContainerServiceNetworkProfile.serviceCidr = reader.getString(); + } else if ("dnsServiceIP".equals(fieldName)) { + deserializedContainerServiceNetworkProfile.dnsServiceIP = reader.getString(); + } else if ("outboundType".equals(fieldName)) { + deserializedContainerServiceNetworkProfile.outboundType + = OutboundType.fromString(reader.getString()); + } else if ("loadBalancerSku".equals(fieldName)) { + deserializedContainerServiceNetworkProfile.loadBalancerSku + = LoadBalancerSku.fromString(reader.getString()); + } else if ("loadBalancerProfile".equals(fieldName)) { + deserializedContainerServiceNetworkProfile.loadBalancerProfile + = ManagedClusterLoadBalancerProfile.fromJson(reader); + } else if ("natGatewayProfile".equals(fieldName)) { + deserializedContainerServiceNetworkProfile.natGatewayProfile + = ManagedClusterNATGatewayProfile.fromJson(reader); + } else if ("staticEgressGatewayProfile".equals(fieldName)) { + deserializedContainerServiceNetworkProfile.staticEgressGatewayProfile + = ManagedClusterStaticEgressGatewayProfile.fromJson(reader); + } else if ("podCidrs".equals(fieldName)) { + List podCidrs = reader.readArray(reader1 -> reader1.getString()); + deserializedContainerServiceNetworkProfile.podCidrs = podCidrs; + } else if ("serviceCidrs".equals(fieldName)) { + List serviceCidrs = reader.readArray(reader1 -> reader1.getString()); + deserializedContainerServiceNetworkProfile.serviceCidrs = serviceCidrs; + } else if ("ipFamilies".equals(fieldName)) { + List ipFamilies = reader.readArray(reader1 -> IPFamily.fromString(reader1.getString())); + deserializedContainerServiceNetworkProfile.ipFamilies = ipFamilies; + } else { + reader.skipChildren(); + } + } + + return deserializedContainerServiceNetworkProfile; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceSshConfiguration.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceSshConfiguration.java new file mode 100644 index 000000000000..82609be8ec4b --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceSshConfiguration.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * SSH configuration for Linux-based VMs running on Azure. + */ +@Fluent +public final class ContainerServiceSshConfiguration implements JsonSerializable { + /* + * The list of SSH public keys used to authenticate with Linux-based VMs. A maximum of 1 key may be specified. + */ + private List publicKeys; + + /** + * Creates an instance of ContainerServiceSshConfiguration class. + */ + public ContainerServiceSshConfiguration() { + } + + /** + * Get the publicKeys property: The list of SSH public keys used to authenticate with Linux-based VMs. A maximum of + * 1 key may be specified. + * + * @return the publicKeys value. + */ + public List publicKeys() { + return this.publicKeys; + } + + /** + * Set the publicKeys property: The list of SSH public keys used to authenticate with Linux-based VMs. A maximum of + * 1 key may be specified. + * + * @param publicKeys the publicKeys value to set. + * @return the ContainerServiceSshConfiguration object itself. + */ + public ContainerServiceSshConfiguration withPublicKeys(List publicKeys) { + this.publicKeys = publicKeys; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("publicKeys", this.publicKeys, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerServiceSshConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerServiceSshConfiguration if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ContainerServiceSshConfiguration. + */ + public static ContainerServiceSshConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerServiceSshConfiguration deserializedContainerServiceSshConfiguration + = new ContainerServiceSshConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("publicKeys".equals(fieldName)) { + List publicKeys + = reader.readArray(reader1 -> ContainerServiceSshPublicKey.fromJson(reader1)); + deserializedContainerServiceSshConfiguration.publicKeys = publicKeys; + } else { + reader.skipChildren(); + } + } + + return deserializedContainerServiceSshConfiguration; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceSshPublicKey.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceSshPublicKey.java new file mode 100644 index 000000000000..a0d1149d9491 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceSshPublicKey.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Contains information about SSH certificate public key data. + */ +@Fluent +public final class ContainerServiceSshPublicKey implements JsonSerializable { + /* + * Certificate public key used to authenticate with VMs through SSH. The certificate must be in PEM format with or + * without headers. + */ + private String keyData; + + /** + * Creates an instance of ContainerServiceSshPublicKey class. + */ + public ContainerServiceSshPublicKey() { + } + + /** + * Get the keyData property: Certificate public key used to authenticate with VMs through SSH. The certificate must + * be in PEM format with or without headers. + * + * @return the keyData value. + */ + public String keyData() { + return this.keyData; + } + + /** + * Set the keyData property: Certificate public key used to authenticate with VMs through SSH. The certificate must + * be in PEM format with or without headers. + * + * @param keyData the keyData value to set. + * @return the ContainerServiceSshPublicKey object itself. + */ + public ContainerServiceSshPublicKey withKeyData(String keyData) { + this.keyData = keyData; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("keyData", this.keyData); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerServiceSshPublicKey from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerServiceSshPublicKey if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ContainerServiceSshPublicKey. + */ + public static ContainerServiceSshPublicKey fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerServiceSshPublicKey deserializedContainerServiceSshPublicKey = new ContainerServiceSshPublicKey(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyData".equals(fieldName)) { + deserializedContainerServiceSshPublicKey.keyData = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerServiceSshPublicKey; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/CreationData.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/CreationData.java new file mode 100644 index 000000000000..e03792e96b33 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/CreationData.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Data used when creating a target resource from a source resource. + */ +@Fluent +public final class CreationData implements JsonSerializable { + /* + * This is the ARM ID of the source object to be used to create the target object. + */ + private String sourceResourceId; + + /** + * Creates an instance of CreationData class. + */ + public CreationData() { + } + + /** + * Get the sourceResourceId property: This is the ARM ID of the source object to be used to create the target + * object. + * + * @return the sourceResourceId value. + */ + public String sourceResourceId() { + return this.sourceResourceId; + } + + /** + * Set the sourceResourceId property: This is the ARM ID of the source object to be used to create the target + * object. + * + * @param sourceResourceId the sourceResourceId value to set. + * @return the CreationData object itself. + */ + public CreationData withSourceResourceId(String sourceResourceId) { + this.sourceResourceId = sourceResourceId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("sourceResourceId", this.sourceResourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CreationData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CreationData if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the CreationData. + */ + public static CreationData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CreationData deserializedCreationData = new CreationData(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sourceResourceId".equals(fieldName)) { + deserializedCreationData.sourceResourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCreationData; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/CredentialResult.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/CredentialResult.java new file mode 100644 index 000000000000..8a639cdcd8da --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/CredentialResult.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The credential result response. + */ +@Immutable +public final class CredentialResult implements JsonSerializable { + /* + * The name of the credential. + */ + private String name; + + /* + * Base64-encoded Kubernetes configuration file. + */ + private byte[] value; + + /** + * Creates an instance of CredentialResult class. + */ + private CredentialResult() { + } + + /** + * Get the name property: The name of the credential. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the value property: Base64-encoded Kubernetes configuration file. + * + * @return the value value. + */ + public byte[] value() { + return CoreUtils.clone(this.value); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CredentialResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CredentialResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the CredentialResult. + */ + public static CredentialResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CredentialResult deserializedCredentialResult = new CredentialResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedCredentialResult.name = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedCredentialResult.value = reader.getBinary(); + } else { + reader.skipChildren(); + } + } + + return deserializedCredentialResult; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/CredentialResults.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/CredentialResults.java new file mode 100644 index 000000000000..fd7b26f35680 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/CredentialResults.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.CredentialResultsInner; +import java.util.List; + +/** + * An immutable client-side representation of CredentialResults. + */ +public interface CredentialResults { + /** + * Gets the kubeconfigs property: Base64-encoded Kubernetes configuration file. + * + * @return the kubeconfigs value. + */ + List kubeconfigs(); + + /** + * Gets the inner com.azure.resourcemanager.containerservice.generated.fluent.models.CredentialResultsInner object. + * + * @return the inner object. + */ + CredentialResultsInner innerModel(); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/DailySchedule.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/DailySchedule.java new file mode 100644 index 000000000000..082d5e99c816 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/DailySchedule.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * For schedules like: 'recur every day' or 'recur every 3 days'. + */ +@Fluent +public final class DailySchedule implements JsonSerializable { + /* + * Specifies the number of days between each set of occurrences. + */ + private int intervalDays; + + /** + * Creates an instance of DailySchedule class. + */ + public DailySchedule() { + } + + /** + * Get the intervalDays property: Specifies the number of days between each set of occurrences. + * + * @return the intervalDays value. + */ + public int intervalDays() { + return this.intervalDays; + } + + /** + * Set the intervalDays property: Specifies the number of days between each set of occurrences. + * + * @param intervalDays the intervalDays value to set. + * @return the DailySchedule object itself. + */ + public DailySchedule withIntervalDays(int intervalDays) { + this.intervalDays = intervalDays; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("intervalDays", this.intervalDays); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DailySchedule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DailySchedule if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DailySchedule. + */ + public static DailySchedule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DailySchedule deserializedDailySchedule = new DailySchedule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("intervalDays".equals(fieldName)) { + deserializedDailySchedule.intervalDays = reader.getInt(); + } else { + reader.skipChildren(); + } + } + + return deserializedDailySchedule; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/DateSpan.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/DateSpan.java new file mode 100644 index 000000000000..090fc3fe66b1 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/DateSpan.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.LocalDate; +import java.util.Objects; + +/** + * A date range. For example, between '2022-12-23' and '2023-01-05'. + */ +@Fluent +public final class DateSpan implements JsonSerializable { + /* + * The start date of the date span. + */ + private LocalDate start; + + /* + * The end date of the date span. + */ + private LocalDate end; + + /** + * Creates an instance of DateSpan class. + */ + public DateSpan() { + } + + /** + * Get the start property: The start date of the date span. + * + * @return the start value. + */ + public LocalDate start() { + return this.start; + } + + /** + * Set the start property: The start date of the date span. + * + * @param start the start value to set. + * @return the DateSpan object itself. + */ + public DateSpan withStart(LocalDate start) { + this.start = start; + return this; + } + + /** + * Get the end property: The end date of the date span. + * + * @return the end value. + */ + public LocalDate end() { + return this.end; + } + + /** + * Set the end property: The end date of the date span. + * + * @param end the end value to set. + * @return the DateSpan object itself. + */ + public DateSpan withEnd(LocalDate end) { + this.end = end; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("start", Objects.toString(this.start, null)); + jsonWriter.writeStringField("end", Objects.toString(this.end, null)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DateSpan from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DateSpan if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DateSpan. + */ + public static DateSpan fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DateSpan deserializedDateSpan = new DateSpan(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("start".equals(fieldName)) { + deserializedDateSpan.start + = reader.getNullable(nonNullReader -> LocalDate.parse(nonNullReader.getString())); + } else if ("end".equals(fieldName)) { + deserializedDateSpan.end + = reader.getNullable(nonNullReader -> LocalDate.parse(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedDateSpan; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/DelegatedResource.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/DelegatedResource.java new file mode 100644 index 000000000000..353a182b5f39 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/DelegatedResource.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Delegated resource properties - internal use only. + */ +@Fluent +public final class DelegatedResource implements JsonSerializable { + /* + * The ARM resource id of the delegated resource - internal use only. + */ + private String resourceId; + + /* + * The tenant id of the delegated resource - internal use only. + */ + private String tenantId; + + /* + * The delegation id of the referral delegation (optional) - internal use only. + */ + private String referralResource; + + /* + * The source resource location - internal use only. + */ + private String location; + + /** + * Creates an instance of DelegatedResource class. + */ + public DelegatedResource() { + } + + /** + * Get the resourceId property: The ARM resource id of the delegated resource - internal use only. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: The ARM resource id of the delegated resource - internal use only. + * + * @param resourceId the resourceId value to set. + * @return the DelegatedResource object itself. + */ + public DelegatedResource withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the tenantId property: The tenant id of the delegated resource - internal use only. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: The tenant id of the delegated resource - internal use only. + * + * @param tenantId the tenantId value to set. + * @return the DelegatedResource object itself. + */ + public DelegatedResource withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the referralResource property: The delegation id of the referral delegation (optional) - internal use only. + * + * @return the referralResource value. + */ + public String referralResource() { + return this.referralResource; + } + + /** + * Set the referralResource property: The delegation id of the referral delegation (optional) - internal use only. + * + * @param referralResource the referralResource value to set. + * @return the DelegatedResource object itself. + */ + public DelegatedResource withReferralResource(String referralResource) { + this.referralResource = referralResource; + return this; + } + + /** + * Get the location property: The source resource location - internal use only. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The source resource location - internal use only. + * + * @param location the location value to set. + * @return the DelegatedResource object itself. + */ + public DelegatedResource withLocation(String location) { + this.location = location; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeStringField("tenantId", this.tenantId); + jsonWriter.writeStringField("referralResource", this.referralResource); + jsonWriter.writeStringField("location", this.location); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DelegatedResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DelegatedResource if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DelegatedResource. + */ + public static DelegatedResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DelegatedResource deserializedDelegatedResource = new DelegatedResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceId".equals(fieldName)) { + deserializedDelegatedResource.resourceId = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedDelegatedResource.tenantId = reader.getString(); + } else if ("referralResource".equals(fieldName)) { + deserializedDelegatedResource.referralResource = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedDelegatedResource.location = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDelegatedResource; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/DeletePolicy.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/DeletePolicy.java new file mode 100644 index 000000000000..4ac9cc6b8a87 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/DeletePolicy.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Delete options of a namespace. + */ +public final class DeletePolicy extends ExpandableStringEnum { + /** + * Only delete the ARM resource, keep the Kubernetes namespace. Also delete the ManagedByARM label. + */ + public static final DeletePolicy KEEP = fromString("Keep"); + + /** + * Delete both the ARM resource and the Kubernetes namespace together. + */ + public static final DeletePolicy DELETE = fromString("Delete"); + + /** + * Creates a new instance of DeletePolicy value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DeletePolicy() { + } + + /** + * Creates or finds a DeletePolicy from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeletePolicy. + */ + public static DeletePolicy fromString(String name) { + return fromString(name, DeletePolicy.class); + } + + /** + * Gets known DeletePolicy values. + * + * @return known DeletePolicy values. + */ + public static Collection values() { + return values(DeletePolicy.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/EndpointDependency.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/EndpointDependency.java new file mode 100644 index 000000000000..a708ce199517 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/EndpointDependency.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * A domain name that AKS agent nodes are reaching at. + */ +@Immutable +public final class EndpointDependency implements JsonSerializable { + /* + * The domain name of the dependency. + */ + private String domainName; + + /* + * The Ports and Protocols used when connecting to domainName. + */ + private List endpointDetails; + + /** + * Creates an instance of EndpointDependency class. + */ + private EndpointDependency() { + } + + /** + * Get the domainName property: The domain name of the dependency. + * + * @return the domainName value. + */ + public String domainName() { + return this.domainName; + } + + /** + * Get the endpointDetails property: The Ports and Protocols used when connecting to domainName. + * + * @return the endpointDetails value. + */ + public List endpointDetails() { + return this.endpointDetails; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("domainName", this.domainName); + jsonWriter.writeArrayField("endpointDetails", this.endpointDetails, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EndpointDependency from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EndpointDependency if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the EndpointDependency. + */ + public static EndpointDependency fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EndpointDependency deserializedEndpointDependency = new EndpointDependency(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("domainName".equals(fieldName)) { + deserializedEndpointDependency.domainName = reader.getString(); + } else if ("endpointDetails".equals(fieldName)) { + List endpointDetails + = reader.readArray(reader1 -> EndpointDetail.fromJson(reader1)); + deserializedEndpointDependency.endpointDetails = endpointDetails; + } else { + reader.skipChildren(); + } + } + + return deserializedEndpointDependency; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/EndpointDetail.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/EndpointDetail.java new file mode 100644 index 000000000000..25ac15d1861b --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/EndpointDetail.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * connect information from the AKS agent nodes to a single endpoint. + */ +@Immutable +public final class EndpointDetail implements JsonSerializable { + /* + * An IP Address that Domain Name currently resolves to. + */ + private String ipAddress; + + /* + * The port an endpoint is connected to. + */ + private Integer port; + + /* + * The protocol used for connection + */ + private String protocol; + + /* + * Description of the detail + */ + private String description; + + /** + * Creates an instance of EndpointDetail class. + */ + private EndpointDetail() { + } + + /** + * Get the ipAddress property: An IP Address that Domain Name currently resolves to. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Get the port property: The port an endpoint is connected to. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Get the protocol property: The protocol used for connection. + * + * @return the protocol value. + */ + public String protocol() { + return this.protocol; + } + + /** + * Get the description property: Description of the detail. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ipAddress", this.ipAddress); + jsonWriter.writeNumberField("port", this.port); + jsonWriter.writeStringField("protocol", this.protocol); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EndpointDetail from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EndpointDetail if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the EndpointDetail. + */ + public static EndpointDetail fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EndpointDetail deserializedEndpointDetail = new EndpointDetail(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ipAddress".equals(fieldName)) { + deserializedEndpointDetail.ipAddress = reader.getString(); + } else if ("port".equals(fieldName)) { + deserializedEndpointDetail.port = reader.getNullable(JsonReader::getInt); + } else if ("protocol".equals(fieldName)) { + deserializedEndpointDetail.protocol = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedEndpointDetail.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEndpointDetail; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Expander.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Expander.java new file mode 100644 index 000000000000..7330b37c97d3 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Expander.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The expander to use when scaling up. 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 final class Expander extends ExpandableStringEnum { + /** + * 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 final Expander LEAST_WASTE = fromString("least-waste"); + + /** + * 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 final Expander MOST_PODS = fromString("most-pods"); + + /** + * 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 final Expander PRIORITY = fromString("priority"); + + /** + * Used when you don't have a particular need for the node groups to scale differently. + */ + public static final Expander RANDOM = fromString("random"); + + /** + * Creates a new instance of Expander value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Expander() { + } + + /** + * Creates or finds a Expander from its string representation. + * + * @param name a name to look for. + * @return the corresponding Expander. + */ + public static Expander fromString(String name) { + return fromString(name, Expander.class); + } + + /** + * Gets known Expander values. + * + * @return known Expander values. + */ + public static Collection values() { + return values(Expander.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ExtendedLocation.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ExtendedLocation.java new file mode 100644 index 000000000000..1e8aedc4e940 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ExtendedLocation.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The complex type of the extended location. + */ +@Fluent +public final class ExtendedLocation implements JsonSerializable { + /* + * The name of the extended location. + */ + private String name; + + /* + * The type of the extended location. + */ + private ExtendedLocationTypes type; + + /** + * Creates an instance of ExtendedLocation class. + */ + public ExtendedLocation() { + } + + /** + * Get the name property: The name of the extended location. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the extended location. + * + * @param name the name value to set. + * @return the ExtendedLocation object itself. + */ + public ExtendedLocation withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The type of the extended location. + * + * @return the type value. + */ + public ExtendedLocationTypes type() { + return this.type; + } + + /** + * Set the type property: The type of the extended location. + * + * @param type the type value to set. + * @return the ExtendedLocation object itself. + */ + public ExtendedLocation withType(ExtendedLocationTypes type) { + this.type = type; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExtendedLocation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExtendedLocation if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ExtendedLocation. + */ + public static ExtendedLocation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExtendedLocation deserializedExtendedLocation = new ExtendedLocation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedExtendedLocation.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedExtendedLocation.type = ExtendedLocationTypes.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedExtendedLocation; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ExtendedLocationTypes.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ExtendedLocationTypes.java new file mode 100644 index 000000000000..a8e4d8b9e372 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ExtendedLocationTypes.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The type of extendedLocation. + */ +public final class ExtendedLocationTypes extends ExpandableStringEnum { + /** + * Azure Edge Zone extended location type. + */ + public static final ExtendedLocationTypes EDGE_ZONE = fromString("EdgeZone"); + + /** + * Creates a new instance of ExtendedLocationTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExtendedLocationTypes() { + } + + /** + * Creates or finds a ExtendedLocationTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExtendedLocationTypes. + */ + public static ExtendedLocationTypes fromString(String name) { + return fromString(name, ExtendedLocationTypes.class); + } + + /** + * Gets known ExtendedLocationTypes values. + * + * @return known ExtendedLocationTypes values. + */ + public static Collection values() { + return values(ExtendedLocationTypes.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Format.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Format.java new file mode 100644 index 000000000000..c5b3806af09d --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Format.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The format of the kubeconfig credential. + */ +public final class Format extends ExpandableStringEnum { + /** + * 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 final Format AZURE = fromString("azure"); + + /** + * Return exec format kubeconfig. This format requires kubelogin binary in the path. + */ + public static final Format EXEC = fromString("exec"); + + /** + * Creates a new instance of Format value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Format() { + } + + /** + * Creates or finds a Format from its string representation. + * + * @param name a name to look for. + * @return the corresponding Format. + */ + public static Format fromString(String name) { + return fromString(name, Format.class); + } + + /** + * Gets known Format values. + * + * @return known Format values. + */ + public static Collection values() { + return values(Format.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/GPUDriver.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/GPUDriver.java new file mode 100644 index 000000000000..7c3d0feb956e --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/GPUDriver.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Whether to install GPU drivers. When it's not specified, default is Install. + */ +public final class GPUDriver extends ExpandableStringEnum { + /** + * Install driver. + */ + public static final GPUDriver INSTALL = fromString("Install"); + + /** + * Skip driver install. + */ + public static final GPUDriver NONE = fromString("None"); + + /** + * Creates a new instance of GPUDriver value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public GPUDriver() { + } + + /** + * Creates or finds a GPUDriver from its string representation. + * + * @param name a name to look for. + * @return the corresponding GPUDriver. + */ + public static GPUDriver fromString(String name) { + return fromString(name, GPUDriver.class); + } + + /** + * Gets known GPUDriver values. + * + * @return known GPUDriver values. + */ + public static Collection values() { + return values(GPUDriver.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/GPUInstanceProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/GPUInstanceProfile.java new file mode 100644 index 000000000000..f4de089ead13 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/GPUInstanceProfile.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. + */ +public final class GPUInstanceProfile extends ExpandableStringEnum { + /** + * MIG 1g GPU instance profile. + */ + public static final GPUInstanceProfile MIG1G = fromString("MIG1g"); + + /** + * MIG 2g GPU instance profile. + */ + public static final GPUInstanceProfile MIG2G = fromString("MIG2g"); + + /** + * MIG 3g GPU instance profile. + */ + public static final GPUInstanceProfile MIG3G = fromString("MIG3g"); + + /** + * MIG 4g GPU instance profile. + */ + public static final GPUInstanceProfile MIG4G = fromString("MIG4g"); + + /** + * MIG 7g GPU instance profile. + */ + public static final GPUInstanceProfile MIG7G = fromString("MIG7g"); + + /** + * Creates a new instance of GPUInstanceProfile value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public GPUInstanceProfile() { + } + + /** + * Creates or finds a GPUInstanceProfile from its string representation. + * + * @param name a name to look for. + * @return the corresponding GPUInstanceProfile. + */ + public static GPUInstanceProfile fromString(String name) { + return fromString(name, GPUInstanceProfile.class); + } + + /** + * Gets known GPUInstanceProfile values. + * + * @return known GPUInstanceProfile values. + */ + public static Collection values() { + return values(GPUInstanceProfile.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/GPUProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/GPUProfile.java new file mode 100644 index 000000000000..14225530e99f --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/GPUProfile.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * GPU settings for the Agent Pool. + */ +@Fluent +public final class GPUProfile implements JsonSerializable { + /* + * Whether to install GPU drivers. When it's not specified, default is Install. + */ + private GPUDriver driver; + + /** + * Creates an instance of GPUProfile class. + */ + public GPUProfile() { + } + + /** + * Get the driver property: Whether to install GPU drivers. When it's not specified, default is Install. + * + * @return the driver value. + */ + public GPUDriver driver() { + return this.driver; + } + + /** + * Set the driver property: Whether to install GPU drivers. When it's not specified, default is Install. + * + * @param driver the driver value to set. + * @return the GPUProfile object itself. + */ + public GPUProfile withDriver(GPUDriver driver) { + this.driver = driver; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("driver", this.driver == null ? null : this.driver.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GPUProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GPUProfile if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the GPUProfile. + */ + public static GPUProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GPUProfile deserializedGPUProfile = new GPUProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("driver".equals(fieldName)) { + deserializedGPUProfile.driver = GPUDriver.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedGPUProfile; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/IPFamily.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/IPFamily.java new file mode 100644 index 000000000000..be2a8d857b3b --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/IPFamily.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * To determine if address belongs IPv4 or IPv6 family. + */ +public final class IPFamily extends ExpandableStringEnum { + /** + * IPv4 family. + */ + public static final IPFamily IPV4 = fromString("IPv4"); + + /** + * IPv6 family. + */ + public static final IPFamily IPV6 = fromString("IPv6"); + + /** + * Creates a new instance of IPFamily value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IPFamily() { + } + + /** + * Creates or finds a IPFamily from its string representation. + * + * @param name a name to look for. + * @return the corresponding IPFamily. + */ + public static IPFamily fromString(String name) { + return fromString(name, IPFamily.class); + } + + /** + * Gets known IPFamily values. + * + * @return known IPFamily values. + */ + public static Collection values() { + return values(IPFamily.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/IPTag.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/IPTag.java new file mode 100644 index 000000000000..5a7f642fd3b1 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/IPTag.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Contains the IPTag associated with the object. + */ +@Fluent +public final class IPTag implements JsonSerializable { + /* + * The IP tag type. Example: RoutingPreference. + */ + private String ipTagType; + + /* + * The value of the IP tag associated with the public IP. Example: Internet. + */ + private String tag; + + /** + * Creates an instance of IPTag class. + */ + public IPTag() { + } + + /** + * Get the ipTagType property: The IP tag type. Example: RoutingPreference. + * + * @return the ipTagType value. + */ + public String ipTagType() { + return this.ipTagType; + } + + /** + * Set the ipTagType property: The IP tag type. Example: RoutingPreference. + * + * @param ipTagType the ipTagType value to set. + * @return the IPTag object itself. + */ + public IPTag withIpTagType(String ipTagType) { + this.ipTagType = ipTagType; + return this; + } + + /** + * Get the tag property: The value of the IP tag associated with the public IP. Example: Internet. + * + * @return the tag value. + */ + public String tag() { + return this.tag; + } + + /** + * Set the tag property: The value of the IP tag associated with the public IP. Example: Internet. + * + * @param tag the tag value to set. + * @return the IPTag object itself. + */ + public IPTag withTag(String tag) { + this.tag = tag; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ipTagType", this.ipTagType); + jsonWriter.writeStringField("tag", this.tag); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IPTag from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IPTag if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the IPTag. + */ + public static IPTag fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IPTag deserializedIPTag = new IPTag(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ipTagType".equals(fieldName)) { + deserializedIPTag.ipTagType = reader.getString(); + } else if ("tag".equals(fieldName)) { + deserializedIPTag.tag = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIPTag; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/IstioCertificateAuthority.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/IstioCertificateAuthority.java new file mode 100644 index 000000000000..e0d894e312ac --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/IstioCertificateAuthority.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Istio Service Mesh Certificate Authority (CA) configuration. For now, we only support plugin certificates as + * described here https://aka.ms/asm-plugin-ca. + */ +@Fluent +public final class IstioCertificateAuthority implements JsonSerializable { + /* + * Plugin certificates information for Service Mesh. + */ + private IstioPluginCertificateAuthority plugin; + + /** + * Creates an instance of IstioCertificateAuthority class. + */ + public IstioCertificateAuthority() { + } + + /** + * Get the plugin property: Plugin certificates information for Service Mesh. + * + * @return the plugin value. + */ + public IstioPluginCertificateAuthority plugin() { + return this.plugin; + } + + /** + * Set the plugin property: Plugin certificates information for Service Mesh. + * + * @param plugin the plugin value to set. + * @return the IstioCertificateAuthority object itself. + */ + public IstioCertificateAuthority withPlugin(IstioPluginCertificateAuthority plugin) { + this.plugin = plugin; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("plugin", this.plugin); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IstioCertificateAuthority from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IstioCertificateAuthority if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the IstioCertificateAuthority. + */ + public static IstioCertificateAuthority fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IstioCertificateAuthority deserializedIstioCertificateAuthority = new IstioCertificateAuthority(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("plugin".equals(fieldName)) { + deserializedIstioCertificateAuthority.plugin = IstioPluginCertificateAuthority.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedIstioCertificateAuthority; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/IstioComponents.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/IstioComponents.java new file mode 100644 index 000000000000..80d3e8e2b7de --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/IstioComponents.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Istio components configuration. + */ +@Fluent +public final class IstioComponents implements JsonSerializable { + /* + * Istio ingress gateways. + */ + private List ingressGateways; + + /* + * Istio egress gateways. + */ + private List egressGateways; + + /* + * Mode of traffic redirection. + */ + private ProxyRedirectionMechanism proxyRedirectionMechanism; + + /** + * Creates an instance of IstioComponents class. + */ + public IstioComponents() { + } + + /** + * Get the ingressGateways property: Istio ingress gateways. + * + * @return the ingressGateways value. + */ + public List ingressGateways() { + return this.ingressGateways; + } + + /** + * Set the ingressGateways property: Istio ingress gateways. + * + * @param ingressGateways the ingressGateways value to set. + * @return the IstioComponents object itself. + */ + public IstioComponents withIngressGateways(List ingressGateways) { + this.ingressGateways = ingressGateways; + return this; + } + + /** + * Get the egressGateways property: Istio egress gateways. + * + * @return the egressGateways value. + */ + public List egressGateways() { + return this.egressGateways; + } + + /** + * Set the egressGateways property: Istio egress gateways. + * + * @param egressGateways the egressGateways value to set. + * @return the IstioComponents object itself. + */ + public IstioComponents withEgressGateways(List egressGateways) { + this.egressGateways = egressGateways; + return this; + } + + /** + * Get the proxyRedirectionMechanism property: Mode of traffic redirection. + * + * @return the proxyRedirectionMechanism value. + */ + public ProxyRedirectionMechanism proxyRedirectionMechanism() { + return this.proxyRedirectionMechanism; + } + + /** + * Set the proxyRedirectionMechanism property: Mode of traffic redirection. + * + * @param proxyRedirectionMechanism the proxyRedirectionMechanism value to set. + * @return the IstioComponents object itself. + */ + public IstioComponents withProxyRedirectionMechanism(ProxyRedirectionMechanism proxyRedirectionMechanism) { + this.proxyRedirectionMechanism = proxyRedirectionMechanism; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("ingressGateways", this.ingressGateways, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("egressGateways", this.egressGateways, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("proxyRedirectionMechanism", + this.proxyRedirectionMechanism == null ? null : this.proxyRedirectionMechanism.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IstioComponents from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IstioComponents if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the IstioComponents. + */ + public static IstioComponents fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IstioComponents deserializedIstioComponents = new IstioComponents(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ingressGateways".equals(fieldName)) { + List ingressGateways + = reader.readArray(reader1 -> IstioIngressGateway.fromJson(reader1)); + deserializedIstioComponents.ingressGateways = ingressGateways; + } else if ("egressGateways".equals(fieldName)) { + List egressGateways + = reader.readArray(reader1 -> IstioEgressGateway.fromJson(reader1)); + deserializedIstioComponents.egressGateways = egressGateways; + } else if ("proxyRedirectionMechanism".equals(fieldName)) { + deserializedIstioComponents.proxyRedirectionMechanism + = ProxyRedirectionMechanism.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedIstioComponents; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/IstioEgressGateway.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/IstioEgressGateway.java new file mode 100644 index 000000000000..af46d8d23dce --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/IstioEgressGateway.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Istio egress gateway configuration. + */ +@Fluent +public final class IstioEgressGateway implements JsonSerializable { + /* + * Whether to enable the egress gateway. + */ + private boolean enabled; + + /* + * Name of the Istio add-on egress gateway. + */ + private String name; + + /* + * Namespace that the Istio add-on egress gateway should be deployed in. If unspecified, the default is + * aks-istio-egress. + */ + private String namespace; + + /* + * Name of the gateway configuration custom resource for the Istio add-on egress gateway. Must be specified when + * enabling the Istio egress gateway. Must be deployed in the same namespace that the Istio egress gateway will be + * deployed in. + */ + private String gatewayConfigurationName; + + /** + * Creates an instance of IstioEgressGateway class. + */ + public IstioEgressGateway() { + } + + /** + * Get the enabled property: Whether to enable the egress gateway. + * + * @return the enabled value. + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Whether to enable the egress gateway. + * + * @param enabled the enabled value to set. + * @return the IstioEgressGateway object itself. + */ + public IstioEgressGateway withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the name property: Name of the Istio add-on egress gateway. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the Istio add-on egress gateway. + * + * @param name the name value to set. + * @return the IstioEgressGateway object itself. + */ + public IstioEgressGateway withName(String name) { + this.name = name; + return this; + } + + /** + * Get the namespace property: Namespace that the Istio add-on egress gateway should be deployed in. If unspecified, + * the default is aks-istio-egress. + * + * @return the namespace value. + */ + public String namespace() { + return this.namespace; + } + + /** + * Set the namespace property: Namespace that the Istio add-on egress gateway should be deployed in. If unspecified, + * the default is aks-istio-egress. + * + * @param namespace the namespace value to set. + * @return the IstioEgressGateway object itself. + */ + public IstioEgressGateway withNamespace(String namespace) { + this.namespace = namespace; + return this; + } + + /** + * Get the gatewayConfigurationName property: Name of the gateway configuration custom resource for the Istio add-on + * egress gateway. Must be specified when enabling the Istio egress gateway. Must be deployed in the same namespace + * that the Istio egress gateway will be deployed in. + * + * @return the gatewayConfigurationName value. + */ + public String gatewayConfigurationName() { + return this.gatewayConfigurationName; + } + + /** + * Set the gatewayConfigurationName property: Name of the gateway configuration custom resource for the Istio add-on + * egress gateway. Must be specified when enabling the Istio egress gateway. Must be deployed in the same namespace + * that the Istio egress gateway will be deployed in. + * + * @param gatewayConfigurationName the gatewayConfigurationName value to set. + * @return the IstioEgressGateway object itself. + */ + public IstioEgressGateway withGatewayConfigurationName(String gatewayConfigurationName) { + this.gatewayConfigurationName = gatewayConfigurationName; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("namespace", this.namespace); + jsonWriter.writeStringField("gatewayConfigurationName", this.gatewayConfigurationName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IstioEgressGateway from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IstioEgressGateway if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the IstioEgressGateway. + */ + public static IstioEgressGateway fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IstioEgressGateway deserializedIstioEgressGateway = new IstioEgressGateway(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedIstioEgressGateway.enabled = reader.getBoolean(); + } else if ("name".equals(fieldName)) { + deserializedIstioEgressGateway.name = reader.getString(); + } else if ("namespace".equals(fieldName)) { + deserializedIstioEgressGateway.namespace = reader.getString(); + } else if ("gatewayConfigurationName".equals(fieldName)) { + deserializedIstioEgressGateway.gatewayConfigurationName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIstioEgressGateway; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/IstioIngressGateway.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/IstioIngressGateway.java new file mode 100644 index 000000000000..c7f7c8f9617f --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/IstioIngressGateway.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * 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`. + */ +@Fluent +public final class IstioIngressGateway implements JsonSerializable { + /* + * Mode of an ingress gateway. + */ + private IstioIngressGatewayMode mode; + + /* + * Whether to enable the ingress gateway. + */ + private boolean enabled; + + /** + * Creates an instance of IstioIngressGateway class. + */ + public IstioIngressGateway() { + } + + /** + * Get the mode property: Mode of an ingress gateway. + * + * @return the mode value. + */ + public IstioIngressGatewayMode mode() { + return this.mode; + } + + /** + * Set the mode property: Mode of an ingress gateway. + * + * @param mode the mode value to set. + * @return the IstioIngressGateway object itself. + */ + public IstioIngressGateway withMode(IstioIngressGatewayMode mode) { + this.mode = mode; + return this; + } + + /** + * Get the enabled property: Whether to enable the ingress gateway. + * + * @return the enabled value. + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Whether to enable the ingress gateway. + * + * @param enabled the enabled value to set. + * @return the IstioIngressGateway object itself. + */ + public IstioIngressGateway withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + jsonWriter.writeBooleanField("enabled", this.enabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IstioIngressGateway from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IstioIngressGateway if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the IstioIngressGateway. + */ + public static IstioIngressGateway fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IstioIngressGateway deserializedIstioIngressGateway = new IstioIngressGateway(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("mode".equals(fieldName)) { + deserializedIstioIngressGateway.mode = IstioIngressGatewayMode.fromString(reader.getString()); + } else if ("enabled".equals(fieldName)) { + deserializedIstioIngressGateway.enabled = reader.getBoolean(); + } else { + reader.skipChildren(); + } + } + + return deserializedIstioIngressGateway; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/IstioIngressGatewayMode.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/IstioIngressGatewayMode.java new file mode 100644 index 000000000000..f6dc1e6536af --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/IstioIngressGatewayMode.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Mode of an ingress gateway. + */ +public final class IstioIngressGatewayMode extends ExpandableStringEnum { + /** + * The ingress gateway is assigned a public IP address and is publicly accessible. + */ + public static final IstioIngressGatewayMode EXTERNAL = fromString("External"); + + /** + * The ingress gateway is assigned an internal IP address and cannot is accessed publicly. + */ + public static final IstioIngressGatewayMode INTERNAL = fromString("Internal"); + + /** + * Creates a new instance of IstioIngressGatewayMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IstioIngressGatewayMode() { + } + + /** + * Creates or finds a IstioIngressGatewayMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding IstioIngressGatewayMode. + */ + public static IstioIngressGatewayMode fromString(String name) { + return fromString(name, IstioIngressGatewayMode.class); + } + + /** + * Gets known IstioIngressGatewayMode values. + * + * @return known IstioIngressGatewayMode values. + */ + public static Collection values() { + return values(IstioIngressGatewayMode.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/IstioPluginCertificateAuthority.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/IstioPluginCertificateAuthority.java new file mode 100644 index 000000000000..5d4a9516c1a4 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/IstioPluginCertificateAuthority.java @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Plugin certificates information for Service Mesh. + */ +@Fluent +public final class IstioPluginCertificateAuthority implements JsonSerializable { + /* + * The resource ID of the Key Vault. + */ + private String keyVaultId; + + /* + * Intermediate certificate object name in Azure Key Vault. + */ + private String certObjectName; + + /* + * Intermediate certificate private key object name in Azure Key Vault. + */ + private String keyObjectName; + + /* + * Root certificate object name in Azure Key Vault. + */ + private String rootCertObjectName; + + /* + * Certificate chain object name in Azure Key Vault. + */ + private String certChainObjectName; + + /** + * Creates an instance of IstioPluginCertificateAuthority class. + */ + public IstioPluginCertificateAuthority() { + } + + /** + * Get the keyVaultId property: The resource ID of the Key Vault. + * + * @return the keyVaultId value. + */ + public String keyVaultId() { + return this.keyVaultId; + } + + /** + * Set the keyVaultId property: The resource ID of the Key Vault. + * + * @param keyVaultId the keyVaultId value to set. + * @return the IstioPluginCertificateAuthority object itself. + */ + public IstioPluginCertificateAuthority withKeyVaultId(String keyVaultId) { + this.keyVaultId = keyVaultId; + return this; + } + + /** + * Get the certObjectName property: Intermediate certificate object name in Azure Key Vault. + * + * @return the certObjectName value. + */ + public String certObjectName() { + return this.certObjectName; + } + + /** + * Set the certObjectName property: Intermediate certificate object name in Azure Key Vault. + * + * @param certObjectName the certObjectName value to set. + * @return the IstioPluginCertificateAuthority object itself. + */ + public IstioPluginCertificateAuthority withCertObjectName(String certObjectName) { + this.certObjectName = certObjectName; + return this; + } + + /** + * Get the keyObjectName property: Intermediate certificate private key object name in Azure Key Vault. + * + * @return the keyObjectName value. + */ + public String keyObjectName() { + return this.keyObjectName; + } + + /** + * Set the keyObjectName property: Intermediate certificate private key object name in Azure Key Vault. + * + * @param keyObjectName the keyObjectName value to set. + * @return the IstioPluginCertificateAuthority object itself. + */ + public IstioPluginCertificateAuthority withKeyObjectName(String keyObjectName) { + this.keyObjectName = keyObjectName; + return this; + } + + /** + * Get the rootCertObjectName property: Root certificate object name in Azure Key Vault. + * + * @return the rootCertObjectName value. + */ + public String rootCertObjectName() { + return this.rootCertObjectName; + } + + /** + * Set the rootCertObjectName property: Root certificate object name in Azure Key Vault. + * + * @param rootCertObjectName the rootCertObjectName value to set. + * @return the IstioPluginCertificateAuthority object itself. + */ + public IstioPluginCertificateAuthority withRootCertObjectName(String rootCertObjectName) { + this.rootCertObjectName = rootCertObjectName; + return this; + } + + /** + * Get the certChainObjectName property: Certificate chain object name in Azure Key Vault. + * + * @return the certChainObjectName value. + */ + public String certChainObjectName() { + return this.certChainObjectName; + } + + /** + * Set the certChainObjectName property: Certificate chain object name in Azure Key Vault. + * + * @param certChainObjectName the certChainObjectName value to set. + * @return the IstioPluginCertificateAuthority object itself. + */ + public IstioPluginCertificateAuthority withCertChainObjectName(String certChainObjectName) { + this.certChainObjectName = certChainObjectName; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("keyVaultId", this.keyVaultId); + jsonWriter.writeStringField("certObjectName", this.certObjectName); + jsonWriter.writeStringField("keyObjectName", this.keyObjectName); + jsonWriter.writeStringField("rootCertObjectName", this.rootCertObjectName); + jsonWriter.writeStringField("certChainObjectName", this.certChainObjectName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IstioPluginCertificateAuthority from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IstioPluginCertificateAuthority if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the IstioPluginCertificateAuthority. + */ + public static IstioPluginCertificateAuthority fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IstioPluginCertificateAuthority deserializedIstioPluginCertificateAuthority + = new IstioPluginCertificateAuthority(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyVaultId".equals(fieldName)) { + deserializedIstioPluginCertificateAuthority.keyVaultId = reader.getString(); + } else if ("certObjectName".equals(fieldName)) { + deserializedIstioPluginCertificateAuthority.certObjectName = reader.getString(); + } else if ("keyObjectName".equals(fieldName)) { + deserializedIstioPluginCertificateAuthority.keyObjectName = reader.getString(); + } else if ("rootCertObjectName".equals(fieldName)) { + deserializedIstioPluginCertificateAuthority.rootCertObjectName = reader.getString(); + } else if ("certChainObjectName".equals(fieldName)) { + deserializedIstioPluginCertificateAuthority.certChainObjectName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIstioPluginCertificateAuthority; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/IstioServiceMesh.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/IstioServiceMesh.java new file mode 100644 index 000000000000..58cd8d627c78 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/IstioServiceMesh.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Istio service mesh configuration. + */ +@Fluent +public final class IstioServiceMesh implements JsonSerializable { + /* + * Istio components configuration. + */ + private IstioComponents components; + + /* + * Istio Service Mesh Certificate Authority (CA) configuration. For now, we only support plugin certificates as + * described here https://aka.ms/asm-plugin-ca + */ + private IstioCertificateAuthority certificateAuthority; + + /* + * 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 + */ + private List revisions; + + /** + * Creates an instance of IstioServiceMesh class. + */ + public IstioServiceMesh() { + } + + /** + * Get the components property: Istio components configuration. + * + * @return the components value. + */ + public IstioComponents components() { + return this.components; + } + + /** + * Set the components property: Istio components configuration. + * + * @param components the components value to set. + * @return the IstioServiceMesh object itself. + */ + public IstioServiceMesh withComponents(IstioComponents components) { + this.components = components; + return this; + } + + /** + * Get the certificateAuthority property: Istio Service Mesh Certificate Authority (CA) configuration. For now, we + * only support plugin certificates as described here https://aka.ms/asm-plugin-ca. + * + * @return the certificateAuthority value. + */ + public IstioCertificateAuthority certificateAuthority() { + return this.certificateAuthority; + } + + /** + * Set the certificateAuthority property: Istio Service Mesh Certificate Authority (CA) configuration. For now, we + * only support plugin certificates as described here https://aka.ms/asm-plugin-ca. + * + * @param certificateAuthority the certificateAuthority value to set. + * @return the IstioServiceMesh object itself. + */ + public IstioServiceMesh withCertificateAuthority(IstioCertificateAuthority certificateAuthority) { + this.certificateAuthority = certificateAuthority; + return this; + } + + /** + * Get the revisions property: 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. + * + * @return the revisions value. + */ + public List revisions() { + return this.revisions; + } + + /** + * Set the revisions property: 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. + * + * @param revisions the revisions value to set. + * @return the IstioServiceMesh object itself. + */ + public IstioServiceMesh withRevisions(List revisions) { + this.revisions = revisions; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("components", this.components); + jsonWriter.writeJsonField("certificateAuthority", this.certificateAuthority); + jsonWriter.writeArrayField("revisions", this.revisions, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IstioServiceMesh from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IstioServiceMesh if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the IstioServiceMesh. + */ + public static IstioServiceMesh fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IstioServiceMesh deserializedIstioServiceMesh = new IstioServiceMesh(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("components".equals(fieldName)) { + deserializedIstioServiceMesh.components = IstioComponents.fromJson(reader); + } else if ("certificateAuthority".equals(fieldName)) { + deserializedIstioServiceMesh.certificateAuthority = IstioCertificateAuthority.fromJson(reader); + } else if ("revisions".equals(fieldName)) { + List revisions = reader.readArray(reader1 -> reader1.getString()); + deserializedIstioServiceMesh.revisions = revisions; + } else { + reader.skipChildren(); + } + } + + return deserializedIstioServiceMesh; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/KeyVaultNetworkAccessTypes.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/KeyVaultNetworkAccessTypes.java new file mode 100644 index 000000000000..cd7a74d49367 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/KeyVaultNetworkAccessTypes.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Network access of the key vault. 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 final class KeyVaultNetworkAccessTypes extends ExpandableStringEnum { + /** + * Key vault allows public access from all networks. + */ + public static final KeyVaultNetworkAccessTypes PUBLIC = fromString("Public"); + + /** + * Key vault disables public access and enables private link. + */ + public static final KeyVaultNetworkAccessTypes PRIVATE = fromString("Private"); + + /** + * Creates a new instance of KeyVaultNetworkAccessTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public KeyVaultNetworkAccessTypes() { + } + + /** + * Creates or finds a KeyVaultNetworkAccessTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding KeyVaultNetworkAccessTypes. + */ + public static KeyVaultNetworkAccessTypes fromString(String name) { + return fromString(name, KeyVaultNetworkAccessTypes.class); + } + + /** + * Gets known KeyVaultNetworkAccessTypes values. + * + * @return known KeyVaultNetworkAccessTypes values. + */ + public static Collection values() { + return values(KeyVaultNetworkAccessTypes.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/KubeletConfig.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/KubeletConfig.java new file mode 100644 index 000000000000..f03d9fc45ad3 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/KubeletConfig.java @@ -0,0 +1,401 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Kubelet configurations of agent nodes. See [AKS custom node + * configuration](https://docs.microsoft.com/azure/aks/custom-node-configuration) for more details. + */ +@Fluent +public final class KubeletConfig implements JsonSerializable { + /* + * The CPU Manager policy to use. 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'. + */ + private String cpuManagerPolicy; + + /* + * If CPU CFS quota enforcement is enabled for containers that specify CPU limits. The default is true. + */ + private Boolean cpuCfsQuota; + + /* + * The CPU CFS quota period value. 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'. + */ + private String cpuCfsQuotaPeriod; + + /* + * The percent of disk usage after which image garbage collection is always run. To disable image garbage + * collection, set to 100. The default is 85% + */ + private Integer imageGcHighThreshold; + + /* + * The percent of disk usage before which image garbage collection is never run. This cannot be set higher than + * imageGcHighThreshold. The default is 80% + */ + private Integer imageGcLowThreshold; + + /* + * The Topology Manager policy to use. 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'. + */ + private String topologyManagerPolicy; + + /* + * Allowed list of unsafe sysctls or unsafe sysctl patterns (ending in `*`). + */ + private List allowedUnsafeSysctls; + + /* + * If set to true it will make the Kubelet fail to start if swap is enabled on the node. + */ + private Boolean failSwapOn; + + /* + * The maximum size (e.g. 10Mi) of container log file before it is rotated. + */ + private Integer containerLogMaxSizeMB; + + /* + * The maximum number of container log files that can be present for a container. The number must be ≥ 2. + */ + private Integer containerLogMaxFiles; + + /* + * The maximum number of processes per pod. + */ + private Integer podMaxPids; + + /** + * Creates an instance of KubeletConfig class. + */ + public KubeletConfig() { + } + + /** + * Get the cpuManagerPolicy property: The CPU Manager policy to use. 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'. + * + * @return the cpuManagerPolicy value. + */ + public String cpuManagerPolicy() { + return this.cpuManagerPolicy; + } + + /** + * Set the cpuManagerPolicy property: The CPU Manager policy to use. 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'. + * + * @param cpuManagerPolicy the cpuManagerPolicy value to set. + * @return the KubeletConfig object itself. + */ + public KubeletConfig withCpuManagerPolicy(String cpuManagerPolicy) { + this.cpuManagerPolicy = cpuManagerPolicy; + return this; + } + + /** + * Get the cpuCfsQuota property: If CPU CFS quota enforcement is enabled for containers that specify CPU limits. The + * default is true. + * + * @return the cpuCfsQuota value. + */ + public Boolean cpuCfsQuota() { + return this.cpuCfsQuota; + } + + /** + * Set the cpuCfsQuota property: If CPU CFS quota enforcement is enabled for containers that specify CPU limits. The + * default is true. + * + * @param cpuCfsQuota the cpuCfsQuota value to set. + * @return the KubeletConfig object itself. + */ + public KubeletConfig withCpuCfsQuota(Boolean cpuCfsQuota) { + this.cpuCfsQuota = cpuCfsQuota; + return this; + } + + /** + * Get the cpuCfsQuotaPeriod property: The CPU CFS quota period value. 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'. + * + * @return the cpuCfsQuotaPeriod value. + */ + public String cpuCfsQuotaPeriod() { + return this.cpuCfsQuotaPeriod; + } + + /** + * Set the cpuCfsQuotaPeriod property: The CPU CFS quota period value. 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'. + * + * @param cpuCfsQuotaPeriod the cpuCfsQuotaPeriod value to set. + * @return the KubeletConfig object itself. + */ + public KubeletConfig withCpuCfsQuotaPeriod(String cpuCfsQuotaPeriod) { + this.cpuCfsQuotaPeriod = cpuCfsQuotaPeriod; + return this; + } + + /** + * Get the imageGcHighThreshold property: The percent of disk usage after which image garbage collection is always + * run. To disable image garbage collection, set to 100. The default is 85%. + * + * @return the imageGcHighThreshold value. + */ + public Integer imageGcHighThreshold() { + return this.imageGcHighThreshold; + } + + /** + * Set the imageGcHighThreshold property: The percent of disk usage after which image garbage collection is always + * run. To disable image garbage collection, set to 100. The default is 85%. + * + * @param imageGcHighThreshold the imageGcHighThreshold value to set. + * @return the KubeletConfig object itself. + */ + public KubeletConfig withImageGcHighThreshold(Integer imageGcHighThreshold) { + this.imageGcHighThreshold = imageGcHighThreshold; + return this; + } + + /** + * Get the imageGcLowThreshold property: The percent of disk usage before which image garbage collection is never + * run. This cannot be set higher than imageGcHighThreshold. The default is 80%. + * + * @return the imageGcLowThreshold value. + */ + public Integer imageGcLowThreshold() { + return this.imageGcLowThreshold; + } + + /** + * Set the imageGcLowThreshold property: The percent of disk usage before which image garbage collection is never + * run. This cannot be set higher than imageGcHighThreshold. The default is 80%. + * + * @param imageGcLowThreshold the imageGcLowThreshold value to set. + * @return the KubeletConfig object itself. + */ + public KubeletConfig withImageGcLowThreshold(Integer imageGcLowThreshold) { + this.imageGcLowThreshold = imageGcLowThreshold; + return this; + } + + /** + * Get the topologyManagerPolicy property: The Topology Manager policy to use. 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'. + * + * @return the topologyManagerPolicy value. + */ + public String topologyManagerPolicy() { + return this.topologyManagerPolicy; + } + + /** + * Set the topologyManagerPolicy property: The Topology Manager policy to use. 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'. + * + * @param topologyManagerPolicy the topologyManagerPolicy value to set. + * @return the KubeletConfig object itself. + */ + public KubeletConfig withTopologyManagerPolicy(String topologyManagerPolicy) { + this.topologyManagerPolicy = topologyManagerPolicy; + return this; + } + + /** + * Get the allowedUnsafeSysctls property: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending in `*`). + * + * @return the allowedUnsafeSysctls value. + */ + public List allowedUnsafeSysctls() { + return this.allowedUnsafeSysctls; + } + + /** + * Set the allowedUnsafeSysctls property: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending in `*`). + * + * @param allowedUnsafeSysctls the allowedUnsafeSysctls value to set. + * @return the KubeletConfig object itself. + */ + public KubeletConfig withAllowedUnsafeSysctls(List allowedUnsafeSysctls) { + this.allowedUnsafeSysctls = allowedUnsafeSysctls; + return this; + } + + /** + * Get the failSwapOn property: If set to true it will make the Kubelet fail to start if swap is enabled on the + * node. + * + * @return the failSwapOn value. + */ + public Boolean failSwapOn() { + return this.failSwapOn; + } + + /** + * Set the failSwapOn property: If set to true it will make the Kubelet fail to start if swap is enabled on the + * node. + * + * @param failSwapOn the failSwapOn value to set. + * @return the KubeletConfig object itself. + */ + public KubeletConfig withFailSwapOn(Boolean failSwapOn) { + this.failSwapOn = failSwapOn; + return this; + } + + /** + * Get the containerLogMaxSizeMB property: The maximum size (e.g. 10Mi) of container log file before it is rotated. + * + * @return the containerLogMaxSizeMB value. + */ + public Integer containerLogMaxSizeMB() { + return this.containerLogMaxSizeMB; + } + + /** + * Set the containerLogMaxSizeMB property: The maximum size (e.g. 10Mi) of container log file before it is rotated. + * + * @param containerLogMaxSizeMB the containerLogMaxSizeMB value to set. + * @return the KubeletConfig object itself. + */ + public KubeletConfig withContainerLogMaxSizeMB(Integer containerLogMaxSizeMB) { + this.containerLogMaxSizeMB = containerLogMaxSizeMB; + return this; + } + + /** + * Get the containerLogMaxFiles property: The maximum number of container log files that can be present for a + * container. The number must be ≥ 2. + * + * @return the containerLogMaxFiles value. + */ + public Integer containerLogMaxFiles() { + return this.containerLogMaxFiles; + } + + /** + * Set the containerLogMaxFiles property: The maximum number of container log files that can be present for a + * container. The number must be ≥ 2. + * + * @param containerLogMaxFiles the containerLogMaxFiles value to set. + * @return the KubeletConfig object itself. + */ + public KubeletConfig withContainerLogMaxFiles(Integer containerLogMaxFiles) { + this.containerLogMaxFiles = containerLogMaxFiles; + return this; + } + + /** + * Get the podMaxPids property: The maximum number of processes per pod. + * + * @return the podMaxPids value. + */ + public Integer podMaxPids() { + return this.podMaxPids; + } + + /** + * Set the podMaxPids property: The maximum number of processes per pod. + * + * @param podMaxPids the podMaxPids value to set. + * @return the KubeletConfig object itself. + */ + public KubeletConfig withPodMaxPids(Integer podMaxPids) { + this.podMaxPids = podMaxPids; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("cpuManagerPolicy", this.cpuManagerPolicy); + jsonWriter.writeBooleanField("cpuCfsQuota", this.cpuCfsQuota); + jsonWriter.writeStringField("cpuCfsQuotaPeriod", this.cpuCfsQuotaPeriod); + jsonWriter.writeNumberField("imageGcHighThreshold", this.imageGcHighThreshold); + jsonWriter.writeNumberField("imageGcLowThreshold", this.imageGcLowThreshold); + jsonWriter.writeStringField("topologyManagerPolicy", this.topologyManagerPolicy); + jsonWriter.writeArrayField("allowedUnsafeSysctls", this.allowedUnsafeSysctls, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("failSwapOn", this.failSwapOn); + jsonWriter.writeNumberField("containerLogMaxSizeMB", this.containerLogMaxSizeMB); + jsonWriter.writeNumberField("containerLogMaxFiles", this.containerLogMaxFiles); + jsonWriter.writeNumberField("podMaxPids", this.podMaxPids); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KubeletConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KubeletConfig if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the KubeletConfig. + */ + public static KubeletConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KubeletConfig deserializedKubeletConfig = new KubeletConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("cpuManagerPolicy".equals(fieldName)) { + deserializedKubeletConfig.cpuManagerPolicy = reader.getString(); + } else if ("cpuCfsQuota".equals(fieldName)) { + deserializedKubeletConfig.cpuCfsQuota = reader.getNullable(JsonReader::getBoolean); + } else if ("cpuCfsQuotaPeriod".equals(fieldName)) { + deserializedKubeletConfig.cpuCfsQuotaPeriod = reader.getString(); + } else if ("imageGcHighThreshold".equals(fieldName)) { + deserializedKubeletConfig.imageGcHighThreshold = reader.getNullable(JsonReader::getInt); + } else if ("imageGcLowThreshold".equals(fieldName)) { + deserializedKubeletConfig.imageGcLowThreshold = reader.getNullable(JsonReader::getInt); + } else if ("topologyManagerPolicy".equals(fieldName)) { + deserializedKubeletConfig.topologyManagerPolicy = reader.getString(); + } else if ("allowedUnsafeSysctls".equals(fieldName)) { + List allowedUnsafeSysctls = reader.readArray(reader1 -> reader1.getString()); + deserializedKubeletConfig.allowedUnsafeSysctls = allowedUnsafeSysctls; + } else if ("failSwapOn".equals(fieldName)) { + deserializedKubeletConfig.failSwapOn = reader.getNullable(JsonReader::getBoolean); + } else if ("containerLogMaxSizeMB".equals(fieldName)) { + deserializedKubeletConfig.containerLogMaxSizeMB = reader.getNullable(JsonReader::getInt); + } else if ("containerLogMaxFiles".equals(fieldName)) { + deserializedKubeletConfig.containerLogMaxFiles = reader.getNullable(JsonReader::getInt); + } else if ("podMaxPids".equals(fieldName)) { + deserializedKubeletConfig.podMaxPids = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedKubeletConfig; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/KubeletDiskType.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/KubeletDiskType.java new file mode 100644 index 000000000000..c2748b9ce88b --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/KubeletDiskType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. + */ +public final class KubeletDiskType extends ExpandableStringEnum { + /** + * Kubelet will use the OS disk for its data. + */ + public static final KubeletDiskType OS = fromString("OS"); + + /** + * Kubelet will use the temporary disk for its data. + */ + public static final KubeletDiskType TEMPORARY = fromString("Temporary"); + + /** + * Creates a new instance of KubeletDiskType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public KubeletDiskType() { + } + + /** + * Creates or finds a KubeletDiskType from its string representation. + * + * @param name a name to look for. + * @return the corresponding KubeletDiskType. + */ + public static KubeletDiskType fromString(String name) { + return fromString(name, KubeletDiskType.class); + } + + /** + * Gets known KubeletDiskType values. + * + * @return known KubeletDiskType values. + */ + public static Collection values() { + return values(KubeletDiskType.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/KubernetesPatchVersion.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/KubernetesPatchVersion.java new file mode 100644 index 000000000000..20bcf845ba3d --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/KubernetesPatchVersion.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Kubernetes patch version profile. + */ +@Immutable +public final class KubernetesPatchVersion implements JsonSerializable { + /* + * Possible upgrade path for given patch version + */ + private List upgrades; + + /** + * Creates an instance of KubernetesPatchVersion class. + */ + private KubernetesPatchVersion() { + } + + /** + * Get the upgrades property: Possible upgrade path for given patch version. + * + * @return the upgrades value. + */ + public List upgrades() { + return this.upgrades; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("upgrades", this.upgrades, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KubernetesPatchVersion from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KubernetesPatchVersion if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the KubernetesPatchVersion. + */ + public static KubernetesPatchVersion fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KubernetesPatchVersion deserializedKubernetesPatchVersion = new KubernetesPatchVersion(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("upgrades".equals(fieldName)) { + List upgrades = reader.readArray(reader1 -> reader1.getString()); + deserializedKubernetesPatchVersion.upgrades = upgrades; + } else { + reader.skipChildren(); + } + } + + return deserializedKubernetesPatchVersion; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/KubernetesSupportPlan.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/KubernetesSupportPlan.java new file mode 100644 index 000000000000..f06b63d646a8 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/KubernetesSupportPlan.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Different support tiers for AKS managed clusters. + */ +public final class KubernetesSupportPlan extends ExpandableStringEnum { + /** + * 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 final KubernetesSupportPlan KUBERNETES_OFFICIAL = fromString("KubernetesOfficial"); + + /** + * 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 final KubernetesSupportPlan AKSLONG_TERM_SUPPORT = fromString("AKSLongTermSupport"); + + /** + * Creates a new instance of KubernetesSupportPlan value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public KubernetesSupportPlan() { + } + + /** + * Creates or finds a KubernetesSupportPlan from its string representation. + * + * @param name a name to look for. + * @return the corresponding KubernetesSupportPlan. + */ + public static KubernetesSupportPlan fromString(String name) { + return fromString(name, KubernetesSupportPlan.class); + } + + /** + * Gets known KubernetesSupportPlan values. + * + * @return known KubernetesSupportPlan values. + */ + public static Collection values() { + return values(KubernetesSupportPlan.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/KubernetesVersion.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/KubernetesVersion.java new file mode 100644 index 000000000000..e38d536dc6c6 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/KubernetesVersion.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Kubernetes version profile for given major.minor release. + */ +@Immutable +public final class KubernetesVersion implements JsonSerializable { + /* + * major.minor version of Kubernetes release + */ + private String version; + + /* + * Capabilities on this Kubernetes version. + */ + private KubernetesVersionCapabilities capabilities; + + /* + * Whether this version is default. + */ + private Boolean isDefault; + + /* + * Whether this version is in preview mode. + */ + private Boolean isPreview; + + /* + * Patch versions of Kubernetes release + */ + private Map patchVersions; + + /** + * Creates an instance of KubernetesVersion class. + */ + private KubernetesVersion() { + } + + /** + * Get the version property: major.minor version of Kubernetes release. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Get the capabilities property: Capabilities on this Kubernetes version. + * + * @return the capabilities value. + */ + public KubernetesVersionCapabilities capabilities() { + return this.capabilities; + } + + /** + * Get the isDefault property: Whether this version is default. + * + * @return the isDefault value. + */ + public Boolean isDefault() { + return this.isDefault; + } + + /** + * Get the isPreview property: Whether this version is in preview mode. + * + * @return the isPreview value. + */ + public Boolean isPreview() { + return this.isPreview; + } + + /** + * Get the patchVersions property: Patch versions of Kubernetes release. + * + * @return the patchVersions value. + */ + public Map patchVersions() { + return this.patchVersions; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("version", this.version); + jsonWriter.writeJsonField("capabilities", this.capabilities); + jsonWriter.writeBooleanField("isDefault", this.isDefault); + jsonWriter.writeBooleanField("isPreview", this.isPreview); + jsonWriter.writeMapField("patchVersions", this.patchVersions, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KubernetesVersion from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KubernetesVersion if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the KubernetesVersion. + */ + public static KubernetesVersion fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KubernetesVersion deserializedKubernetesVersion = new KubernetesVersion(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("version".equals(fieldName)) { + deserializedKubernetesVersion.version = reader.getString(); + } else if ("capabilities".equals(fieldName)) { + deserializedKubernetesVersion.capabilities = KubernetesVersionCapabilities.fromJson(reader); + } else if ("isDefault".equals(fieldName)) { + deserializedKubernetesVersion.isDefault = reader.getNullable(JsonReader::getBoolean); + } else if ("isPreview".equals(fieldName)) { + deserializedKubernetesVersion.isPreview = reader.getNullable(JsonReader::getBoolean); + } else if ("patchVersions".equals(fieldName)) { + Map patchVersions + = reader.readMap(reader1 -> KubernetesPatchVersion.fromJson(reader1)); + deserializedKubernetesVersion.patchVersions = patchVersions; + } else { + reader.skipChildren(); + } + } + + return deserializedKubernetesVersion; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/KubernetesVersionCapabilities.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/KubernetesVersionCapabilities.java new file mode 100644 index 000000000000..fe10a40ac0bd --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/KubernetesVersionCapabilities.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Capabilities on this Kubernetes version. + */ +@Immutable +public final class KubernetesVersionCapabilities implements JsonSerializable { + /* + * Kubernetes support plans available for this version. + */ + private List supportPlan; + + /** + * Creates an instance of KubernetesVersionCapabilities class. + */ + private KubernetesVersionCapabilities() { + } + + /** + * Get the supportPlan property: Kubernetes support plans available for this version. + * + * @return the supportPlan value. + */ + public List supportPlan() { + return this.supportPlan; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("supportPlan", this.supportPlan, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KubernetesVersionCapabilities from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KubernetesVersionCapabilities if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the KubernetesVersionCapabilities. + */ + public static KubernetesVersionCapabilities fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KubernetesVersionCapabilities deserializedKubernetesVersionCapabilities + = new KubernetesVersionCapabilities(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("supportPlan".equals(fieldName)) { + List supportPlan + = reader.readArray(reader1 -> KubernetesSupportPlan.fromString(reader1.getString())); + deserializedKubernetesVersionCapabilities.supportPlan = supportPlan; + } else { + reader.skipChildren(); + } + } + + return deserializedKubernetesVersionCapabilities; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/KubernetesVersionListResult.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/KubernetesVersionListResult.java new file mode 100644 index 000000000000..c8c3eaabb708 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/KubernetesVersionListResult.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.KubernetesVersionListResultInner; +import java.util.List; + +/** + * An immutable client-side representation of KubernetesVersionListResult. + */ +public interface KubernetesVersionListResult { + /** + * Gets the values property: Array of AKS supported Kubernetes versions. + * + * @return the values value. + */ + List values(); + + /** + * Gets the inner + * com.azure.resourcemanager.containerservice.generated.fluent.models.KubernetesVersionListResultInner object. + * + * @return the inner object. + */ + KubernetesVersionListResultInner innerModel(); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LicenseType.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LicenseType.java new file mode 100644 index 000000000000..e5a3a555e89e --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LicenseType.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * 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 final class LicenseType extends ExpandableStringEnum { + /** + * No additional licensing is applied. + */ + public static final LicenseType NONE = fromString("None"); + + /** + * Enables Azure Hybrid User Benefits for Windows VMs. + */ + public static final LicenseType WINDOWS_SERVER = fromString("Windows_Server"); + + /** + * Creates a new instance of LicenseType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LicenseType() { + } + + /** + * Creates or finds a LicenseType from its string representation. + * + * @param name a name to look for. + * @return the corresponding LicenseType. + */ + public static LicenseType fromString(String name) { + return fromString(name, LicenseType.class); + } + + /** + * Gets known LicenseType values. + * + * @return known LicenseType values. + */ + public static Collection values() { + return values(LicenseType.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LinuxOSConfig.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LinuxOSConfig.java new file mode 100644 index 000000000000..3696ec513b9d --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LinuxOSConfig.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * OS configurations of Linux agent nodes. See [AKS custom node + * configuration](https://docs.microsoft.com/azure/aks/custom-node-configuration) for more details. + */ +@Fluent +public final class LinuxOSConfig implements JsonSerializable { + /* + * Sysctl settings for Linux agent nodes. + */ + private SysctlConfig sysctls; + + /* + * Whether transparent hugepages are enabled. 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). + */ + private String transparentHugePageEnabled; + + /* + * Whether the kernel should make aggressive use of memory compaction to make more hugepages available. 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). + */ + private String transparentHugePageDefrag; + + /* + * The size in MB of a swap file that will be created on each node. + */ + private Integer swapFileSizeMB; + + /** + * Creates an instance of LinuxOSConfig class. + */ + public LinuxOSConfig() { + } + + /** + * Get the sysctls property: Sysctl settings for Linux agent nodes. + * + * @return the sysctls value. + */ + public SysctlConfig sysctls() { + return this.sysctls; + } + + /** + * Set the sysctls property: Sysctl settings for Linux agent nodes. + * + * @param sysctls the sysctls value to set. + * @return the LinuxOSConfig object itself. + */ + public LinuxOSConfig withSysctls(SysctlConfig sysctls) { + this.sysctls = sysctls; + return this; + } + + /** + * Get the transparentHugePageEnabled property: Whether transparent hugepages are enabled. 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). + * + * @return the transparentHugePageEnabled value. + */ + public String transparentHugePageEnabled() { + return this.transparentHugePageEnabled; + } + + /** + * Set the transparentHugePageEnabled property: Whether transparent hugepages are enabled. 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). + * + * @param transparentHugePageEnabled the transparentHugePageEnabled value to set. + * @return the LinuxOSConfig object itself. + */ + public LinuxOSConfig withTransparentHugePageEnabled(String transparentHugePageEnabled) { + this.transparentHugePageEnabled = transparentHugePageEnabled; + return this; + } + + /** + * Get the transparentHugePageDefrag property: Whether the kernel should make aggressive use of memory compaction to + * make more hugepages available. 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). + * + * @return the transparentHugePageDefrag value. + */ + public String transparentHugePageDefrag() { + return this.transparentHugePageDefrag; + } + + /** + * Set the transparentHugePageDefrag property: Whether the kernel should make aggressive use of memory compaction to + * make more hugepages available. 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). + * + * @param transparentHugePageDefrag the transparentHugePageDefrag value to set. + * @return the LinuxOSConfig object itself. + */ + public LinuxOSConfig withTransparentHugePageDefrag(String transparentHugePageDefrag) { + this.transparentHugePageDefrag = transparentHugePageDefrag; + return this; + } + + /** + * Get the swapFileSizeMB property: The size in MB of a swap file that will be created on each node. + * + * @return the swapFileSizeMB value. + */ + public Integer swapFileSizeMB() { + return this.swapFileSizeMB; + } + + /** + * Set the swapFileSizeMB property: The size in MB of a swap file that will be created on each node. + * + * @param swapFileSizeMB the swapFileSizeMB value to set. + * @return the LinuxOSConfig object itself. + */ + public LinuxOSConfig withSwapFileSizeMB(Integer swapFileSizeMB) { + this.swapFileSizeMB = swapFileSizeMB; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("sysctls", this.sysctls); + jsonWriter.writeStringField("transparentHugePageEnabled", this.transparentHugePageEnabled); + jsonWriter.writeStringField("transparentHugePageDefrag", this.transparentHugePageDefrag); + jsonWriter.writeNumberField("swapFileSizeMB", this.swapFileSizeMB); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LinuxOSConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LinuxOSConfig if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the LinuxOSConfig. + */ + public static LinuxOSConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LinuxOSConfig deserializedLinuxOSConfig = new LinuxOSConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sysctls".equals(fieldName)) { + deserializedLinuxOSConfig.sysctls = SysctlConfig.fromJson(reader); + } else if ("transparentHugePageEnabled".equals(fieldName)) { + deserializedLinuxOSConfig.transparentHugePageEnabled = reader.getString(); + } else if ("transparentHugePageDefrag".equals(fieldName)) { + deserializedLinuxOSConfig.transparentHugePageDefrag = reader.getString(); + } else if ("swapFileSizeMB".equals(fieldName)) { + deserializedLinuxOSConfig.swapFileSizeMB = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedLinuxOSConfig; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LoadBalancerSku.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LoadBalancerSku.java new file mode 100644 index 000000000000..ea3f596a9714 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LoadBalancerSku.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The load balancer sku for the managed cluster. 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 final class LoadBalancerSku extends ExpandableStringEnum { + /** + * 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 final LoadBalancerSku STANDARD = fromString("standard"); + + /** + * Use a basic Load Balancer with limited functionality. + */ + public static final LoadBalancerSku BASIC = fromString("basic"); + + /** + * Creates a new instance of LoadBalancerSku value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LoadBalancerSku() { + } + + /** + * Creates or finds a LoadBalancerSku from its string representation. + * + * @param name a name to look for. + * @return the corresponding LoadBalancerSku. + */ + public static LoadBalancerSku fromString(String name) { + return fromString(name, LoadBalancerSku.class); + } + + /** + * Gets known LoadBalancerSku values. + * + * @return known LoadBalancerSku values. + */ + public static Collection values() { + return values(LoadBalancerSku.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LocalDNSForwardDestination.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LocalDNSForwardDestination.java new file mode 100644 index 000000000000..641450559289 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LocalDNSForwardDestination.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Destination server for DNS queries to be forwarded from localDNS. + */ +public final class LocalDNSForwardDestination extends ExpandableStringEnum { + /** + * Forward DNS queries from localDNS to cluster CoreDNS. + */ + public static final LocalDNSForwardDestination CLUSTER_CORE_DNS = fromString("ClusterCoreDNS"); + + /** + * Forward DNS queries from localDNS to DNS server configured in the VNET. A VNET can have multiple DNS servers + * configured. + */ + public static final LocalDNSForwardDestination VNET_DNS = fromString("VnetDNS"); + + /** + * Creates a new instance of LocalDNSForwardDestination value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LocalDNSForwardDestination() { + } + + /** + * Creates or finds a LocalDNSForwardDestination from its string representation. + * + * @param name a name to look for. + * @return the corresponding LocalDNSForwardDestination. + */ + public static LocalDNSForwardDestination fromString(String name) { + return fromString(name, LocalDNSForwardDestination.class); + } + + /** + * Gets known LocalDNSForwardDestination values. + * + * @return known LocalDNSForwardDestination values. + */ + public static Collection values() { + return values(LocalDNSForwardDestination.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LocalDNSForwardPolicy.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LocalDNSForwardPolicy.java new file mode 100644 index 000000000000..a7a329a195f4 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LocalDNSForwardPolicy.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Forward policy for selecting upstream DNS server. See [forward plugin](https://coredns.io/plugins/forward) for more + * information. + */ +public final class LocalDNSForwardPolicy extends ExpandableStringEnum { + /** + * Implements sequential upstream DNS server selection. See [forward plugin](https://coredns.io/plugins/forward) for + * more information. + */ + public static final LocalDNSForwardPolicy SEQUENTIAL = fromString("Sequential"); + + /** + * Implements round robin upstream DNS server selection. See [forward plugin](https://coredns.io/plugins/forward) + * for more information. + */ + public static final LocalDNSForwardPolicy ROUND_ROBIN = fromString("RoundRobin"); + + /** + * Implements random upstream DNS server selection. See [forward plugin](https://coredns.io/plugins/forward) for + * more information. + */ + public static final LocalDNSForwardPolicy RANDOM = fromString("Random"); + + /** + * Creates a new instance of LocalDNSForwardPolicy value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LocalDNSForwardPolicy() { + } + + /** + * Creates or finds a LocalDNSForwardPolicy from its string representation. + * + * @param name a name to look for. + * @return the corresponding LocalDNSForwardPolicy. + */ + public static LocalDNSForwardPolicy fromString(String name) { + return fromString(name, LocalDNSForwardPolicy.class); + } + + /** + * Gets known LocalDNSForwardPolicy values. + * + * @return known LocalDNSForwardPolicy values. + */ + public static Collection values() { + return values(LocalDNSForwardPolicy.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LocalDNSMode.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LocalDNSMode.java new file mode 100644 index 000000000000..2f6adf60c878 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LocalDNSMode.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Mode of enablement for localDNS. + */ +public final class LocalDNSMode extends ExpandableStringEnum { + /** + * If the current orchestrator version supports this feature, prefer enabling localDNS. + */ + public static final LocalDNSMode PREFERRED = fromString("Preferred"); + + /** + * Enable localDNS. + */ + public static final LocalDNSMode REQUIRED = fromString("Required"); + + /** + * Disable localDNS. + */ + public static final LocalDNSMode DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of LocalDNSMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LocalDNSMode() { + } + + /** + * Creates or finds a LocalDNSMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding LocalDNSMode. + */ + public static LocalDNSMode fromString(String name) { + return fromString(name, LocalDNSMode.class); + } + + /** + * Gets known LocalDNSMode values. + * + * @return known LocalDNSMode values. + */ + public static Collection values() { + return values(LocalDNSMode.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LocalDNSOverride.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LocalDNSOverride.java new file mode 100644 index 000000000000..90911025eb36 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LocalDNSOverride.java @@ -0,0 +1,297 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Overrides for localDNS profile. + */ +@Fluent +public final class LocalDNSOverride implements JsonSerializable { + /* + * Log level for DNS queries in localDNS. + */ + private LocalDNSQueryLogging queryLogging; + + /* + * Enforce TCP or prefer UDP protocol for connections from localDNS to upstream DNS server. + */ + private LocalDNSProtocol protocol; + + /* + * Destination server for DNS queries to be forwarded from localDNS. + */ + private LocalDNSForwardDestination forwardDestination; + + /* + * Forward policy for selecting upstream DNS server. See [forward plugin](https://coredns.io/plugins/forward) for + * more information. + */ + private LocalDNSForwardPolicy forwardPolicy; + + /* + * Maximum number of concurrent queries. See [forward plugin](https://coredns.io/plugins/forward) for more + * information. + */ + private Integer maxConcurrent; + + /* + * Cache max TTL in seconds. See [cache plugin](https://coredns.io/plugins/cache) for more information. + */ + private Integer cacheDurationInSeconds; + + /* + * Serve stale duration in seconds. See [cache plugin](https://coredns.io/plugins/cache) for more information. + */ + private Integer serveStaleDurationInSeconds; + + /* + * Policy for serving stale data. See [cache plugin](https://coredns.io/plugins/cache) for more information. + */ + private LocalDNSServeStale serveStale; + + /** + * Creates an instance of LocalDNSOverride class. + */ + public LocalDNSOverride() { + } + + /** + * Get the queryLogging property: Log level for DNS queries in localDNS. + * + * @return the queryLogging value. + */ + public LocalDNSQueryLogging queryLogging() { + return this.queryLogging; + } + + /** + * Set the queryLogging property: Log level for DNS queries in localDNS. + * + * @param queryLogging the queryLogging value to set. + * @return the LocalDNSOverride object itself. + */ + public LocalDNSOverride withQueryLogging(LocalDNSQueryLogging queryLogging) { + this.queryLogging = queryLogging; + return this; + } + + /** + * Get the protocol property: Enforce TCP or prefer UDP protocol for connections from localDNS to upstream DNS + * server. + * + * @return the protocol value. + */ + public LocalDNSProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: Enforce TCP or prefer UDP protocol for connections from localDNS to upstream DNS + * server. + * + * @param protocol the protocol value to set. + * @return the LocalDNSOverride object itself. + */ + public LocalDNSOverride withProtocol(LocalDNSProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the forwardDestination property: Destination server for DNS queries to be forwarded from localDNS. + * + * @return the forwardDestination value. + */ + public LocalDNSForwardDestination forwardDestination() { + return this.forwardDestination; + } + + /** + * Set the forwardDestination property: Destination server for DNS queries to be forwarded from localDNS. + * + * @param forwardDestination the forwardDestination value to set. + * @return the LocalDNSOverride object itself. + */ + public LocalDNSOverride withForwardDestination(LocalDNSForwardDestination forwardDestination) { + this.forwardDestination = forwardDestination; + return this; + } + + /** + * Get the forwardPolicy property: Forward policy for selecting upstream DNS server. See [forward + * plugin](https://coredns.io/plugins/forward) for more information. + * + * @return the forwardPolicy value. + */ + public LocalDNSForwardPolicy forwardPolicy() { + return this.forwardPolicy; + } + + /** + * Set the forwardPolicy property: Forward policy for selecting upstream DNS server. See [forward + * plugin](https://coredns.io/plugins/forward) for more information. + * + * @param forwardPolicy the forwardPolicy value to set. + * @return the LocalDNSOverride object itself. + */ + public LocalDNSOverride withForwardPolicy(LocalDNSForwardPolicy forwardPolicy) { + this.forwardPolicy = forwardPolicy; + return this; + } + + /** + * Get the maxConcurrent property: Maximum number of concurrent queries. See [forward + * plugin](https://coredns.io/plugins/forward) for more information. + * + * @return the maxConcurrent value. + */ + public Integer maxConcurrent() { + return this.maxConcurrent; + } + + /** + * Set the maxConcurrent property: Maximum number of concurrent queries. See [forward + * plugin](https://coredns.io/plugins/forward) for more information. + * + * @param maxConcurrent the maxConcurrent value to set. + * @return the LocalDNSOverride object itself. + */ + public LocalDNSOverride withMaxConcurrent(Integer maxConcurrent) { + this.maxConcurrent = maxConcurrent; + return this; + } + + /** + * Get the cacheDurationInSeconds property: Cache max TTL in seconds. See [cache + * plugin](https://coredns.io/plugins/cache) for more information. + * + * @return the cacheDurationInSeconds value. + */ + public Integer cacheDurationInSeconds() { + return this.cacheDurationInSeconds; + } + + /** + * Set the cacheDurationInSeconds property: Cache max TTL in seconds. See [cache + * plugin](https://coredns.io/plugins/cache) for more information. + * + * @param cacheDurationInSeconds the cacheDurationInSeconds value to set. + * @return the LocalDNSOverride object itself. + */ + public LocalDNSOverride withCacheDurationInSeconds(Integer cacheDurationInSeconds) { + this.cacheDurationInSeconds = cacheDurationInSeconds; + return this; + } + + /** + * Get the serveStaleDurationInSeconds property: Serve stale duration in seconds. See [cache + * plugin](https://coredns.io/plugins/cache) for more information. + * + * @return the serveStaleDurationInSeconds value. + */ + public Integer serveStaleDurationInSeconds() { + return this.serveStaleDurationInSeconds; + } + + /** + * Set the serveStaleDurationInSeconds property: Serve stale duration in seconds. See [cache + * plugin](https://coredns.io/plugins/cache) for more information. + * + * @param serveStaleDurationInSeconds the serveStaleDurationInSeconds value to set. + * @return the LocalDNSOverride object itself. + */ + public LocalDNSOverride withServeStaleDurationInSeconds(Integer serveStaleDurationInSeconds) { + this.serveStaleDurationInSeconds = serveStaleDurationInSeconds; + return this; + } + + /** + * Get the serveStale property: Policy for serving stale data. See [cache plugin](https://coredns.io/plugins/cache) + * for more information. + * + * @return the serveStale value. + */ + public LocalDNSServeStale serveStale() { + return this.serveStale; + } + + /** + * Set the serveStale property: Policy for serving stale data. See [cache plugin](https://coredns.io/plugins/cache) + * for more information. + * + * @param serveStale the serveStale value to set. + * @return the LocalDNSOverride object itself. + */ + public LocalDNSOverride withServeStale(LocalDNSServeStale serveStale) { + this.serveStale = serveStale; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("queryLogging", this.queryLogging == null ? null : this.queryLogging.toString()); + jsonWriter.writeStringField("protocol", this.protocol == null ? null : this.protocol.toString()); + jsonWriter.writeStringField("forwardDestination", + this.forwardDestination == null ? null : this.forwardDestination.toString()); + jsonWriter.writeStringField("forwardPolicy", this.forwardPolicy == null ? null : this.forwardPolicy.toString()); + jsonWriter.writeNumberField("maxConcurrent", this.maxConcurrent); + jsonWriter.writeNumberField("cacheDurationInSeconds", this.cacheDurationInSeconds); + jsonWriter.writeNumberField("serveStaleDurationInSeconds", this.serveStaleDurationInSeconds); + jsonWriter.writeStringField("serveStale", this.serveStale == null ? null : this.serveStale.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LocalDNSOverride from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LocalDNSOverride if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the LocalDNSOverride. + */ + public static LocalDNSOverride fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LocalDNSOverride deserializedLocalDNSOverride = new LocalDNSOverride(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("queryLogging".equals(fieldName)) { + deserializedLocalDNSOverride.queryLogging = LocalDNSQueryLogging.fromString(reader.getString()); + } else if ("protocol".equals(fieldName)) { + deserializedLocalDNSOverride.protocol = LocalDNSProtocol.fromString(reader.getString()); + } else if ("forwardDestination".equals(fieldName)) { + deserializedLocalDNSOverride.forwardDestination + = LocalDNSForwardDestination.fromString(reader.getString()); + } else if ("forwardPolicy".equals(fieldName)) { + deserializedLocalDNSOverride.forwardPolicy = LocalDNSForwardPolicy.fromString(reader.getString()); + } else if ("maxConcurrent".equals(fieldName)) { + deserializedLocalDNSOverride.maxConcurrent = reader.getNullable(JsonReader::getInt); + } else if ("cacheDurationInSeconds".equals(fieldName)) { + deserializedLocalDNSOverride.cacheDurationInSeconds = reader.getNullable(JsonReader::getInt); + } else if ("serveStaleDurationInSeconds".equals(fieldName)) { + deserializedLocalDNSOverride.serveStaleDurationInSeconds = reader.getNullable(JsonReader::getInt); + } else if ("serveStale".equals(fieldName)) { + deserializedLocalDNSOverride.serveStale = LocalDNSServeStale.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedLocalDNSOverride; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LocalDNSProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LocalDNSProfile.java new file mode 100644 index 000000000000..3f90f8349db1 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LocalDNSProfile.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Configures the per-node local DNS, with VnetDNS and KubeDNS overrides. LocalDNS helps improve performance and + * reliability of DNS resolution in an AKS cluster. For more details see aka.ms/aks/localdns. + */ +@Fluent +public final class LocalDNSProfile implements JsonSerializable { + /* + * Mode of enablement for localDNS. + */ + private LocalDNSMode mode; + + /* + * System-generated state of localDNS. + */ + private LocalDNSState state; + + /* + * VnetDNS overrides apply to DNS traffic from pods with dnsPolicy:default or kubelet (referred to as VnetDNS + * traffic). + */ + private Map vnetDNSOverrides; + + /* + * KubeDNS overrides apply to DNS traffic from pods with dnsPolicy:ClusterFirst (referred to as KubeDNS traffic). + */ + private Map kubeDNSOverrides; + + /** + * Creates an instance of LocalDNSProfile class. + */ + public LocalDNSProfile() { + } + + /** + * Get the mode property: Mode of enablement for localDNS. + * + * @return the mode value. + */ + public LocalDNSMode mode() { + return this.mode; + } + + /** + * Set the mode property: Mode of enablement for localDNS. + * + * @param mode the mode value to set. + * @return the LocalDNSProfile object itself. + */ + public LocalDNSProfile withMode(LocalDNSMode mode) { + this.mode = mode; + return this; + } + + /** + * Get the state property: System-generated state of localDNS. + * + * @return the state value. + */ + public LocalDNSState state() { + return this.state; + } + + /** + * Get the vnetDNSOverrides property: VnetDNS overrides apply to DNS traffic from pods with dnsPolicy:default or + * kubelet (referred to as VnetDNS traffic). + * + * @return the vnetDNSOverrides value. + */ + public Map vnetDNSOverrides() { + return this.vnetDNSOverrides; + } + + /** + * Set the vnetDNSOverrides property: VnetDNS overrides apply to DNS traffic from pods with dnsPolicy:default or + * kubelet (referred to as VnetDNS traffic). + * + * @param vnetDNSOverrides the vnetDNSOverrides value to set. + * @return the LocalDNSProfile object itself. + */ + public LocalDNSProfile withVnetDNSOverrides(Map vnetDNSOverrides) { + this.vnetDNSOverrides = vnetDNSOverrides; + return this; + } + + /** + * Get the kubeDNSOverrides property: KubeDNS overrides apply to DNS traffic from pods with dnsPolicy:ClusterFirst + * (referred to as KubeDNS traffic). + * + * @return the kubeDNSOverrides value. + */ + public Map kubeDNSOverrides() { + return this.kubeDNSOverrides; + } + + /** + * Set the kubeDNSOverrides property: KubeDNS overrides apply to DNS traffic from pods with dnsPolicy:ClusterFirst + * (referred to as KubeDNS traffic). + * + * @param kubeDNSOverrides the kubeDNSOverrides value to set. + * @return the LocalDNSProfile object itself. + */ + public LocalDNSProfile withKubeDNSOverrides(Map kubeDNSOverrides) { + this.kubeDNSOverrides = kubeDNSOverrides; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + jsonWriter.writeMapField("vnetDNSOverrides", this.vnetDNSOverrides, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeMapField("kubeDNSOverrides", this.kubeDNSOverrides, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LocalDNSProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LocalDNSProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the LocalDNSProfile. + */ + public static LocalDNSProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LocalDNSProfile deserializedLocalDNSProfile = new LocalDNSProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("mode".equals(fieldName)) { + deserializedLocalDNSProfile.mode = LocalDNSMode.fromString(reader.getString()); + } else if ("state".equals(fieldName)) { + deserializedLocalDNSProfile.state = LocalDNSState.fromString(reader.getString()); + } else if ("vnetDNSOverrides".equals(fieldName)) { + Map vnetDNSOverrides + = reader.readMap(reader1 -> LocalDNSOverride.fromJson(reader1)); + deserializedLocalDNSProfile.vnetDNSOverrides = vnetDNSOverrides; + } else if ("kubeDNSOverrides".equals(fieldName)) { + Map kubeDNSOverrides + = reader.readMap(reader1 -> LocalDNSOverride.fromJson(reader1)); + deserializedLocalDNSProfile.kubeDNSOverrides = kubeDNSOverrides; + } else { + reader.skipChildren(); + } + } + + return deserializedLocalDNSProfile; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LocalDNSProtocol.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LocalDNSProtocol.java new file mode 100644 index 000000000000..1b67e2f6c48a --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LocalDNSProtocol.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enforce TCP or prefer UDP protocol for connections from localDNS to upstream DNS server. + */ +public final class LocalDNSProtocol extends ExpandableStringEnum { + /** + * Prefer UDP protocol for connections from localDNS to upstream DNS server. + */ + public static final LocalDNSProtocol PREFER_UDP = fromString("PreferUDP"); + + /** + * Enforce TCP protocol for connections from localDNS to upstream DNS server. + */ + public static final LocalDNSProtocol FORCE_TCP = fromString("ForceTCP"); + + /** + * Creates a new instance of LocalDNSProtocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LocalDNSProtocol() { + } + + /** + * Creates or finds a LocalDNSProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding LocalDNSProtocol. + */ + public static LocalDNSProtocol fromString(String name) { + return fromString(name, LocalDNSProtocol.class); + } + + /** + * Gets known LocalDNSProtocol values. + * + * @return known LocalDNSProtocol values. + */ + public static Collection values() { + return values(LocalDNSProtocol.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LocalDNSQueryLogging.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LocalDNSQueryLogging.java new file mode 100644 index 000000000000..9aa71e47be1a --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LocalDNSQueryLogging.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Log level for DNS queries in localDNS. + */ +public final class LocalDNSQueryLogging extends ExpandableStringEnum { + /** + * Enables error logging in localDNS. See [errors plugin](https://coredns.io/plugins/errors) for more information. + */ + public static final LocalDNSQueryLogging ERROR = fromString("Error"); + + /** + * Enables query logging in localDNS. See [log plugin](https://coredns.io/plugins/log) for more information. + */ + public static final LocalDNSQueryLogging LOG = fromString("Log"); + + /** + * Creates a new instance of LocalDNSQueryLogging value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LocalDNSQueryLogging() { + } + + /** + * Creates or finds a LocalDNSQueryLogging from its string representation. + * + * @param name a name to look for. + * @return the corresponding LocalDNSQueryLogging. + */ + public static LocalDNSQueryLogging fromString(String name) { + return fromString(name, LocalDNSQueryLogging.class); + } + + /** + * Gets known LocalDNSQueryLogging values. + * + * @return known LocalDNSQueryLogging values. + */ + public static Collection values() { + return values(LocalDNSQueryLogging.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LocalDNSServeStale.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LocalDNSServeStale.java new file mode 100644 index 000000000000..9d7e5e42c66f --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LocalDNSServeStale.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Policy for serving stale data. See [cache plugin](https://coredns.io/plugins/cache) for more information. + */ +public final class LocalDNSServeStale extends ExpandableStringEnum { + /** + * Serve stale data with verification. First verify that an entry is still unavailable from the source before + * sending the expired entry to the client. See [cache plugin](https://coredns.io/plugins/cache) for more + * information. + */ + public static final LocalDNSServeStale VERIFY = fromString("Verify"); + + /** + * Serve stale data immediately. Send the expired entry to the client before checking to see if the entry is + * available from the source. See [cache plugin](https://coredns.io/plugins/cache) for more information. + */ + public static final LocalDNSServeStale IMMEDIATE = fromString("Immediate"); + + /** + * Disable serving stale data. + */ + public static final LocalDNSServeStale DISABLE = fromString("Disable"); + + /** + * Creates a new instance of LocalDNSServeStale value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LocalDNSServeStale() { + } + + /** + * Creates or finds a LocalDNSServeStale from its string representation. + * + * @param name a name to look for. + * @return the corresponding LocalDNSServeStale. + */ + public static LocalDNSServeStale fromString(String name) { + return fromString(name, LocalDNSServeStale.class); + } + + /** + * Gets known LocalDNSServeStale values. + * + * @return known LocalDNSServeStale values. + */ + public static Collection values() { + return values(LocalDNSServeStale.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LocalDNSState.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LocalDNSState.java new file mode 100644 index 000000000000..895cd1306926 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LocalDNSState.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * System-generated state of localDNS. + */ +public final class LocalDNSState extends ExpandableStringEnum { + /** + * localDNS is enabled. + */ + public static final LocalDNSState ENABLED = fromString("Enabled"); + + /** + * localDNS is disabled. + */ + public static final LocalDNSState DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of LocalDNSState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LocalDNSState() { + } + + /** + * Creates or finds a LocalDNSState from its string representation. + * + * @param name a name to look for. + * @return the corresponding LocalDNSState. + */ + public static LocalDNSState fromString(String name) { + return fromString(name, LocalDNSState.class); + } + + /** + * Gets known LocalDNSState values. + * + * @return known LocalDNSState values. + */ + public static Collection values() { + return values(LocalDNSState.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Machine.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Machine.java new file mode 100644 index 000000000000..cd9c583144b5 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Machine.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.containerservice.generated.fluent.models.MachineInner; +import java.util.List; + +/** + * An immutable client-side representation of Machine. + */ +public interface Machine { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: The properties of the machine. + * + * @return the properties value. + */ + MachineProperties properties(); + + /** + * Gets the zones property: The Availability zone in which machine is located. + * + * @return the zones value. + */ + List zones(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.containerservice.generated.fluent.models.MachineInner object. + * + * @return the inner object. + */ + MachineInner innerModel(); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MachineIpAddress.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MachineIpAddress.java new file mode 100644 index 000000000000..422282292b71 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MachineIpAddress.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The machine IP address details. + */ +@Immutable +public final class MachineIpAddress implements JsonSerializable { + /* + * To determine if address belongs IPv4 or IPv6 family + */ + private IPFamily family; + + /* + * IPv4 or IPv6 address of the machine + */ + private String ip; + + /** + * Creates an instance of MachineIpAddress class. + */ + private MachineIpAddress() { + } + + /** + * Get the family property: To determine if address belongs IPv4 or IPv6 family. + * + * @return the family value. + */ + public IPFamily family() { + return this.family; + } + + /** + * Get the ip property: IPv4 or IPv6 address of the machine. + * + * @return the ip value. + */ + public String ip() { + return this.ip; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MachineIpAddress from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MachineIpAddress if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MachineIpAddress. + */ + public static MachineIpAddress fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MachineIpAddress deserializedMachineIpAddress = new MachineIpAddress(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("family".equals(fieldName)) { + deserializedMachineIpAddress.family = IPFamily.fromString(reader.getString()); + } else if ("ip".equals(fieldName)) { + deserializedMachineIpAddress.ip = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMachineIpAddress; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MachineNetworkProperties.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MachineNetworkProperties.java new file mode 100644 index 000000000000..e818d79761d2 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MachineNetworkProperties.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * network properties of the machine. + */ +@Immutable +public final class MachineNetworkProperties implements JsonSerializable { + /* + * IPv4, IPv6 addresses of the machine + */ + private List ipAddresses; + + /** + * Creates an instance of MachineNetworkProperties class. + */ + private MachineNetworkProperties() { + } + + /** + * Get the ipAddresses property: IPv4, IPv6 addresses of the machine. + * + * @return the ipAddresses value. + */ + public List ipAddresses() { + return this.ipAddresses; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MachineNetworkProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MachineNetworkProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MachineNetworkProperties. + */ + public static MachineNetworkProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MachineNetworkProperties deserializedMachineNetworkProperties = new MachineNetworkProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ipAddresses".equals(fieldName)) { + List ipAddresses + = reader.readArray(reader1 -> MachineIpAddress.fromJson(reader1)); + deserializedMachineNetworkProperties.ipAddresses = ipAddresses; + } else { + reader.skipChildren(); + } + } + + return deserializedMachineNetworkProperties; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MachineProperties.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MachineProperties.java new file mode 100644 index 000000000000..b1533a99a064 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MachineProperties.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The properties of the machine. + */ +@Immutable +public final class MachineProperties implements JsonSerializable { + /* + * network properties of the machine + */ + private MachineNetworkProperties network; + + /* + * Azure resource id of the machine. It can be used to GET underlying VM Instance + */ + private String resourceId; + + /** + * Creates an instance of MachineProperties class. + */ + private MachineProperties() { + } + + /** + * Get the network property: network properties of the machine. + * + * @return the network value. + */ + public MachineNetworkProperties network() { + return this.network; + } + + /** + * Get the resourceId property: Azure resource id of the machine. It can be used to GET underlying VM Instance. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MachineProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MachineProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MachineProperties. + */ + public static MachineProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MachineProperties deserializedMachineProperties = new MachineProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("network".equals(fieldName)) { + deserializedMachineProperties.network = MachineNetworkProperties.fromJson(reader); + } else if ("resourceId".equals(fieldName)) { + deserializedMachineProperties.resourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMachineProperties; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Machines.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Machines.java new file mode 100644 index 000000000000..d2d3120191a3 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Machines.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Machines. + */ +public interface Machines { + /** + * Get a specific machine in the specified agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param machineName Host name of the machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific machine in the specified agent pool along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String resourceName, String agentPoolName, + String machineName, Context context); + + /** + * Get a specific machine in the specified agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param machineName Host name of the machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific machine in the specified agent pool. + */ + Machine get(String resourceGroupName, String resourceName, String agentPoolName, String machineName); + + /** + * Gets a list of machines in the specified agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of machines in the specified agent pool as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String resourceName, String agentPoolName); + + /** + * Gets a list of machines in the specified agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of machines in the specified agent pool as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String resourceName, String agentPoolName, Context context); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MaintenanceConfiguration.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MaintenanceConfiguration.java new file mode 100644 index 000000000000..fc4019613b60 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MaintenanceConfiguration.java @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.fluent.models.MaintenanceConfigurationInner; +import java.util.List; + +/** + * An immutable client-side representation of MaintenanceConfiguration. + */ +public interface MaintenanceConfiguration { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the timeInWeek property: Time slots during the week when planned maintenance is allowed to proceed. If two + * array entries specify the same day of the week, the applied configuration is the union of times in both entries. + * + * @return the timeInWeek value. + */ + List timeInWeek(); + + /** + * Gets the notAllowedTime property: Time slots on which upgrade is not allowed. + * + * @return the notAllowedTime value. + */ + List notAllowedTime(); + + /** + * Gets the maintenanceWindow property: Maintenance window for the maintenance configuration. + * + * @return the maintenanceWindow value. + */ + MaintenanceWindow maintenanceWindow(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.containerservice.generated.fluent.models.MaintenanceConfigurationInner + * object. + * + * @return the inner object. + */ + MaintenanceConfigurationInner innerModel(); + + /** + * The entirety of the MaintenanceConfiguration definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The MaintenanceConfiguration definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the MaintenanceConfiguration definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the MaintenanceConfiguration definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, resourceName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @return the next definition stage. + */ + WithCreate withExistingManagedCluster(String resourceGroupName, String resourceName); + } + + /** + * The stage of the MaintenanceConfiguration definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTimeInWeek, DefinitionStages.WithNotAllowedTime, + DefinitionStages.WithMaintenanceWindow { + /** + * Executes the create request. + * + * @return the created resource. + */ + MaintenanceConfiguration create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + MaintenanceConfiguration create(Context context); + } + + /** + * The stage of the MaintenanceConfiguration definition allowing to specify timeInWeek. + */ + interface WithTimeInWeek { + /** + * Specifies the timeInWeek property: Time slots during the week when planned maintenance is allowed to + * proceed. If two array entries specify the same day of the week, the applied configuration is the union of + * times in both entries.. + * + * @param timeInWeek Time slots during the week when planned maintenance is allowed to proceed. If two array + * entries specify the same day of the week, the applied configuration is the union of times in both + * entries. + * @return the next definition stage. + */ + WithCreate withTimeInWeek(List timeInWeek); + } + + /** + * The stage of the MaintenanceConfiguration definition allowing to specify notAllowedTime. + */ + interface WithNotAllowedTime { + /** + * Specifies the notAllowedTime property: Time slots on which upgrade is not allowed.. + * + * @param notAllowedTime Time slots on which upgrade is not allowed. + * @return the next definition stage. + */ + WithCreate withNotAllowedTime(List notAllowedTime); + } + + /** + * The stage of the MaintenanceConfiguration definition allowing to specify maintenanceWindow. + */ + interface WithMaintenanceWindow { + /** + * Specifies the maintenanceWindow property: Maintenance window for the maintenance configuration.. + * + * @param maintenanceWindow Maintenance window for the maintenance configuration. + * @return the next definition stage. + */ + WithCreate withMaintenanceWindow(MaintenanceWindow maintenanceWindow); + } + } + + /** + * Begins update for the MaintenanceConfiguration resource. + * + * @return the stage of resource update. + */ + MaintenanceConfiguration.Update update(); + + /** + * The template for MaintenanceConfiguration update. + */ + interface Update + extends UpdateStages.WithTimeInWeek, UpdateStages.WithNotAllowedTime, UpdateStages.WithMaintenanceWindow { + /** + * Executes the update request. + * + * @return the updated resource. + */ + MaintenanceConfiguration apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + MaintenanceConfiguration apply(Context context); + } + + /** + * The MaintenanceConfiguration update stages. + */ + interface UpdateStages { + /** + * The stage of the MaintenanceConfiguration update allowing to specify timeInWeek. + */ + interface WithTimeInWeek { + /** + * Specifies the timeInWeek property: Time slots during the week when planned maintenance is allowed to + * proceed. If two array entries specify the same day of the week, the applied configuration is the union of + * times in both entries.. + * + * @param timeInWeek Time slots during the week when planned maintenance is allowed to proceed. If two array + * entries specify the same day of the week, the applied configuration is the union of times in both + * entries. + * @return the next definition stage. + */ + Update withTimeInWeek(List timeInWeek); + } + + /** + * The stage of the MaintenanceConfiguration update allowing to specify notAllowedTime. + */ + interface WithNotAllowedTime { + /** + * Specifies the notAllowedTime property: Time slots on which upgrade is not allowed.. + * + * @param notAllowedTime Time slots on which upgrade is not allowed. + * @return the next definition stage. + */ + Update withNotAllowedTime(List notAllowedTime); + } + + /** + * The stage of the MaintenanceConfiguration update allowing to specify maintenanceWindow. + */ + interface WithMaintenanceWindow { + /** + * Specifies the maintenanceWindow property: Maintenance window for the maintenance configuration.. + * + * @param maintenanceWindow Maintenance window for the maintenance configuration. + * @return the next definition stage. + */ + Update withMaintenanceWindow(MaintenanceWindow maintenanceWindow); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + MaintenanceConfiguration refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + MaintenanceConfiguration refresh(Context context); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MaintenanceConfigurations.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MaintenanceConfigurations.java new file mode 100644 index 000000000000..5315e4e550f4 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MaintenanceConfigurations.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of MaintenanceConfigurations. + */ +public interface MaintenanceConfigurations { + /** + * Gets the specified maintenance configuration of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param configName The name of the maintenance configuration. Supported values are 'default', + * 'aksManagedAutoUpgradeSchedule', or 'aksManagedNodeOSUpgradeSchedule'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified maintenance configuration of a managed cluster along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String resourceName, String configName, + Context context); + + /** + * Gets the specified maintenance configuration of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param configName The name of the maintenance configuration. Supported values are 'default', + * 'aksManagedAutoUpgradeSchedule', or 'aksManagedNodeOSUpgradeSchedule'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified maintenance configuration of a managed cluster. + */ + MaintenanceConfiguration get(String resourceGroupName, String resourceName, String configName); + + /** + * Deletes a maintenance configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param configName The name of the maintenance configuration. Supported values are 'default', + * 'aksManagedAutoUpgradeSchedule', or 'aksManagedNodeOSUpgradeSchedule'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse(String resourceGroupName, String resourceName, String configName, + Context context); + + /** + * Deletes a maintenance configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param configName The name of the maintenance configuration. Supported values are 'default', + * 'aksManagedAutoUpgradeSchedule', or 'aksManagedNodeOSUpgradeSchedule'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String resourceName, String configName); + + /** + * Gets a list of maintenance configurations in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of maintenance configurations in the specified managed cluster as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByManagedCluster(String resourceGroupName, String resourceName); + + /** + * Gets a list of maintenance configurations in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of maintenance configurations in the specified managed cluster as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByManagedCluster(String resourceGroupName, String resourceName, + Context context); + + /** + * Gets the specified maintenance configuration of a managed cluster. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified maintenance configuration of a managed cluster along with {@link Response}. + */ + MaintenanceConfiguration getById(String id); + + /** + * Gets the specified maintenance configuration of a managed cluster. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified maintenance configuration of a managed cluster along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a maintenance configuration. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a maintenance configuration. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new MaintenanceConfiguration resource. + * + * @param name resource name. + * @return the first stage of the new MaintenanceConfiguration definition. + */ + MaintenanceConfiguration.DefinitionStages.Blank define(String name); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MaintenanceWindow.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MaintenanceWindow.java new file mode 100644 index 000000000000..47de5619ae95 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MaintenanceWindow.java @@ -0,0 +1,249 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.LocalDate; +import java.util.List; +import java.util.Objects; + +/** + * Maintenance window used to configure scheduled auto-upgrade for a Managed Cluster. + */ +@Fluent +public final class MaintenanceWindow implements JsonSerializable { + /* + * Recurrence schedule for the maintenance window. + */ + private Schedule schedule; + + /* + * Length of maintenance window range from 4 to 24 hours. + */ + private int durationHours; + + /* + * 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'. + */ + private String utcOffset; + + /* + * 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. + */ + private LocalDate startDate; + + /* + * 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'. + */ + private String startTime; + + /* + * 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. + */ + private List notAllowedDates; + + /** + * Creates an instance of MaintenanceWindow class. + */ + public MaintenanceWindow() { + } + + /** + * Get the schedule property: Recurrence schedule for the maintenance window. + * + * @return the schedule value. + */ + public Schedule schedule() { + return this.schedule; + } + + /** + * Set the schedule property: Recurrence schedule for the maintenance window. + * + * @param schedule the schedule value to set. + * @return the MaintenanceWindow object itself. + */ + public MaintenanceWindow withSchedule(Schedule schedule) { + this.schedule = schedule; + return this; + } + + /** + * Get the durationHours property: Length of maintenance window range from 4 to 24 hours. + * + * @return the durationHours value. + */ + public int durationHours() { + return this.durationHours; + } + + /** + * Set the durationHours property: Length of maintenance window range from 4 to 24 hours. + * + * @param durationHours the durationHours value to set. + * @return the MaintenanceWindow object itself. + */ + public MaintenanceWindow withDurationHours(int durationHours) { + this.durationHours = durationHours; + return this; + } + + /** + * Get the utcOffset property: 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'. + * + * @return the utcOffset value. + */ + public String utcOffset() { + return this.utcOffset; + } + + /** + * Set the utcOffset property: 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'. + * + * @param utcOffset the utcOffset value to set. + * @return the MaintenanceWindow object itself. + */ + public MaintenanceWindow withUtcOffset(String utcOffset) { + this.utcOffset = utcOffset; + return this; + } + + /** + * Get the startDate property: 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. + * + * @return the startDate value. + */ + public LocalDate startDate() { + return this.startDate; + } + + /** + * Set the startDate property: 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. + * + * @param startDate the startDate value to set. + * @return the MaintenanceWindow object itself. + */ + public MaintenanceWindow withStartDate(LocalDate startDate) { + this.startDate = startDate; + return this; + } + + /** + * Get the startTime property: 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'. + * + * @return the startTime value. + */ + public String startTime() { + return this.startTime; + } + + /** + * Set the startTime property: 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'. + * + * @param startTime the startTime value to set. + * @return the MaintenanceWindow object itself. + */ + public MaintenanceWindow withStartTime(String startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the notAllowedDates property: 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. + * + * @return the notAllowedDates value. + */ + public List notAllowedDates() { + return this.notAllowedDates; + } + + /** + * Set the notAllowedDates property: 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. + * + * @param notAllowedDates the notAllowedDates value to set. + * @return the MaintenanceWindow object itself. + */ + public MaintenanceWindow withNotAllowedDates(List notAllowedDates) { + this.notAllowedDates = notAllowedDates; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("schedule", this.schedule); + jsonWriter.writeIntField("durationHours", this.durationHours); + jsonWriter.writeStringField("startTime", this.startTime); + jsonWriter.writeStringField("utcOffset", this.utcOffset); + jsonWriter.writeStringField("startDate", Objects.toString(this.startDate, null)); + jsonWriter.writeArrayField("notAllowedDates", this.notAllowedDates, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MaintenanceWindow from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MaintenanceWindow if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MaintenanceWindow. + */ + public static MaintenanceWindow fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MaintenanceWindow deserializedMaintenanceWindow = new MaintenanceWindow(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("schedule".equals(fieldName)) { + deserializedMaintenanceWindow.schedule = Schedule.fromJson(reader); + } else if ("durationHours".equals(fieldName)) { + deserializedMaintenanceWindow.durationHours = reader.getInt(); + } else if ("startTime".equals(fieldName)) { + deserializedMaintenanceWindow.startTime = reader.getString(); + } else if ("utcOffset".equals(fieldName)) { + deserializedMaintenanceWindow.utcOffset = reader.getString(); + } else if ("startDate".equals(fieldName)) { + deserializedMaintenanceWindow.startDate + = reader.getNullable(nonNullReader -> LocalDate.parse(nonNullReader.getString())); + } else if ("notAllowedDates".equals(fieldName)) { + List notAllowedDates = reader.readArray(reader1 -> DateSpan.fromJson(reader1)); + deserializedMaintenanceWindow.notAllowedDates = notAllowedDates; + } else { + reader.skipChildren(); + } + } + + return deserializedMaintenanceWindow; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedCluster.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedCluster.java new file mode 100644 index 000000000000..9ca4849d1c27 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedCluster.java @@ -0,0 +1,1530 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateLinkResourceInner; +import java.util.List; +import java.util.Map; + +/** + * An immutable client-side representation of ManagedCluster. + */ +public interface ManagedCluster { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the eTag property: If eTag is provided in the response body, it may also be provided as a header per the + * normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. + * HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), + * and If-Range (section 14.27) header fields. + * + * @return the eTag value. + */ + String eTag(); + + /** + * Gets the sku property: The managed cluster SKU. + * + * @return the sku value. + */ + ManagedClusterSKU sku(); + + /** + * Gets the extendedLocation property: The extended location of the Virtual Machine. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the identity property: The identity of the managed cluster, if configured. + * + * @return the identity value. + */ + ManagedClusterIdentity identity(); + + /** + * Gets the kind property: This is primarily used to expose different UI experiences in the portal for different + * kinds. + * + * @return the kind value. + */ + String kind(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: The current provisioning state. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the powerState property: The Power State of the cluster. + * + * @return the powerState value. + */ + PowerState powerState(); + + /** + * Gets the maxAgentPools property: The max number of agent pools for the managed cluster. + * + * @return the maxAgentPools value. + */ + Integer maxAgentPools(); + + /** + * Gets the kubernetesVersion property: The version of Kubernetes specified by the user. 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. + * + * @return the kubernetesVersion value. + */ + String kubernetesVersion(); + + /** + * Gets the currentKubernetesVersion property: The version of Kubernetes the Managed Cluster is running. 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. + * + * @return the currentKubernetesVersion value. + */ + String currentKubernetesVersion(); + + /** + * Gets the dnsPrefix property: The DNS prefix of the Managed Cluster. This cannot be updated once the Managed + * Cluster has been created. + * + * @return the dnsPrefix value. + */ + String dnsPrefix(); + + /** + * Gets the fqdnSubdomain property: The FQDN subdomain of the private cluster with custom private dns zone. This + * cannot be updated once the Managed Cluster has been created. + * + * @return the fqdnSubdomain value. + */ + String fqdnSubdomain(); + + /** + * Gets the fqdn property: The FQDN of the master pool. + * + * @return the fqdn value. + */ + String fqdn(); + + /** + * Gets the privateFQDN property: The FQDN of private cluster. + * + * @return the privateFQDN value. + */ + String privateFQDN(); + + /** + * Gets the azurePortalFQDN property: The special FQDN used by the Azure Portal to access the Managed Cluster. This + * FQDN is for use only by the Azure Portal and should not be used by other clients. 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. + * + * @return the azurePortalFQDN value. + */ + String azurePortalFQDN(); + + /** + * Gets the agentPoolProfiles property: The agent pool properties. + * + * @return the agentPoolProfiles value. + */ + List agentPoolProfiles(); + + /** + * Gets the linuxProfile property: The profile for Linux VMs in the Managed Cluster. + * + * @return the linuxProfile value. + */ + ContainerServiceLinuxProfile linuxProfile(); + + /** + * Gets the windowsProfile property: The profile for Windows VMs in the Managed Cluster. + * + * @return the windowsProfile value. + */ + ManagedClusterWindowsProfile windowsProfile(); + + /** + * Gets the servicePrincipalProfile property: Information about a service principal identity for the cluster to use + * for manipulating Azure APIs. + * + * @return the servicePrincipalProfile value. + */ + ManagedClusterServicePrincipalProfile servicePrincipalProfile(); + + /** + * Gets the addonProfiles property: The profile of managed cluster add-on. + * + * @return the addonProfiles value. + */ + Map addonProfiles(); + + /** + * Gets the podIdentityProfile property: The pod identity profile of the Managed Cluster. See [use AAD pod + * identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity) for more details on AAD pod identity + * integration. + * + * @return the podIdentityProfile value. + */ + ManagedClusterPodIdentityProfile podIdentityProfile(); + + /** + * Gets the oidcIssuerProfile property: The OIDC issuer profile of the Managed Cluster. + * + * @return the oidcIssuerProfile value. + */ + ManagedClusterOIDCIssuerProfile oidcIssuerProfile(); + + /** + * Gets the nodeResourceGroup property: The name of the resource group containing agent pool nodes. + * + * @return the nodeResourceGroup value. + */ + String nodeResourceGroup(); + + /** + * Gets the nodeResourceGroupProfile property: Profile of the node resource group configuration. + * + * @return the nodeResourceGroupProfile value. + */ + ManagedClusterNodeResourceGroupProfile nodeResourceGroupProfile(); + + /** + * Gets the enableRBAC property: Whether to enable Kubernetes Role-Based Access Control. + * + * @return the enableRBAC value. + */ + Boolean enableRBAC(); + + /** + * Gets the supportPlan property: The support plan for the Managed Cluster. If unspecified, the default is + * 'KubernetesOfficial'. + * + * @return the supportPlan value. + */ + KubernetesSupportPlan supportPlan(); + + /** + * Gets the networkProfile property: The network configuration profile. + * + * @return the networkProfile value. + */ + ContainerServiceNetworkProfile networkProfile(); + + /** + * Gets the aadProfile property: The Azure Active Directory configuration. + * + * @return the aadProfile value. + */ + ManagedClusterAADProfile aadProfile(); + + /** + * Gets the autoUpgradeProfile property: The auto upgrade configuration. + * + * @return the autoUpgradeProfile value. + */ + ManagedClusterAutoUpgradeProfile autoUpgradeProfile(); + + /** + * Gets the upgradeSettings property: Settings for upgrading a cluster. + * + * @return the upgradeSettings value. + */ + ClusterUpgradeSettings upgradeSettings(); + + /** + * Gets the autoScalerProfile property: Parameters to be applied to the cluster-autoscaler when enabled. + * + * @return the autoScalerProfile value. + */ + ManagedClusterPropertiesAutoScalerProfile autoScalerProfile(); + + /** + * Gets the apiServerAccessProfile property: The access profile for managed cluster API server. + * + * @return the apiServerAccessProfile value. + */ + ManagedClusterApiServerAccessProfile apiServerAccessProfile(); + + /** + * Gets the diskEncryptionSetID property: The Resource ID of the disk encryption set to use for enabling encryption + * at rest. This is of the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. + * + * @return the diskEncryptionSetID value. + */ + String diskEncryptionSetID(); + + /** + * Gets the identityProfile property: The user identity associated with the managed cluster. This identity will be + * used by the kubelet. Only one user assigned identity is allowed. The only accepted key is "kubeletidentity", with + * value of "resourceId": + * "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}". + * + * @return the identityProfile value. + */ + Map identityProfile(); + + /** + * Gets the privateLinkResources property: Private link resources associated with the cluster. + * + * @return the privateLinkResources value. + */ + List privateLinkResources(); + + /** + * Gets the disableLocalAccounts property: If local accounts should be disabled on the Managed 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). + * + * @return the disableLocalAccounts value. + */ + Boolean disableLocalAccounts(); + + /** + * Gets the httpProxyConfig property: Configurations for provisioning the cluster with HTTP proxy servers. + * + * @return the httpProxyConfig value. + */ + ManagedClusterHttpProxyConfig httpProxyConfig(); + + /** + * Gets the securityProfile property: Security profile for the managed cluster. + * + * @return the securityProfile value. + */ + ManagedClusterSecurityProfile securityProfile(); + + /** + * Gets the storageProfile property: Storage profile for the managed cluster. + * + * @return the storageProfile value. + */ + ManagedClusterStorageProfile storageProfile(); + + /** + * Gets the ingressProfile property: Ingress profile for the managed cluster. + * + * @return the ingressProfile value. + */ + ManagedClusterIngressProfile ingressProfile(); + + /** + * Gets the publicNetworkAccess property: PublicNetworkAccess of the managedCluster. Allow or deny public network + * access for AKS. + * + * @return the publicNetworkAccess value. + */ + PublicNetworkAccess publicNetworkAccess(); + + /** + * Gets the workloadAutoScalerProfile property: Workload Auto-scaler profile for the managed cluster. + * + * @return the workloadAutoScalerProfile value. + */ + ManagedClusterWorkloadAutoScalerProfile workloadAutoScalerProfile(); + + /** + * Gets the azureMonitorProfile property: Azure Monitor addon profiles for monitoring the managed cluster. + * + * @return the azureMonitorProfile value. + */ + ManagedClusterAzureMonitorProfile azureMonitorProfile(); + + /** + * Gets the serviceMeshProfile property: Service mesh profile for a managed cluster. + * + * @return the serviceMeshProfile value. + */ + ServiceMeshProfile serviceMeshProfile(); + + /** + * Gets the resourceUID property: The resourceUID uniquely identifies ManagedClusters that reuse ARM ResourceIds + * (i.e: create, delete, create sequence). + * + * @return the resourceUID value. + */ + String resourceUID(); + + /** + * Gets the metricsProfile property: Optional cluster metrics configuration. + * + * @return the metricsProfile value. + */ + ManagedClusterMetricsProfile metricsProfile(); + + /** + * Gets the nodeProvisioningProfile property: Node provisioning settings that apply to the whole cluster. + * + * @return the nodeProvisioningProfile value. + */ + ManagedClusterNodeProvisioningProfile nodeProvisioningProfile(); + + /** + * Gets the bootstrapProfile property: Profile of the cluster bootstrap configuration. + * + * @return the bootstrapProfile value. + */ + ManagedClusterBootstrapProfile bootstrapProfile(); + + /** + * Gets the aiToolchainOperatorProfile property: AI toolchain operator settings that apply to the whole cluster. + * + * @return the aiToolchainOperatorProfile value. + */ + ManagedClusterAIToolchainOperatorProfile aiToolchainOperatorProfile(); + + /** + * Gets the status property: Contains read-only information about the Managed Cluster. + * + * @return the status value. + */ + ManagedClusterStatus status(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterInner object. + * + * @return the inner object. + */ + ManagedClusterInner innerModel(); + + /** + * The entirety of the ManagedCluster definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The ManagedCluster definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the ManagedCluster definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the ManagedCluster definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the ManagedCluster definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the ManagedCluster definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithSku, + DefinitionStages.WithExtendedLocation, DefinitionStages.WithIdentity, DefinitionStages.WithKind, + DefinitionStages.WithKubernetesVersion, DefinitionStages.WithDnsPrefix, DefinitionStages.WithFqdnSubdomain, + DefinitionStages.WithAgentPoolProfiles, DefinitionStages.WithLinuxProfile, + DefinitionStages.WithWindowsProfile, DefinitionStages.WithServicePrincipalProfile, + DefinitionStages.WithAddonProfiles, DefinitionStages.WithPodIdentityProfile, + DefinitionStages.WithOidcIssuerProfile, DefinitionStages.WithNodeResourceGroup, + DefinitionStages.WithNodeResourceGroupProfile, DefinitionStages.WithEnableRBAC, + DefinitionStages.WithSupportPlan, DefinitionStages.WithNetworkProfile, DefinitionStages.WithAadProfile, + DefinitionStages.WithAutoUpgradeProfile, DefinitionStages.WithUpgradeSettings, + DefinitionStages.WithAutoScalerProfile, DefinitionStages.WithApiServerAccessProfile, + DefinitionStages.WithDiskEncryptionSetID, DefinitionStages.WithIdentityProfile, + DefinitionStages.WithPrivateLinkResources, DefinitionStages.WithDisableLocalAccounts, + DefinitionStages.WithHttpProxyConfig, DefinitionStages.WithSecurityProfile, + DefinitionStages.WithStorageProfile, DefinitionStages.WithIngressProfile, + DefinitionStages.WithPublicNetworkAccess, DefinitionStages.WithWorkloadAutoScalerProfile, + DefinitionStages.WithAzureMonitorProfile, DefinitionStages.WithServiceMeshProfile, + DefinitionStages.WithMetricsProfile, DefinitionStages.WithNodeProvisioningProfile, + DefinitionStages.WithBootstrapProfile, DefinitionStages.WithAiToolchainOperatorProfile, + DefinitionStages.WithStatus, DefinitionStages.WithIfMatch, DefinitionStages.WithIfNoneMatch { + /** + * Executes the create request. + * + * @return the created resource. + */ + ManagedCluster create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ManagedCluster create(Context context); + } + + /** + * The stage of the ManagedCluster definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the ManagedCluster definition allowing to specify sku. + */ + interface WithSku { + /** + * Specifies the sku property: The managed cluster SKU.. + * + * @param sku The managed cluster SKU. + * @return the next definition stage. + */ + WithCreate withSku(ManagedClusterSKU sku); + } + + /** + * The stage of the ManagedCluster definition allowing to specify extendedLocation. + */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: The extended location of the Virtual Machine.. + * + * @param extendedLocation The extended location of the Virtual Machine. + * @return the next definition stage. + */ + WithCreate withExtendedLocation(ExtendedLocation extendedLocation); + } + + /** + * The stage of the ManagedCluster definition allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the managed cluster, if configured.. + * + * @param identity The identity of the managed cluster, if configured. + * @return the next definition stage. + */ + WithCreate withIdentity(ManagedClusterIdentity identity); + } + + /** + * The stage of the ManagedCluster definition allowing to specify kind. + */ + interface WithKind { + /** + * Specifies the kind property: This is primarily used to expose different UI experiences in the portal for + * different kinds. + * + * @param kind This is primarily used to expose different UI experiences in the portal for different kinds. + * @return the next definition stage. + */ + WithCreate withKind(String kind); + } + + /** + * The stage of the ManagedCluster definition allowing to specify kubernetesVersion. + */ + interface WithKubernetesVersion { + /** + * Specifies the kubernetesVersion property: The version of Kubernetes specified by the user. 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.. + * + * @param kubernetesVersion The version of Kubernetes specified by the user. 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. + * @return the next definition stage. + */ + WithCreate withKubernetesVersion(String kubernetesVersion); + } + + /** + * The stage of the ManagedCluster definition allowing to specify dnsPrefix. + */ + interface WithDnsPrefix { + /** + * Specifies the dnsPrefix property: The DNS prefix of the Managed Cluster. This cannot be updated once the + * Managed Cluster has been created.. + * + * @param dnsPrefix The DNS prefix of the Managed Cluster. This cannot be updated once the Managed Cluster + * has been created. + * @return the next definition stage. + */ + WithCreate withDnsPrefix(String dnsPrefix); + } + + /** + * The stage of the ManagedCluster definition allowing to specify fqdnSubdomain. + */ + interface WithFqdnSubdomain { + /** + * Specifies the fqdnSubdomain property: The FQDN subdomain of the private cluster with custom private dns + * zone. This cannot be updated once the Managed Cluster has been created.. + * + * @param fqdnSubdomain The FQDN subdomain of the private cluster with custom private dns zone. This cannot + * be updated once the Managed Cluster has been created. + * @return the next definition stage. + */ + WithCreate withFqdnSubdomain(String fqdnSubdomain); + } + + /** + * The stage of the ManagedCluster definition allowing to specify agentPoolProfiles. + */ + interface WithAgentPoolProfiles { + /** + * Specifies the agentPoolProfiles property: The agent pool properties.. + * + * @param agentPoolProfiles The agent pool properties. + * @return the next definition stage. + */ + WithCreate withAgentPoolProfiles(List agentPoolProfiles); + } + + /** + * The stage of the ManagedCluster definition allowing to specify linuxProfile. + */ + interface WithLinuxProfile { + /** + * Specifies the linuxProfile property: The profile for Linux VMs in the Managed Cluster.. + * + * @param linuxProfile The profile for Linux VMs in the Managed Cluster. + * @return the next definition stage. + */ + WithCreate withLinuxProfile(ContainerServiceLinuxProfile linuxProfile); + } + + /** + * The stage of the ManagedCluster definition allowing to specify windowsProfile. + */ + interface WithWindowsProfile { + /** + * Specifies the windowsProfile property: The profile for Windows VMs in the Managed Cluster.. + * + * @param windowsProfile The profile for Windows VMs in the Managed Cluster. + * @return the next definition stage. + */ + WithCreate withWindowsProfile(ManagedClusterWindowsProfile windowsProfile); + } + + /** + * The stage of the ManagedCluster definition allowing to specify servicePrincipalProfile. + */ + interface WithServicePrincipalProfile { + /** + * Specifies the servicePrincipalProfile property: Information about a service principal identity for the + * cluster to use for manipulating Azure APIs.. + * + * @param servicePrincipalProfile Information about a service principal identity for the cluster to use for + * manipulating Azure APIs. + * @return the next definition stage. + */ + WithCreate withServicePrincipalProfile(ManagedClusterServicePrincipalProfile servicePrincipalProfile); + } + + /** + * The stage of the ManagedCluster definition allowing to specify addonProfiles. + */ + interface WithAddonProfiles { + /** + * Specifies the addonProfiles property: The profile of managed cluster add-on.. + * + * @param addonProfiles The profile of managed cluster add-on. + * @return the next definition stage. + */ + WithCreate withAddonProfiles(Map addonProfiles); + } + + /** + * The stage of the ManagedCluster definition allowing to specify podIdentityProfile. + */ + interface WithPodIdentityProfile { + /** + * Specifies the podIdentityProfile property: The pod identity profile of the Managed Cluster. See [use AAD + * pod identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity) for more details on AAD pod + * identity integration.. + * + * @param podIdentityProfile The pod identity profile of the Managed Cluster. See [use AAD pod + * identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity) for more details on AAD pod + * identity integration. + * @return the next definition stage. + */ + WithCreate withPodIdentityProfile(ManagedClusterPodIdentityProfile podIdentityProfile); + } + + /** + * The stage of the ManagedCluster definition allowing to specify oidcIssuerProfile. + */ + interface WithOidcIssuerProfile { + /** + * Specifies the oidcIssuerProfile property: The OIDC issuer profile of the Managed Cluster.. + * + * @param oidcIssuerProfile The OIDC issuer profile of the Managed Cluster. + * @return the next definition stage. + */ + WithCreate withOidcIssuerProfile(ManagedClusterOIDCIssuerProfile oidcIssuerProfile); + } + + /** + * The stage of the ManagedCluster definition allowing to specify nodeResourceGroup. + */ + interface WithNodeResourceGroup { + /** + * Specifies the nodeResourceGroup property: The name of the resource group containing agent pool nodes.. + * + * @param nodeResourceGroup The name of the resource group containing agent pool nodes. + * @return the next definition stage. + */ + WithCreate withNodeResourceGroup(String nodeResourceGroup); + } + + /** + * The stage of the ManagedCluster definition allowing to specify nodeResourceGroupProfile. + */ + interface WithNodeResourceGroupProfile { + /** + * Specifies the nodeResourceGroupProfile property: Profile of the node resource group configuration.. + * + * @param nodeResourceGroupProfile Profile of the node resource group configuration. + * @return the next definition stage. + */ + WithCreate withNodeResourceGroupProfile(ManagedClusterNodeResourceGroupProfile nodeResourceGroupProfile); + } + + /** + * The stage of the ManagedCluster definition allowing to specify enableRBAC. + */ + interface WithEnableRBAC { + /** + * Specifies the enableRBAC property: Whether to enable Kubernetes Role-Based Access Control.. + * + * @param enableRBAC Whether to enable Kubernetes Role-Based Access Control. + * @return the next definition stage. + */ + WithCreate withEnableRBAC(Boolean enableRBAC); + } + + /** + * The stage of the ManagedCluster definition allowing to specify supportPlan. + */ + interface WithSupportPlan { + /** + * Specifies the supportPlan property: The support plan for the Managed Cluster. If unspecified, the default + * is 'KubernetesOfficial'.. + * + * @param supportPlan The support plan for the Managed Cluster. If unspecified, the default is + * 'KubernetesOfficial'. + * @return the next definition stage. + */ + WithCreate withSupportPlan(KubernetesSupportPlan supportPlan); + } + + /** + * The stage of the ManagedCluster definition allowing to specify networkProfile. + */ + interface WithNetworkProfile { + /** + * Specifies the networkProfile property: The network configuration profile.. + * + * @param networkProfile The network configuration profile. + * @return the next definition stage. + */ + WithCreate withNetworkProfile(ContainerServiceNetworkProfile networkProfile); + } + + /** + * The stage of the ManagedCluster definition allowing to specify aadProfile. + */ + interface WithAadProfile { + /** + * Specifies the aadProfile property: The Azure Active Directory configuration.. + * + * @param aadProfile The Azure Active Directory configuration. + * @return the next definition stage. + */ + WithCreate withAadProfile(ManagedClusterAADProfile aadProfile); + } + + /** + * The stage of the ManagedCluster definition allowing to specify autoUpgradeProfile. + */ + interface WithAutoUpgradeProfile { + /** + * Specifies the autoUpgradeProfile property: The auto upgrade configuration.. + * + * @param autoUpgradeProfile The auto upgrade configuration. + * @return the next definition stage. + */ + WithCreate withAutoUpgradeProfile(ManagedClusterAutoUpgradeProfile autoUpgradeProfile); + } + + /** + * The stage of the ManagedCluster definition allowing to specify upgradeSettings. + */ + interface WithUpgradeSettings { + /** + * Specifies the upgradeSettings property: Settings for upgrading a cluster.. + * + * @param upgradeSettings Settings for upgrading a cluster. + * @return the next definition stage. + */ + WithCreate withUpgradeSettings(ClusterUpgradeSettings upgradeSettings); + } + + /** + * The stage of the ManagedCluster definition allowing to specify autoScalerProfile. + */ + interface WithAutoScalerProfile { + /** + * Specifies the autoScalerProfile property: Parameters to be applied to the cluster-autoscaler when + * enabled. + * + * @param autoScalerProfile Parameters to be applied to the cluster-autoscaler when enabled. + * @return the next definition stage. + */ + WithCreate withAutoScalerProfile(ManagedClusterPropertiesAutoScalerProfile autoScalerProfile); + } + + /** + * The stage of the ManagedCluster definition allowing to specify apiServerAccessProfile. + */ + interface WithApiServerAccessProfile { + /** + * Specifies the apiServerAccessProfile property: The access profile for managed cluster API server.. + * + * @param apiServerAccessProfile The access profile for managed cluster API server. + * @return the next definition stage. + */ + WithCreate withApiServerAccessProfile(ManagedClusterApiServerAccessProfile apiServerAccessProfile); + } + + /** + * The stage of the ManagedCluster definition allowing to specify diskEncryptionSetID. + */ + interface WithDiskEncryptionSetID { + /** + * Specifies the diskEncryptionSetID property: The Resource ID of the disk encryption set to use for + * enabling encryption at rest. This is of the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. + * + * @param diskEncryptionSetID The Resource ID of the disk encryption set to use for enabling encryption at + * rest. This is of the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. + * @return the next definition stage. + */ + WithCreate withDiskEncryptionSetID(String diskEncryptionSetID); + } + + /** + * The stage of the ManagedCluster definition allowing to specify identityProfile. + */ + interface WithIdentityProfile { + /** + * Specifies the identityProfile property: The user identity associated with the managed cluster. This + * identity will be used by the kubelet. Only one user assigned identity is allowed. The only accepted key + * is "kubeletidentity", with value of "resourceId": + * "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}".. + * + * @param identityProfile The user identity associated with the managed cluster. This identity will be used + * by the kubelet. Only one user assigned identity is allowed. The only accepted key is "kubeletidentity", + * with value of "resourceId": + * "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}". + * @return the next definition stage. + */ + WithCreate withIdentityProfile(Map identityProfile); + } + + /** + * The stage of the ManagedCluster definition allowing to specify privateLinkResources. + */ + interface WithPrivateLinkResources { + /** + * Specifies the privateLinkResources property: Private link resources associated with the cluster.. + * + * @param privateLinkResources Private link resources associated with the cluster. + * @return the next definition stage. + */ + WithCreate withPrivateLinkResources(List privateLinkResources); + } + + /** + * The stage of the ManagedCluster definition allowing to specify disableLocalAccounts. + */ + interface WithDisableLocalAccounts { + /** + * Specifies the disableLocalAccounts property: If local accounts should be disabled on the Managed 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).. + * + * @param disableLocalAccounts If local accounts should be disabled on the Managed 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). + * @return the next definition stage. + */ + WithCreate withDisableLocalAccounts(Boolean disableLocalAccounts); + } + + /** + * The stage of the ManagedCluster definition allowing to specify httpProxyConfig. + */ + interface WithHttpProxyConfig { + /** + * Specifies the httpProxyConfig property: Configurations for provisioning the cluster with HTTP proxy + * servers.. + * + * @param httpProxyConfig Configurations for provisioning the cluster with HTTP proxy servers. + * @return the next definition stage. + */ + WithCreate withHttpProxyConfig(ManagedClusterHttpProxyConfig httpProxyConfig); + } + + /** + * The stage of the ManagedCluster definition allowing to specify securityProfile. + */ + interface WithSecurityProfile { + /** + * Specifies the securityProfile property: Security profile for the managed cluster.. + * + * @param securityProfile Security profile for the managed cluster. + * @return the next definition stage. + */ + WithCreate withSecurityProfile(ManagedClusterSecurityProfile securityProfile); + } + + /** + * The stage of the ManagedCluster definition allowing to specify storageProfile. + */ + interface WithStorageProfile { + /** + * Specifies the storageProfile property: Storage profile for the managed cluster.. + * + * @param storageProfile Storage profile for the managed cluster. + * @return the next definition stage. + */ + WithCreate withStorageProfile(ManagedClusterStorageProfile storageProfile); + } + + /** + * The stage of the ManagedCluster definition allowing to specify ingressProfile. + */ + interface WithIngressProfile { + /** + * Specifies the ingressProfile property: Ingress profile for the managed cluster.. + * + * @param ingressProfile Ingress profile for the managed cluster. + * @return the next definition stage. + */ + WithCreate withIngressProfile(ManagedClusterIngressProfile ingressProfile); + } + + /** + * The stage of the ManagedCluster definition allowing to specify publicNetworkAccess. + */ + interface WithPublicNetworkAccess { + /** + * Specifies the publicNetworkAccess property: PublicNetworkAccess of the managedCluster. Allow or deny + * public network access for AKS. + * + * @param publicNetworkAccess PublicNetworkAccess of the managedCluster. Allow or deny public network access + * for AKS. + * @return the next definition stage. + */ + WithCreate withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); + } + + /** + * The stage of the ManagedCluster definition allowing to specify workloadAutoScalerProfile. + */ + interface WithWorkloadAutoScalerProfile { + /** + * Specifies the workloadAutoScalerProfile property: Workload Auto-scaler profile for the managed cluster.. + * + * @param workloadAutoScalerProfile Workload Auto-scaler profile for the managed cluster. + * @return the next definition stage. + */ + WithCreate withWorkloadAutoScalerProfile(ManagedClusterWorkloadAutoScalerProfile workloadAutoScalerProfile); + } + + /** + * The stage of the ManagedCluster definition allowing to specify azureMonitorProfile. + */ + interface WithAzureMonitorProfile { + /** + * Specifies the azureMonitorProfile property: Azure Monitor addon profiles for monitoring the managed + * cluster.. + * + * @param azureMonitorProfile Azure Monitor addon profiles for monitoring the managed cluster. + * @return the next definition stage. + */ + WithCreate withAzureMonitorProfile(ManagedClusterAzureMonitorProfile azureMonitorProfile); + } + + /** + * The stage of the ManagedCluster definition allowing to specify serviceMeshProfile. + */ + interface WithServiceMeshProfile { + /** + * Specifies the serviceMeshProfile property: Service mesh profile for a managed cluster.. + * + * @param serviceMeshProfile Service mesh profile for a managed cluster. + * @return the next definition stage. + */ + WithCreate withServiceMeshProfile(ServiceMeshProfile serviceMeshProfile); + } + + /** + * The stage of the ManagedCluster definition allowing to specify metricsProfile. + */ + interface WithMetricsProfile { + /** + * Specifies the metricsProfile property: Optional cluster metrics configuration.. + * + * @param metricsProfile Optional cluster metrics configuration. + * @return the next definition stage. + */ + WithCreate withMetricsProfile(ManagedClusterMetricsProfile metricsProfile); + } + + /** + * The stage of the ManagedCluster definition allowing to specify nodeProvisioningProfile. + */ + interface WithNodeProvisioningProfile { + /** + * Specifies the nodeProvisioningProfile property: Node provisioning settings that apply to the whole + * cluster.. + * + * @param nodeProvisioningProfile Node provisioning settings that apply to the whole cluster. + * @return the next definition stage. + */ + WithCreate withNodeProvisioningProfile(ManagedClusterNodeProvisioningProfile nodeProvisioningProfile); + } + + /** + * The stage of the ManagedCluster definition allowing to specify bootstrapProfile. + */ + interface WithBootstrapProfile { + /** + * Specifies the bootstrapProfile property: Profile of the cluster bootstrap configuration.. + * + * @param bootstrapProfile Profile of the cluster bootstrap configuration. + * @return the next definition stage. + */ + WithCreate withBootstrapProfile(ManagedClusterBootstrapProfile bootstrapProfile); + } + + /** + * The stage of the ManagedCluster definition allowing to specify aiToolchainOperatorProfile. + */ + interface WithAiToolchainOperatorProfile { + /** + * Specifies the aiToolchainOperatorProfile property: AI toolchain operator settings that apply to the whole + * cluster.. + * + * @param aiToolchainOperatorProfile AI toolchain operator settings that apply to the whole cluster. + * @return the next definition stage. + */ + WithCreate + withAiToolchainOperatorProfile(ManagedClusterAIToolchainOperatorProfile aiToolchainOperatorProfile); + } + + /** + * The stage of the ManagedCluster definition allowing to specify status. + */ + interface WithStatus { + /** + * Specifies the status property: Contains read-only information about the Managed Cluster.. + * + * @param status Contains read-only information about the Managed Cluster. + * @return the next definition stage. + */ + WithCreate withStatus(ManagedClusterStatus status); + } + + /** + * The stage of the ManagedCluster definition allowing to specify ifMatch. + */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: The request should only proceed if an entity matches this string.. + * + * @param ifMatch The request should only proceed if an entity matches this string. + * @return the next definition stage. + */ + WithCreate withIfMatch(String ifMatch); + } + + /** + * The stage of the ManagedCluster definition allowing to specify ifNoneMatch. + */ + interface WithIfNoneMatch { + /** + * Specifies the ifNoneMatch property: The request should only proceed if no entity matches this string.. + * + * @param ifNoneMatch The request should only proceed if no entity matches this string. + * @return the next definition stage. + */ + WithCreate withIfNoneMatch(String ifNoneMatch); + } + } + + /** + * Begins update for the ManagedCluster resource. + * + * @return the stage of resource update. + */ + ManagedCluster.Update update(); + + /** + * The template for ManagedCluster update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithIfMatch { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ManagedCluster apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ManagedCluster apply(Context context); + } + + /** + * The ManagedCluster update stages. + */ + interface UpdateStages { + /** + * The stage of the ManagedCluster update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + + /** + * The stage of the ManagedCluster update allowing to specify ifMatch. + */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: The request should only proceed if an entity matches this string.. + * + * @param ifMatch The request should only proceed if an entity matches this string. + * @return the next definition stage. + */ + Update withIfMatch(String ifMatch); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ManagedCluster refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ManagedCluster refresh(Context context); + + /** + * Lists the admin credentials of a managed cluster. + * + * @param serverFqdn server fqdn type for credentials to be returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list credential result response along with {@link Response}. + */ + Response listClusterAdminCredentialsWithResponse(String serverFqdn, Context context); + + /** + * Lists the admin credentials of a managed cluster. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list credential result response. + */ + CredentialResults listClusterAdminCredentials(); + + /** + * Lists the user credentials of a managed cluster. + * + * @param serverFqdn server fqdn type for credentials to be returned. + * @param format 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list credential result response along with {@link Response}. + */ + Response listClusterUserCredentialsWithResponse(String serverFqdn, Format format, + Context context); + + /** + * Lists the user credentials of a managed cluster. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list credential result response. + */ + CredentialResults listClusterUserCredentials(); + + /** + * Lists the cluster monitoring user credentials of a managed cluster. + * + * @param serverFqdn server fqdn type for credentials to be returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list credential result response along with {@link Response}. + */ + Response listClusterMonitoringUserCredentialsWithResponse(String serverFqdn, Context context); + + /** + * Lists the cluster monitoring user credentials of a managed cluster. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list credential result response. + */ + CredentialResults listClusterMonitoringUserCredentials(); + + /** + * Reset the Service Principal Profile of a managed cluster. + * + * This action cannot be performed on a cluster that is not using a service principal. + * + * @param parameters The service principal profile to set on the managed cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void resetServicePrincipalProfile(ManagedClusterServicePrincipalProfile parameters); + + /** + * Reset the Service Principal Profile of a managed cluster. + * + * This action cannot be performed on a cluster that is not using a service principal. + * + * @param parameters The service principal profile to set on the managed cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void resetServicePrincipalProfile(ManagedClusterServicePrincipalProfile parameters, Context context); + + /** + * Reset the AAD Profile of a managed cluster. + * + * **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. + * + * @param parameters The AAD profile to set on the Managed Cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void resetAADProfile(ManagedClusterAADProfile parameters); + + /** + * Reset the AAD Profile of a managed cluster. + * + * **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. + * + * @param parameters The AAD profile to set on the Managed Cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void resetAADProfile(ManagedClusterAADProfile parameters, Context context); + + /** + * Rotates the certificates of a managed cluster. + * + * See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about + * rotating managed cluster certificates. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void rotateClusterCertificates(); + + /** + * Rotates the certificates of a managed cluster. + * + * See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about + * rotating managed cluster certificates. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void rotateClusterCertificates(Context context); + + /** + * Aborts last operation running on managed cluster. + * + * 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. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void abortLatestOperation(); + + /** + * Aborts last operation running on managed cluster. + * + * 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. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void abortLatestOperation(Context context); + + /** + * Rotates the service account signing keys of a managed cluster. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void rotateServiceAccountSigningKeys(); + + /** + * Rotates the service account signing keys of a managed cluster. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void rotateServiceAccountSigningKeys(Context context); + + /** + * Stops a Managed Cluster + * + * 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. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(); + + /** + * Stops a Managed Cluster + * + * 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. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(Context context); + + /** + * Starts a previously stopped Managed Cluster + * + * See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting + * a cluster. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(); + + /** + * Starts a previously stopped Managed Cluster + * + * See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting + * a cluster. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(Context context); + + /** + * Submits a command to run against the Managed Cluster. + * + * 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). + * + * @param requestPayload The run command request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + RunCommandResult runCommand(RunCommandRequest requestPayload); + + /** + * Submits a command to run against the Managed Cluster. + * + * 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). + * + * @param requestPayload The run command request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + RunCommandResult runCommand(RunCommandRequest requestPayload, Context context); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAADProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAADProfile.java new file mode 100644 index 000000000000..1b2e0ded0c89 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAADProfile.java @@ -0,0 +1,266 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * AADProfile specifies attributes for Azure Active Directory integration. For more details see [managed AAD on + * AKS](https://docs.microsoft.com/azure/aks/managed-aad). + */ +@Fluent +public final class ManagedClusterAADProfile implements JsonSerializable { + /* + * Whether to enable managed AAD. + */ + private Boolean managed; + + /* + * Whether to enable Azure RBAC for Kubernetes authorization. + */ + private Boolean enableAzureRBAC; + + /* + * The list of AAD group object IDs that will have admin role of the cluster. + */ + private List adminGroupObjectIDs; + + /* + * (DEPRECATED) The client AAD application ID. Learn more at https://aka.ms/aks/aad-legacy. + */ + private String clientAppID; + + /* + * (DEPRECATED) The server AAD application ID. Learn more at https://aka.ms/aks/aad-legacy. + */ + private String serverAppID; + + /* + * (DEPRECATED) The server AAD application secret. Learn more at https://aka.ms/aks/aad-legacy. + */ + private String serverAppSecret; + + /* + * The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment + * subscription. + */ + private String tenantID; + + /** + * Creates an instance of ManagedClusterAADProfile class. + */ + public ManagedClusterAADProfile() { + } + + /** + * Get the managed property: Whether to enable managed AAD. + * + * @return the managed value. + */ + public Boolean managed() { + return this.managed; + } + + /** + * Set the managed property: Whether to enable managed AAD. + * + * @param managed the managed value to set. + * @return the ManagedClusterAADProfile object itself. + */ + public ManagedClusterAADProfile withManaged(Boolean managed) { + this.managed = managed; + return this; + } + + /** + * Get the enableAzureRBAC property: Whether to enable Azure RBAC for Kubernetes authorization. + * + * @return the enableAzureRBAC value. + */ + public Boolean enableAzureRBAC() { + return this.enableAzureRBAC; + } + + /** + * Set the enableAzureRBAC property: Whether to enable Azure RBAC for Kubernetes authorization. + * + * @param enableAzureRBAC the enableAzureRBAC value to set. + * @return the ManagedClusterAADProfile object itself. + */ + public ManagedClusterAADProfile withEnableAzureRBAC(Boolean enableAzureRBAC) { + this.enableAzureRBAC = enableAzureRBAC; + return this; + } + + /** + * Get the adminGroupObjectIDs property: The list of AAD group object IDs that will have admin role of the cluster. + * + * @return the adminGroupObjectIDs value. + */ + public List adminGroupObjectIDs() { + return this.adminGroupObjectIDs; + } + + /** + * Set the adminGroupObjectIDs property: The list of AAD group object IDs that will have admin role of the cluster. + * + * @param adminGroupObjectIDs the adminGroupObjectIDs value to set. + * @return the ManagedClusterAADProfile object itself. + */ + public ManagedClusterAADProfile withAdminGroupObjectIDs(List adminGroupObjectIDs) { + this.adminGroupObjectIDs = adminGroupObjectIDs; + return this; + } + + /** + * Get the clientAppID property: (DEPRECATED) The client AAD application ID. Learn more at + * https://aka.ms/aks/aad-legacy. + * + * @return the clientAppID value. + */ + public String clientAppID() { + return this.clientAppID; + } + + /** + * Set the clientAppID property: (DEPRECATED) The client AAD application ID. Learn more at + * https://aka.ms/aks/aad-legacy. + * + * @param clientAppID the clientAppID value to set. + * @return the ManagedClusterAADProfile object itself. + */ + public ManagedClusterAADProfile withClientAppID(String clientAppID) { + this.clientAppID = clientAppID; + return this; + } + + /** + * Get the serverAppID property: (DEPRECATED) The server AAD application ID. Learn more at + * https://aka.ms/aks/aad-legacy. + * + * @return the serverAppID value. + */ + public String serverAppID() { + return this.serverAppID; + } + + /** + * Set the serverAppID property: (DEPRECATED) The server AAD application ID. Learn more at + * https://aka.ms/aks/aad-legacy. + * + * @param serverAppID the serverAppID value to set. + * @return the ManagedClusterAADProfile object itself. + */ + public ManagedClusterAADProfile withServerAppID(String serverAppID) { + this.serverAppID = serverAppID; + return this; + } + + /** + * Get the serverAppSecret property: (DEPRECATED) The server AAD application secret. Learn more at + * https://aka.ms/aks/aad-legacy. + * + * @return the serverAppSecret value. + */ + public String serverAppSecret() { + return this.serverAppSecret; + } + + /** + * Set the serverAppSecret property: (DEPRECATED) The server AAD application secret. Learn more at + * https://aka.ms/aks/aad-legacy. + * + * @param serverAppSecret the serverAppSecret value to set. + * @return the ManagedClusterAADProfile object itself. + */ + public ManagedClusterAADProfile withServerAppSecret(String serverAppSecret) { + this.serverAppSecret = serverAppSecret; + return this; + } + + /** + * Get the tenantID property: The AAD tenant ID to use for authentication. If not specified, will use the tenant of + * the deployment subscription. + * + * @return the tenantID value. + */ + public String tenantID() { + return this.tenantID; + } + + /** + * Set the tenantID property: The AAD tenant ID to use for authentication. If not specified, will use the tenant of + * the deployment subscription. + * + * @param tenantID the tenantID value to set. + * @return the ManagedClusterAADProfile object itself. + */ + public ManagedClusterAADProfile withTenantID(String tenantID) { + this.tenantID = tenantID; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("managed", this.managed); + jsonWriter.writeBooleanField("enableAzureRBAC", this.enableAzureRBAC); + jsonWriter.writeArrayField("adminGroupObjectIDs", this.adminGroupObjectIDs, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("clientAppID", this.clientAppID); + jsonWriter.writeStringField("serverAppID", this.serverAppID); + jsonWriter.writeStringField("serverAppSecret", this.serverAppSecret); + jsonWriter.writeStringField("tenantID", this.tenantID); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterAADProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterAADProfile if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedClusterAADProfile. + */ + public static ManagedClusterAADProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterAADProfile deserializedManagedClusterAADProfile = new ManagedClusterAADProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("managed".equals(fieldName)) { + deserializedManagedClusterAADProfile.managed = reader.getNullable(JsonReader::getBoolean); + } else if ("enableAzureRBAC".equals(fieldName)) { + deserializedManagedClusterAADProfile.enableAzureRBAC = reader.getNullable(JsonReader::getBoolean); + } else if ("adminGroupObjectIDs".equals(fieldName)) { + List adminGroupObjectIDs = reader.readArray(reader1 -> reader1.getString()); + deserializedManagedClusterAADProfile.adminGroupObjectIDs = adminGroupObjectIDs; + } else if ("clientAppID".equals(fieldName)) { + deserializedManagedClusterAADProfile.clientAppID = reader.getString(); + } else if ("serverAppID".equals(fieldName)) { + deserializedManagedClusterAADProfile.serverAppID = reader.getString(); + } else if ("serverAppSecret".equals(fieldName)) { + deserializedManagedClusterAADProfile.serverAppSecret = reader.getString(); + } else if ("tenantID".equals(fieldName)) { + deserializedManagedClusterAADProfile.tenantID = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterAADProfile; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAIToolchainOperatorProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAIToolchainOperatorProfile.java new file mode 100644 index 000000000000..0660649caa62 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAIToolchainOperatorProfile.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * When enabling the operator, a set of AKS managed CRDs and controllers will be installed in the cluster. The operator + * automates the deployment of OSS models for inference and/or training purposes. It provides a set of preset models and + * enables distributed inference against them. + */ +@Fluent +public final class ManagedClusterAIToolchainOperatorProfile + implements JsonSerializable { + /* + * Whether to enable AI toolchain operator to the cluster. Indicates if AI toolchain operator enabled or not. + */ + private Boolean enabled; + + /** + * Creates an instance of ManagedClusterAIToolchainOperatorProfile class. + */ + public ManagedClusterAIToolchainOperatorProfile() { + } + + /** + * Get the enabled property: Whether to enable AI toolchain operator to the cluster. Indicates if AI toolchain + * operator enabled or not. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Whether to enable AI toolchain operator to the cluster. Indicates if AI toolchain + * operator enabled or not. + * + * @param enabled the enabled value to set. + * @return the ManagedClusterAIToolchainOperatorProfile object itself. + */ + public ManagedClusterAIToolchainOperatorProfile withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterAIToolchainOperatorProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterAIToolchainOperatorProfile if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedClusterAIToolchainOperatorProfile. + */ + public static ManagedClusterAIToolchainOperatorProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterAIToolchainOperatorProfile deserializedManagedClusterAIToolchainOperatorProfile + = new ManagedClusterAIToolchainOperatorProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedManagedClusterAIToolchainOperatorProfile.enabled + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterAIToolchainOperatorProfile; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAccessProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAccessProfile.java new file mode 100644 index 000000000000..3ae3800736a7 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAccessProfile.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterAccessProfileInner; +import java.util.Map; + +/** + * An immutable client-side representation of ManagedClusterAccessProfile. + */ +public interface ManagedClusterAccessProfile { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the kubeConfig property: Base64-encoded Kubernetes configuration file. + * + * @return the kubeConfig value. + */ + byte[] kubeConfig(); + + /** + * Gets the inner + * com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterAccessProfileInner object. + * + * @return the inner object. + */ + ManagedClusterAccessProfileInner innerModel(); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAddonProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAddonProfile.java new file mode 100644 index 000000000000..966737aae185 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAddonProfile.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * A Kubernetes add-on profile for a managed cluster. + */ +@Fluent +public final class ManagedClusterAddonProfile implements JsonSerializable { + /* + * Whether the add-on is enabled or not. + */ + private boolean enabled; + + /* + * Key-value pairs for configuring an add-on. + */ + private Map config; + + /* + * Information of user assigned identity used by this add-on. + */ + private ManagedClusterAddonProfileIdentity identity; + + /** + * Creates an instance of ManagedClusterAddonProfile class. + */ + public ManagedClusterAddonProfile() { + } + + /** + * Get the enabled property: Whether the add-on is enabled or not. + * + * @return the enabled value. + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Whether the add-on is enabled or not. + * + * @param enabled the enabled value to set. + * @return the ManagedClusterAddonProfile object itself. + */ + public ManagedClusterAddonProfile withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the config property: Key-value pairs for configuring an add-on. + * + * @return the config value. + */ + public Map config() { + return this.config; + } + + /** + * Set the config property: Key-value pairs for configuring an add-on. + * + * @param config the config value to set. + * @return the ManagedClusterAddonProfile object itself. + */ + public ManagedClusterAddonProfile withConfig(Map config) { + this.config = config; + return this; + } + + /** + * Get the identity property: Information of user assigned identity used by this add-on. + * + * @return the identity value. + */ + public ManagedClusterAddonProfileIdentity identity() { + return this.identity; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeMapField("config", this.config, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterAddonProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterAddonProfile if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ManagedClusterAddonProfile. + */ + public static ManagedClusterAddonProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterAddonProfile deserializedManagedClusterAddonProfile = new ManagedClusterAddonProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedManagedClusterAddonProfile.enabled = reader.getBoolean(); + } else if ("config".equals(fieldName)) { + Map config = reader.readMap(reader1 -> reader1.getString()); + deserializedManagedClusterAddonProfile.config = config; + } else if ("identity".equals(fieldName)) { + deserializedManagedClusterAddonProfile.identity + = ManagedClusterAddonProfileIdentity.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterAddonProfile; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAddonProfileIdentity.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAddonProfileIdentity.java new file mode 100644 index 000000000000..d0a9c5f094e9 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAddonProfileIdentity.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Information of user assigned identity used by this add-on. + */ +@Immutable +public final class ManagedClusterAddonProfileIdentity extends UserAssignedIdentity { + /** + * Creates an instance of ManagedClusterAddonProfileIdentity class. + */ + private ManagedClusterAddonProfileIdentity() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceId", resourceId()); + jsonWriter.writeStringField("clientId", clientId()); + jsonWriter.writeStringField("objectId", objectId()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterAddonProfileIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterAddonProfileIdentity if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedClusterAddonProfileIdentity. + */ + public static ManagedClusterAddonProfileIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterAddonProfileIdentity deserializedManagedClusterAddonProfileIdentity + = new ManagedClusterAddonProfileIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceId".equals(fieldName)) { + deserializedManagedClusterAddonProfileIdentity.withResourceId(reader.getString()); + } else if ("clientId".equals(fieldName)) { + deserializedManagedClusterAddonProfileIdentity.withClientId(reader.getString()); + } else if ("objectId".equals(fieldName)) { + deserializedManagedClusterAddonProfileIdentity.withObjectId(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterAddonProfileIdentity; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAgentPoolProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAgentPoolProfile.java new file mode 100644 index 000000000000..3ea7c4a4d31a --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAgentPoolProfile.java @@ -0,0 +1,802 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterAgentPoolProfileProperties; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Profile for the container service agent pool. + */ +@Fluent +public final class ManagedClusterAgentPoolProfile extends ManagedClusterAgentPoolProfileProperties { + /* + * Unique name of the agent pool profile in the context of the subscription and resource group. Windows agent pool + * names must be 6 characters or less. + */ + private String name; + + /* + * The current deployment or provisioning state. + */ + private String provisioningState; + + /* + * The version of node image + */ + private String nodeImageVersion; + + /* + * The version of Kubernetes the Agent Pool is running. If orchestratorVersion is a fully specified version + * , this field will be exactly equal to it. If orchestratorVersion is , this field + * will contain the full version being used. + */ + private String currentOrchestratorVersion; + + /* + * Unique read-only string used to implement optimistic concurrency. The eTag value will change when the resource is + * updated. Specify an if-match or if-none-match header with the eTag value for a subsequent request to enable + * optimistic concurrency per the normal eTag convention. + */ + private String eTag; + + /** + * Creates an instance of ManagedClusterAgentPoolProfile class. + */ + public ManagedClusterAgentPoolProfile() { + } + + /** + * Get the name property: Unique name of the agent pool profile in the context of the subscription and resource + * group. Windows agent pool names must be 6 characters or less. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Unique name of the agent pool profile in the context of the subscription and resource + * group. Windows agent pool names must be 6 characters or less. + * + * @param name the name value to set. + * @return the ManagedClusterAgentPoolProfile object itself. + */ + public ManagedClusterAgentPoolProfile withName(String name) { + this.name = name; + return this; + } + + /** + * Get the provisioningState property: The current deployment or provisioning state. + * + * @return the provisioningState value. + */ + @Override + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the nodeImageVersion property: The version of node image. + * + * @return the nodeImageVersion value. + */ + @Override + public String nodeImageVersion() { + return this.nodeImageVersion; + } + + /** + * Get the currentOrchestratorVersion property: The version of Kubernetes the Agent Pool is running. 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. + * + * @return the currentOrchestratorVersion value. + */ + @Override + public String currentOrchestratorVersion() { + return this.currentOrchestratorVersion; + } + + /** + * Get the eTag property: Unique read-only string used to implement optimistic concurrency. The eTag value will + * change when the resource is updated. Specify an if-match or if-none-match header with the eTag value for a + * subsequent request to enable optimistic concurrency per the normal eTag convention. + * + * @return the eTag value. + */ + @Override + public String eTag() { + return this.eTag; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withCount(Integer count) { + super.withCount(count); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withVmSize(String vmSize) { + super.withVmSize(vmSize); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withOsDiskSizeGB(Integer osDiskSizeGB) { + super.withOsDiskSizeGB(osDiskSizeGB); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withOsDiskType(OSDiskType osDiskType) { + super.withOsDiskType(osDiskType); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withKubeletDiskType(KubeletDiskType kubeletDiskType) { + super.withKubeletDiskType(kubeletDiskType); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withWorkloadRuntime(WorkloadRuntime workloadRuntime) { + super.withWorkloadRuntime(workloadRuntime); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withMessageOfTheDay(String messageOfTheDay) { + super.withMessageOfTheDay(messageOfTheDay); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withVnetSubnetID(String vnetSubnetID) { + super.withVnetSubnetID(vnetSubnetID); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withPodSubnetID(String podSubnetID) { + super.withPodSubnetID(podSubnetID); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withPodIPAllocationMode(PodIPAllocationMode podIPAllocationMode) { + super.withPodIPAllocationMode(podIPAllocationMode); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withMaxPods(Integer maxPods) { + super.withMaxPods(maxPods); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withOsType(OSType osType) { + super.withOsType(osType); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withOsSKU(OSSKU osSKU) { + super.withOsSKU(osSKU); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withMaxCount(Integer maxCount) { + super.withMaxCount(maxCount); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withMinCount(Integer minCount) { + super.withMinCount(minCount); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withEnableAutoScaling(Boolean enableAutoScaling) { + super.withEnableAutoScaling(enableAutoScaling); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withScaleDownMode(ScaleDownMode scaleDownMode) { + super.withScaleDownMode(scaleDownMode); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withType(AgentPoolType type) { + super.withType(type); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withMode(AgentPoolMode mode) { + super.withMode(mode); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withOrchestratorVersion(String orchestratorVersion) { + super.withOrchestratorVersion(orchestratorVersion); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withUpgradeSettings(AgentPoolUpgradeSettings upgradeSettings) { + super.withUpgradeSettings(upgradeSettings); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withPowerState(PowerState powerState) { + super.withPowerState(powerState); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withAvailabilityZones(List availabilityZones) { + super.withAvailabilityZones(availabilityZones); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withEnableNodePublicIP(Boolean enableNodePublicIP) { + super.withEnableNodePublicIP(enableNodePublicIP); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withNodePublicIPPrefixID(String nodePublicIPPrefixID) { + super.withNodePublicIPPrefixID(nodePublicIPPrefixID); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withScaleSetPriority(ScaleSetPriority scaleSetPriority) { + super.withScaleSetPriority(scaleSetPriority); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withScaleSetEvictionPolicy(ScaleSetEvictionPolicy scaleSetEvictionPolicy) { + super.withScaleSetEvictionPolicy(scaleSetEvictionPolicy); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withSpotMaxPrice(Double spotMaxPrice) { + super.withSpotMaxPrice(spotMaxPrice); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withNodeLabels(Map nodeLabels) { + super.withNodeLabels(nodeLabels); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withNodeTaints(List nodeTaints) { + super.withNodeTaints(nodeTaints); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withProximityPlacementGroupID(String proximityPlacementGroupID) { + super.withProximityPlacementGroupID(proximityPlacementGroupID); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withKubeletConfig(KubeletConfig kubeletConfig) { + super.withKubeletConfig(kubeletConfig); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withLinuxOSConfig(LinuxOSConfig linuxOSConfig) { + super.withLinuxOSConfig(linuxOSConfig); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withEnableEncryptionAtHost(Boolean enableEncryptionAtHost) { + super.withEnableEncryptionAtHost(enableEncryptionAtHost); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withEnableUltraSSD(Boolean enableUltraSSD) { + super.withEnableUltraSSD(enableUltraSSD); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withEnableFIPS(Boolean enableFIPS) { + super.withEnableFIPS(enableFIPS); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withGpuInstanceProfile(GPUInstanceProfile gpuInstanceProfile) { + super.withGpuInstanceProfile(gpuInstanceProfile); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withCreationData(CreationData creationData) { + super.withCreationData(creationData); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withCapacityReservationGroupID(String capacityReservationGroupID) { + super.withCapacityReservationGroupID(capacityReservationGroupID); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withHostGroupID(String hostGroupID) { + super.withHostGroupID(hostGroupID); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withNetworkProfile(AgentPoolNetworkProfile networkProfile) { + super.withNetworkProfile(networkProfile); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withWindowsProfile(AgentPoolWindowsProfile windowsProfile) { + super.withWindowsProfile(windowsProfile); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withSecurityProfile(AgentPoolSecurityProfile securityProfile) { + super.withSecurityProfile(securityProfile); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withGpuProfile(GPUProfile gpuProfile) { + super.withGpuProfile(gpuProfile); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withGatewayProfile(AgentPoolGatewayProfile gatewayProfile) { + super.withGatewayProfile(gatewayProfile); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withVirtualMachinesProfile(VirtualMachinesProfile virtualMachinesProfile) { + super.withVirtualMachinesProfile(virtualMachinesProfile); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile + withVirtualMachineNodesStatus(List virtualMachineNodesStatus) { + super.withVirtualMachineNodesStatus(virtualMachineNodesStatus); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withStatus(AgentPoolStatus status) { + super.withStatus(status); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedClusterAgentPoolProfile withLocalDNSProfile(LocalDNSProfile localDNSProfile) { + super.withLocalDNSProfile(localDNSProfile); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("count", count()); + jsonWriter.writeStringField("vmSize", vmSize()); + jsonWriter.writeNumberField("osDiskSizeGB", osDiskSizeGB()); + jsonWriter.writeStringField("osDiskType", osDiskType() == null ? null : osDiskType().toString()); + jsonWriter.writeStringField("kubeletDiskType", kubeletDiskType() == null ? null : kubeletDiskType().toString()); + jsonWriter.writeStringField("workloadRuntime", workloadRuntime() == null ? null : workloadRuntime().toString()); + jsonWriter.writeStringField("messageOfTheDay", messageOfTheDay()); + jsonWriter.writeStringField("vnetSubnetID", vnetSubnetID()); + jsonWriter.writeStringField("podSubnetID", podSubnetID()); + jsonWriter.writeStringField("podIPAllocationMode", + podIPAllocationMode() == null ? null : podIPAllocationMode().toString()); + jsonWriter.writeNumberField("maxPods", maxPods()); + jsonWriter.writeStringField("osType", osType() == null ? null : osType().toString()); + jsonWriter.writeStringField("osSKU", osSKU() == null ? null : osSKU().toString()); + jsonWriter.writeNumberField("maxCount", maxCount()); + jsonWriter.writeNumberField("minCount", minCount()); + jsonWriter.writeBooleanField("enableAutoScaling", enableAutoScaling()); + jsonWriter.writeStringField("scaleDownMode", scaleDownMode() == null ? null : scaleDownMode().toString()); + jsonWriter.writeStringField("type", type() == null ? null : type().toString()); + jsonWriter.writeStringField("mode", mode() == null ? null : mode().toString()); + jsonWriter.writeStringField("orchestratorVersion", orchestratorVersion()); + jsonWriter.writeJsonField("upgradeSettings", upgradeSettings()); + jsonWriter.writeJsonField("powerState", powerState()); + jsonWriter.writeArrayField("availabilityZones", availabilityZones(), + (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("enableNodePublicIP", enableNodePublicIP()); + jsonWriter.writeStringField("nodePublicIPPrefixID", nodePublicIPPrefixID()); + jsonWriter.writeStringField("scaleSetPriority", + scaleSetPriority() == null ? null : scaleSetPriority().toString()); + jsonWriter.writeStringField("scaleSetEvictionPolicy", + scaleSetEvictionPolicy() == null ? null : scaleSetEvictionPolicy().toString()); + jsonWriter.writeNumberField("spotMaxPrice", spotMaxPrice()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("nodeLabels", nodeLabels(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("nodeTaints", nodeTaints(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("proximityPlacementGroupID", proximityPlacementGroupID()); + jsonWriter.writeJsonField("kubeletConfig", kubeletConfig()); + jsonWriter.writeJsonField("linuxOSConfig", linuxOSConfig()); + jsonWriter.writeBooleanField("enableEncryptionAtHost", enableEncryptionAtHost()); + jsonWriter.writeBooleanField("enableUltraSSD", enableUltraSSD()); + jsonWriter.writeBooleanField("enableFIPS", enableFIPS()); + jsonWriter.writeStringField("gpuInstanceProfile", + gpuInstanceProfile() == null ? null : gpuInstanceProfile().toString()); + jsonWriter.writeJsonField("creationData", creationData()); + jsonWriter.writeStringField("capacityReservationGroupID", capacityReservationGroupID()); + jsonWriter.writeStringField("hostGroupID", hostGroupID()); + jsonWriter.writeJsonField("networkProfile", networkProfile()); + jsonWriter.writeJsonField("windowsProfile", windowsProfile()); + jsonWriter.writeJsonField("securityProfile", securityProfile()); + jsonWriter.writeJsonField("gpuProfile", gpuProfile()); + jsonWriter.writeJsonField("gatewayProfile", gatewayProfile()); + jsonWriter.writeJsonField("virtualMachinesProfile", virtualMachinesProfile()); + jsonWriter.writeArrayField("virtualMachineNodesStatus", virtualMachineNodesStatus(), + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("status", status()); + jsonWriter.writeJsonField("localDNSProfile", localDNSProfile()); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterAgentPoolProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterAgentPoolProfile if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ManagedClusterAgentPoolProfile. + */ + public static ManagedClusterAgentPoolProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterAgentPoolProfile deserializedManagedClusterAgentPoolProfile + = new ManagedClusterAgentPoolProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("eTag".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile.eTag = reader.getString(); + } else if ("count".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile.withCount(reader.getNullable(JsonReader::getInt)); + } else if ("vmSize".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile.withVmSize(reader.getString()); + } else if ("osDiskSizeGB".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile.withOsDiskSizeGB(reader.getNullable(JsonReader::getInt)); + } else if ("osDiskType".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile + .withOsDiskType(OSDiskType.fromString(reader.getString())); + } else if ("kubeletDiskType".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile + .withKubeletDiskType(KubeletDiskType.fromString(reader.getString())); + } else if ("workloadRuntime".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile + .withWorkloadRuntime(WorkloadRuntime.fromString(reader.getString())); + } else if ("messageOfTheDay".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile.withMessageOfTheDay(reader.getString()); + } else if ("vnetSubnetID".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile.withVnetSubnetID(reader.getString()); + } else if ("podSubnetID".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile.withPodSubnetID(reader.getString()); + } else if ("podIPAllocationMode".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile + .withPodIPAllocationMode(PodIPAllocationMode.fromString(reader.getString())); + } else if ("maxPods".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile.withMaxPods(reader.getNullable(JsonReader::getInt)); + } else if ("osType".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile.withOsType(OSType.fromString(reader.getString())); + } else if ("osSKU".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile.withOsSKU(OSSKU.fromString(reader.getString())); + } else if ("maxCount".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile.withMaxCount(reader.getNullable(JsonReader::getInt)); + } else if ("minCount".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile.withMinCount(reader.getNullable(JsonReader::getInt)); + } else if ("enableAutoScaling".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile + .withEnableAutoScaling(reader.getNullable(JsonReader::getBoolean)); + } else if ("scaleDownMode".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile + .withScaleDownMode(ScaleDownMode.fromString(reader.getString())); + } else if ("type".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile.withType(AgentPoolType.fromString(reader.getString())); + } else if ("mode".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile.withMode(AgentPoolMode.fromString(reader.getString())); + } else if ("orchestratorVersion".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile.withOrchestratorVersion(reader.getString()); + } else if ("currentOrchestratorVersion".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile.currentOrchestratorVersion = reader.getString(); + } else if ("nodeImageVersion".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile.nodeImageVersion = reader.getString(); + } else if ("upgradeSettings".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile + .withUpgradeSettings(AgentPoolUpgradeSettings.fromJson(reader)); + } else if ("provisioningState".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile.provisioningState = reader.getString(); + } else if ("powerState".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile.withPowerState(PowerState.fromJson(reader)); + } else if ("availabilityZones".equals(fieldName)) { + List availabilityZones = reader.readArray(reader1 -> reader1.getString()); + deserializedManagedClusterAgentPoolProfile.withAvailabilityZones(availabilityZones); + } else if ("enableNodePublicIP".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile + .withEnableNodePublicIP(reader.getNullable(JsonReader::getBoolean)); + } else if ("nodePublicIPPrefixID".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile.withNodePublicIPPrefixID(reader.getString()); + } else if ("scaleSetPriority".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile + .withScaleSetPriority(ScaleSetPriority.fromString(reader.getString())); + } else if ("scaleSetEvictionPolicy".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile + .withScaleSetEvictionPolicy(ScaleSetEvictionPolicy.fromString(reader.getString())); + } else if ("spotMaxPrice".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile + .withSpotMaxPrice(reader.getNullable(JsonReader::getDouble)); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedManagedClusterAgentPoolProfile.withTags(tags); + } else if ("nodeLabels".equals(fieldName)) { + Map nodeLabels = reader.readMap(reader1 -> reader1.getString()); + deserializedManagedClusterAgentPoolProfile.withNodeLabels(nodeLabels); + } else if ("nodeTaints".equals(fieldName)) { + List nodeTaints = reader.readArray(reader1 -> reader1.getString()); + deserializedManagedClusterAgentPoolProfile.withNodeTaints(nodeTaints); + } else if ("proximityPlacementGroupID".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile.withProximityPlacementGroupID(reader.getString()); + } else if ("kubeletConfig".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile.withKubeletConfig(KubeletConfig.fromJson(reader)); + } else if ("linuxOSConfig".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile.withLinuxOSConfig(LinuxOSConfig.fromJson(reader)); + } else if ("enableEncryptionAtHost".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile + .withEnableEncryptionAtHost(reader.getNullable(JsonReader::getBoolean)); + } else if ("enableUltraSSD".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile + .withEnableUltraSSD(reader.getNullable(JsonReader::getBoolean)); + } else if ("enableFIPS".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile + .withEnableFIPS(reader.getNullable(JsonReader::getBoolean)); + } else if ("gpuInstanceProfile".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile + .withGpuInstanceProfile(GPUInstanceProfile.fromString(reader.getString())); + } else if ("creationData".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile.withCreationData(CreationData.fromJson(reader)); + } else if ("capacityReservationGroupID".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile.withCapacityReservationGroupID(reader.getString()); + } else if ("hostGroupID".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile.withHostGroupID(reader.getString()); + } else if ("networkProfile".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile + .withNetworkProfile(AgentPoolNetworkProfile.fromJson(reader)); + } else if ("windowsProfile".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile + .withWindowsProfile(AgentPoolWindowsProfile.fromJson(reader)); + } else if ("securityProfile".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile + .withSecurityProfile(AgentPoolSecurityProfile.fromJson(reader)); + } else if ("gpuProfile".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile.withGpuProfile(GPUProfile.fromJson(reader)); + } else if ("gatewayProfile".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile + .withGatewayProfile(AgentPoolGatewayProfile.fromJson(reader)); + } else if ("virtualMachinesProfile".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile + .withVirtualMachinesProfile(VirtualMachinesProfile.fromJson(reader)); + } else if ("virtualMachineNodesStatus".equals(fieldName)) { + List virtualMachineNodesStatus + = reader.readArray(reader1 -> VirtualMachineNodes.fromJson(reader1)); + deserializedManagedClusterAgentPoolProfile.withVirtualMachineNodesStatus(virtualMachineNodesStatus); + } else if ("status".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile.withStatus(AgentPoolStatus.fromJson(reader)); + } else if ("localDNSProfile".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile.withLocalDNSProfile(LocalDNSProfile.fromJson(reader)); + } else if ("name".equals(fieldName)) { + deserializedManagedClusterAgentPoolProfile.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterAgentPoolProfile; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterApiServerAccessProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterApiServerAccessProfile.java new file mode 100644 index 000000000000..af26e1ff3c06 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterApiServerAccessProfile.java @@ -0,0 +1,291 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Access profile for managed cluster API server. + */ +@Fluent +public final class ManagedClusterApiServerAccessProfile + implements JsonSerializable { + /* + * The IP ranges authorized to access the Kubernetes API server. 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). + */ + private List authorizedIPRanges; + + /* + * Whether to create the cluster as a private cluster or not. For more details, see [Creating a private AKS + * cluster](https://docs.microsoft.com/azure/aks/private-clusters). + */ + private Boolean enablePrivateCluster; + + /* + * The private DNS zone mode for the cluster. 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'. + */ + private String privateDNSZone; + + /* + * Whether to create additional public FQDN for private cluster or not. + */ + private Boolean enablePrivateClusterPublicFQDN; + + /* + * Whether to disable run command for the cluster or not. + */ + private Boolean disableRunCommand; + + /* + * Whether to enable apiserver vnet integration for the cluster or not. See aka.ms/AksVnetIntegration for more + * details. + */ + private Boolean enableVnetIntegration; + + /* + * The subnet to be used when apiserver vnet integration is enabled. It is required when creating a new cluster with + * BYO Vnet, or when updating an existing cluster to enable apiserver vnet integration. + */ + private String subnetId; + + /** + * Creates an instance of ManagedClusterApiServerAccessProfile class. + */ + public ManagedClusterApiServerAccessProfile() { + } + + /** + * Get the authorizedIPRanges property: The IP ranges authorized to access the Kubernetes API server. 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). + * + * @return the authorizedIPRanges value. + */ + public List authorizedIPRanges() { + return this.authorizedIPRanges; + } + + /** + * Set the authorizedIPRanges property: The IP ranges authorized to access the Kubernetes API server. 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). + * + * @param authorizedIPRanges the authorizedIPRanges value to set. + * @return the ManagedClusterApiServerAccessProfile object itself. + */ + public ManagedClusterApiServerAccessProfile withAuthorizedIPRanges(List authorizedIPRanges) { + this.authorizedIPRanges = authorizedIPRanges; + return this; + } + + /** + * Get the enablePrivateCluster property: Whether to create the cluster as a private cluster or not. For more + * details, see [Creating a private AKS cluster](https://docs.microsoft.com/azure/aks/private-clusters). + * + * @return the enablePrivateCluster value. + */ + public Boolean enablePrivateCluster() { + return this.enablePrivateCluster; + } + + /** + * Set the enablePrivateCluster property: Whether to create the cluster as a private cluster or not. For more + * details, see [Creating a private AKS cluster](https://docs.microsoft.com/azure/aks/private-clusters). + * + * @param enablePrivateCluster the enablePrivateCluster value to set. + * @return the ManagedClusterApiServerAccessProfile object itself. + */ + public ManagedClusterApiServerAccessProfile withEnablePrivateCluster(Boolean enablePrivateCluster) { + this.enablePrivateCluster = enablePrivateCluster; + return this; + } + + /** + * Get the privateDNSZone property: The private DNS zone mode for the cluster. 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'. + * + * @return the privateDNSZone value. + */ + public String privateDNSZone() { + return this.privateDNSZone; + } + + /** + * Set the privateDNSZone property: The private DNS zone mode for the cluster. 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'. + * + * @param privateDNSZone the privateDNSZone value to set. + * @return the ManagedClusterApiServerAccessProfile object itself. + */ + public ManagedClusterApiServerAccessProfile withPrivateDNSZone(String privateDNSZone) { + this.privateDNSZone = privateDNSZone; + return this; + } + + /** + * Get the enablePrivateClusterPublicFQDN property: Whether to create additional public FQDN for private cluster or + * not. + * + * @return the enablePrivateClusterPublicFQDN value. + */ + public Boolean enablePrivateClusterPublicFQDN() { + return this.enablePrivateClusterPublicFQDN; + } + + /** + * Set the enablePrivateClusterPublicFQDN property: Whether to create additional public FQDN for private cluster or + * not. + * + * @param enablePrivateClusterPublicFQDN the enablePrivateClusterPublicFQDN value to set. + * @return the ManagedClusterApiServerAccessProfile object itself. + */ + public ManagedClusterApiServerAccessProfile + withEnablePrivateClusterPublicFQDN(Boolean enablePrivateClusterPublicFQDN) { + this.enablePrivateClusterPublicFQDN = enablePrivateClusterPublicFQDN; + return this; + } + + /** + * Get the disableRunCommand property: Whether to disable run command for the cluster or not. + * + * @return the disableRunCommand value. + */ + public Boolean disableRunCommand() { + return this.disableRunCommand; + } + + /** + * Set the disableRunCommand property: Whether to disable run command for the cluster or not. + * + * @param disableRunCommand the disableRunCommand value to set. + * @return the ManagedClusterApiServerAccessProfile object itself. + */ + public ManagedClusterApiServerAccessProfile withDisableRunCommand(Boolean disableRunCommand) { + this.disableRunCommand = disableRunCommand; + return this; + } + + /** + * Get the enableVnetIntegration property: Whether to enable apiserver vnet integration for the cluster or not. See + * aka.ms/AksVnetIntegration for more details. + * + * @return the enableVnetIntegration value. + */ + public Boolean enableVnetIntegration() { + return this.enableVnetIntegration; + } + + /** + * Set the enableVnetIntegration property: Whether to enable apiserver vnet integration for the cluster or not. See + * aka.ms/AksVnetIntegration for more details. + * + * @param enableVnetIntegration the enableVnetIntegration value to set. + * @return the ManagedClusterApiServerAccessProfile object itself. + */ + public ManagedClusterApiServerAccessProfile withEnableVnetIntegration(Boolean enableVnetIntegration) { + this.enableVnetIntegration = enableVnetIntegration; + return this; + } + + /** + * Get the subnetId property: The subnet to be used when apiserver vnet integration is enabled. It is required when + * creating a new cluster with BYO Vnet, or when updating an existing cluster to enable apiserver vnet integration. + * + * @return the subnetId value. + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set the subnetId property: The subnet to be used when apiserver vnet integration is enabled. It is required when + * creating a new cluster with BYO Vnet, or when updating an existing cluster to enable apiserver vnet integration. + * + * @param subnetId the subnetId value to set. + * @return the ManagedClusterApiServerAccessProfile object itself. + */ + public ManagedClusterApiServerAccessProfile withSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("authorizedIPRanges", this.authorizedIPRanges, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("enablePrivateCluster", this.enablePrivateCluster); + jsonWriter.writeStringField("privateDNSZone", this.privateDNSZone); + jsonWriter.writeBooleanField("enablePrivateClusterPublicFQDN", this.enablePrivateClusterPublicFQDN); + jsonWriter.writeBooleanField("disableRunCommand", this.disableRunCommand); + jsonWriter.writeBooleanField("enableVnetIntegration", this.enableVnetIntegration); + jsonWriter.writeStringField("subnetId", this.subnetId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterApiServerAccessProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterApiServerAccessProfile if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedClusterApiServerAccessProfile. + */ + public static ManagedClusterApiServerAccessProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterApiServerAccessProfile deserializedManagedClusterApiServerAccessProfile + = new ManagedClusterApiServerAccessProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("authorizedIPRanges".equals(fieldName)) { + List authorizedIPRanges = reader.readArray(reader1 -> reader1.getString()); + deserializedManagedClusterApiServerAccessProfile.authorizedIPRanges = authorizedIPRanges; + } else if ("enablePrivateCluster".equals(fieldName)) { + deserializedManagedClusterApiServerAccessProfile.enablePrivateCluster + = reader.getNullable(JsonReader::getBoolean); + } else if ("privateDNSZone".equals(fieldName)) { + deserializedManagedClusterApiServerAccessProfile.privateDNSZone = reader.getString(); + } else if ("enablePrivateClusterPublicFQDN".equals(fieldName)) { + deserializedManagedClusterApiServerAccessProfile.enablePrivateClusterPublicFQDN + = reader.getNullable(JsonReader::getBoolean); + } else if ("disableRunCommand".equals(fieldName)) { + deserializedManagedClusterApiServerAccessProfile.disableRunCommand + = reader.getNullable(JsonReader::getBoolean); + } else if ("enableVnetIntegration".equals(fieldName)) { + deserializedManagedClusterApiServerAccessProfile.enableVnetIntegration + = reader.getNullable(JsonReader::getBoolean); + } else if ("subnetId".equals(fieldName)) { + deserializedManagedClusterApiServerAccessProfile.subnetId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterApiServerAccessProfile; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAutoUpgradeProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAutoUpgradeProfile.java new file mode 100644 index 000000000000..153259bcf02d --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAutoUpgradeProfile.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Auto upgrade profile for a managed cluster. + */ +@Fluent +public final class ManagedClusterAutoUpgradeProfile implements JsonSerializable { + /* + * The upgrade channel for auto upgrade. The default is 'none'. For more information see [setting the AKS cluster + * auto-upgrade channel](https://docs.microsoft.com/azure/aks/upgrade-cluster#set-auto-upgrade-channel). + */ + private UpgradeChannel upgradeChannel; + + /* + * Node OS Upgrade Channel. Manner in which the OS on your nodes is updated. The default is NodeImage. + */ + private NodeOSUpgradeChannel nodeOSUpgradeChannel; + + /** + * Creates an instance of ManagedClusterAutoUpgradeProfile class. + */ + public ManagedClusterAutoUpgradeProfile() { + } + + /** + * Get the upgradeChannel property: The upgrade channel for auto upgrade. The default is 'none'. For more + * information see [setting the AKS cluster auto-upgrade + * channel](https://docs.microsoft.com/azure/aks/upgrade-cluster#set-auto-upgrade-channel). + * + * @return the upgradeChannel value. + */ + public UpgradeChannel upgradeChannel() { + return this.upgradeChannel; + } + + /** + * Set the upgradeChannel property: The upgrade channel for auto upgrade. The default is 'none'. For more + * information see [setting the AKS cluster auto-upgrade + * channel](https://docs.microsoft.com/azure/aks/upgrade-cluster#set-auto-upgrade-channel). + * + * @param upgradeChannel the upgradeChannel value to set. + * @return the ManagedClusterAutoUpgradeProfile object itself. + */ + public ManagedClusterAutoUpgradeProfile withUpgradeChannel(UpgradeChannel upgradeChannel) { + this.upgradeChannel = upgradeChannel; + return this; + } + + /** + * Get the nodeOSUpgradeChannel property: Node OS Upgrade Channel. Manner in which the OS on your nodes is updated. + * The default is NodeImage. + * + * @return the nodeOSUpgradeChannel value. + */ + public NodeOSUpgradeChannel nodeOSUpgradeChannel() { + return this.nodeOSUpgradeChannel; + } + + /** + * Set the nodeOSUpgradeChannel property: Node OS Upgrade Channel. Manner in which the OS on your nodes is updated. + * The default is NodeImage. + * + * @param nodeOSUpgradeChannel the nodeOSUpgradeChannel value to set. + * @return the ManagedClusterAutoUpgradeProfile object itself. + */ + public ManagedClusterAutoUpgradeProfile withNodeOSUpgradeChannel(NodeOSUpgradeChannel nodeOSUpgradeChannel) { + this.nodeOSUpgradeChannel = nodeOSUpgradeChannel; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("upgradeChannel", + this.upgradeChannel == null ? null : this.upgradeChannel.toString()); + jsonWriter.writeStringField("nodeOSUpgradeChannel", + this.nodeOSUpgradeChannel == null ? null : this.nodeOSUpgradeChannel.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterAutoUpgradeProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterAutoUpgradeProfile if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedClusterAutoUpgradeProfile. + */ + public static ManagedClusterAutoUpgradeProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterAutoUpgradeProfile deserializedManagedClusterAutoUpgradeProfile + = new ManagedClusterAutoUpgradeProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("upgradeChannel".equals(fieldName)) { + deserializedManagedClusterAutoUpgradeProfile.upgradeChannel + = UpgradeChannel.fromString(reader.getString()); + } else if ("nodeOSUpgradeChannel".equals(fieldName)) { + deserializedManagedClusterAutoUpgradeProfile.nodeOSUpgradeChannel + = NodeOSUpgradeChannel.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterAutoUpgradeProfile; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAzureMonitorProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAzureMonitorProfile.java new file mode 100644 index 000000000000..5e68877b26b2 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAzureMonitorProfile.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Azure Monitor addon profiles for monitoring the managed cluster. + */ +@Fluent +public final class ManagedClusterAzureMonitorProfile implements JsonSerializable { + /* + * 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. + */ + private ManagedClusterAzureMonitorProfileMetrics metrics; + + /** + * Creates an instance of ManagedClusterAzureMonitorProfile class. + */ + public ManagedClusterAzureMonitorProfile() { + } + + /** + * Get the metrics property: 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. + * + * @return the metrics value. + */ + public ManagedClusterAzureMonitorProfileMetrics metrics() { + return this.metrics; + } + + /** + * Set the metrics property: 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. + * + * @param metrics the metrics value to set. + * @return the ManagedClusterAzureMonitorProfile object itself. + */ + public ManagedClusterAzureMonitorProfile withMetrics(ManagedClusterAzureMonitorProfileMetrics metrics) { + this.metrics = metrics; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("metrics", this.metrics); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterAzureMonitorProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterAzureMonitorProfile if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedClusterAzureMonitorProfile. + */ + public static ManagedClusterAzureMonitorProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterAzureMonitorProfile deserializedManagedClusterAzureMonitorProfile + = new ManagedClusterAzureMonitorProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("metrics".equals(fieldName)) { + deserializedManagedClusterAzureMonitorProfile.metrics + = ManagedClusterAzureMonitorProfileMetrics.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterAzureMonitorProfile; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAzureMonitorProfileKubeStateMetrics.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAzureMonitorProfileKubeStateMetrics.java new file mode 100644 index 000000000000..f31b91218167 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAzureMonitorProfileKubeStateMetrics.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * 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. + */ +@Fluent +public final class ManagedClusterAzureMonitorProfileKubeStateMetrics + implements JsonSerializable { + /* + * 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. + */ + private String metricLabelsAllowlist; + + /* + * 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. + */ + private String metricAnnotationsAllowList; + + /** + * Creates an instance of ManagedClusterAzureMonitorProfileKubeStateMetrics class. + */ + public ManagedClusterAzureMonitorProfileKubeStateMetrics() { + } + + /** + * Get the metricLabelsAllowlist property: 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. + * + * @return the metricLabelsAllowlist value. + */ + public String metricLabelsAllowlist() { + return this.metricLabelsAllowlist; + } + + /** + * Set the metricLabelsAllowlist property: 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. + * + * @param metricLabelsAllowlist the metricLabelsAllowlist value to set. + * @return the ManagedClusterAzureMonitorProfileKubeStateMetrics object itself. + */ + public ManagedClusterAzureMonitorProfileKubeStateMetrics withMetricLabelsAllowlist(String metricLabelsAllowlist) { + this.metricLabelsAllowlist = metricLabelsAllowlist; + return this; + } + + /** + * Get the metricAnnotationsAllowList property: 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. + * + * @return the metricAnnotationsAllowList value. + */ + public String metricAnnotationsAllowList() { + return this.metricAnnotationsAllowList; + } + + /** + * Set the metricAnnotationsAllowList property: 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. + * + * @param metricAnnotationsAllowList the metricAnnotationsAllowList value to set. + * @return the ManagedClusterAzureMonitorProfileKubeStateMetrics object itself. + */ + public ManagedClusterAzureMonitorProfileKubeStateMetrics + withMetricAnnotationsAllowList(String metricAnnotationsAllowList) { + this.metricAnnotationsAllowList = metricAnnotationsAllowList; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("metricLabelsAllowlist", this.metricLabelsAllowlist); + jsonWriter.writeStringField("metricAnnotationsAllowList", this.metricAnnotationsAllowList); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterAzureMonitorProfileKubeStateMetrics from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterAzureMonitorProfileKubeStateMetrics if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedClusterAzureMonitorProfileKubeStateMetrics. + */ + public static ManagedClusterAzureMonitorProfileKubeStateMetrics fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterAzureMonitorProfileKubeStateMetrics deserializedManagedClusterAzureMonitorProfileKubeStateMetrics + = new ManagedClusterAzureMonitorProfileKubeStateMetrics(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("metricLabelsAllowlist".equals(fieldName)) { + deserializedManagedClusterAzureMonitorProfileKubeStateMetrics.metricLabelsAllowlist + = reader.getString(); + } else if ("metricAnnotationsAllowList".equals(fieldName)) { + deserializedManagedClusterAzureMonitorProfileKubeStateMetrics.metricAnnotationsAllowList + = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterAzureMonitorProfileKubeStateMetrics; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAzureMonitorProfileMetrics.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAzureMonitorProfileMetrics.java new file mode 100644 index 000000000000..04a24dff18eb --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAzureMonitorProfileMetrics.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * 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. + */ +@Fluent +public final class ManagedClusterAzureMonitorProfileMetrics + implements JsonSerializable { + /* + * 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. + */ + private boolean enabled; + + /* + * 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. + */ + private ManagedClusterAzureMonitorProfileKubeStateMetrics kubeStateMetrics; + + /** + * Creates an instance of ManagedClusterAzureMonitorProfileMetrics class. + */ + public ManagedClusterAzureMonitorProfileMetrics() { + } + + /** + * Get the enabled property: 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. + * + * @return the enabled value. + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: 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. + * + * @param enabled the enabled value to set. + * @return the ManagedClusterAzureMonitorProfileMetrics object itself. + */ + public ManagedClusterAzureMonitorProfileMetrics withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the kubeStateMetrics property: 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. + * + * @return the kubeStateMetrics value. + */ + public ManagedClusterAzureMonitorProfileKubeStateMetrics kubeStateMetrics() { + return this.kubeStateMetrics; + } + + /** + * Set the kubeStateMetrics property: 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. + * + * @param kubeStateMetrics the kubeStateMetrics value to set. + * @return the ManagedClusterAzureMonitorProfileMetrics object itself. + */ + public ManagedClusterAzureMonitorProfileMetrics + withKubeStateMetrics(ManagedClusterAzureMonitorProfileKubeStateMetrics kubeStateMetrics) { + this.kubeStateMetrics = kubeStateMetrics; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeJsonField("kubeStateMetrics", this.kubeStateMetrics); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterAzureMonitorProfileMetrics from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterAzureMonitorProfileMetrics if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ManagedClusterAzureMonitorProfileMetrics. + */ + public static ManagedClusterAzureMonitorProfileMetrics fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterAzureMonitorProfileMetrics deserializedManagedClusterAzureMonitorProfileMetrics + = new ManagedClusterAzureMonitorProfileMetrics(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedManagedClusterAzureMonitorProfileMetrics.enabled = reader.getBoolean(); + } else if ("kubeStateMetrics".equals(fieldName)) { + deserializedManagedClusterAzureMonitorProfileMetrics.kubeStateMetrics + = ManagedClusterAzureMonitorProfileKubeStateMetrics.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterAzureMonitorProfileMetrics; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterBootstrapProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterBootstrapProfile.java new file mode 100644 index 000000000000..49db51cde974 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterBootstrapProfile.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The bootstrap profile. + */ +@Fluent +public final class ManagedClusterBootstrapProfile implements JsonSerializable { + /* + * The artifact source. The source where the artifacts are downloaded from. + */ + private ArtifactSource artifactSource; + + /* + * The resource Id of Azure Container Registry. The registry must have private network access, premium SKU and zone + * redundancy. + */ + private String containerRegistryId; + + /** + * Creates an instance of ManagedClusterBootstrapProfile class. + */ + public ManagedClusterBootstrapProfile() { + } + + /** + * Get the artifactSource property: The artifact source. The source where the artifacts are downloaded from. + * + * @return the artifactSource value. + */ + public ArtifactSource artifactSource() { + return this.artifactSource; + } + + /** + * Set the artifactSource property: The artifact source. The source where the artifacts are downloaded from. + * + * @param artifactSource the artifactSource value to set. + * @return the ManagedClusterBootstrapProfile object itself. + */ + public ManagedClusterBootstrapProfile withArtifactSource(ArtifactSource artifactSource) { + this.artifactSource = artifactSource; + return this; + } + + /** + * Get the containerRegistryId property: The resource Id of Azure Container Registry. The registry must have private + * network access, premium SKU and zone redundancy. + * + * @return the containerRegistryId value. + */ + public String containerRegistryId() { + return this.containerRegistryId; + } + + /** + * Set the containerRegistryId property: The resource Id of Azure Container Registry. The registry must have private + * network access, premium SKU and zone redundancy. + * + * @param containerRegistryId the containerRegistryId value to set. + * @return the ManagedClusterBootstrapProfile object itself. + */ + public ManagedClusterBootstrapProfile withContainerRegistryId(String containerRegistryId) { + this.containerRegistryId = containerRegistryId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("artifactSource", + this.artifactSource == null ? null : this.artifactSource.toString()); + jsonWriter.writeStringField("containerRegistryId", this.containerRegistryId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterBootstrapProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterBootstrapProfile if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedClusterBootstrapProfile. + */ + public static ManagedClusterBootstrapProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterBootstrapProfile deserializedManagedClusterBootstrapProfile + = new ManagedClusterBootstrapProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("artifactSource".equals(fieldName)) { + deserializedManagedClusterBootstrapProfile.artifactSource + = ArtifactSource.fromString(reader.getString()); + } else if ("containerRegistryId".equals(fieldName)) { + deserializedManagedClusterBootstrapProfile.containerRegistryId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterBootstrapProfile; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterCostAnalysis.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterCostAnalysis.java new file mode 100644 index 000000000000..9917ebb53e16 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterCostAnalysis.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The cost analysis configuration for the cluster. + */ +@Fluent +public final class ManagedClusterCostAnalysis implements JsonSerializable { + /* + * Whether to enable cost analysis. The Managed Cluster sku.tier must be set to 'Standard' or 'Premium' to enable + * this feature. Enabling this will add Kubernetes Namespace and Deployment details to the Cost Analysis views in + * the Azure portal. If not specified, the default is false. For more information see aka.ms/aks/docs/cost-analysis. + */ + private Boolean enabled; + + /** + * Creates an instance of ManagedClusterCostAnalysis class. + */ + public ManagedClusterCostAnalysis() { + } + + /** + * Get the enabled property: Whether to enable cost analysis. The Managed Cluster sku.tier must be set to 'Standard' + * or 'Premium' to enable this feature. Enabling this will add Kubernetes Namespace and Deployment details to the + * Cost Analysis views in the Azure portal. If not specified, the default is false. For more information see + * aka.ms/aks/docs/cost-analysis. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Whether to enable cost analysis. The Managed Cluster sku.tier must be set to 'Standard' + * or 'Premium' to enable this feature. Enabling this will add Kubernetes Namespace and Deployment details to the + * Cost Analysis views in the Azure portal. If not specified, the default is false. For more information see + * aka.ms/aks/docs/cost-analysis. + * + * @param enabled the enabled value to set. + * @return the ManagedClusterCostAnalysis object itself. + */ + public ManagedClusterCostAnalysis withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterCostAnalysis from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterCostAnalysis if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedClusterCostAnalysis. + */ + public static ManagedClusterCostAnalysis fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterCostAnalysis deserializedManagedClusterCostAnalysis = new ManagedClusterCostAnalysis(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedManagedClusterCostAnalysis.enabled = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterCostAnalysis; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterHttpProxyConfig.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterHttpProxyConfig.java new file mode 100644 index 000000000000..10d923c66930 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterHttpProxyConfig.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Cluster HTTP proxy configuration. + */ +@Fluent +public final class ManagedClusterHttpProxyConfig implements JsonSerializable { + /* + * The HTTP proxy server endpoint to use. + */ + private String httpProxy; + + /* + * The HTTPS proxy server endpoint to use. + */ + private String httpsProxy; + + /* + * The endpoints that should not go through proxy. + */ + private List noProxy; + + /* + * Alternative CA cert to use for connecting to proxy servers. + */ + private String trustedCa; + + /* + * Whether to enable HTTP proxy. If disabled, the specified proxy configuration will be not be set on pods and + * nodes. If not specified, the default is true. + */ + private Boolean enabled; + + /** + * Creates an instance of ManagedClusterHttpProxyConfig class. + */ + public ManagedClusterHttpProxyConfig() { + } + + /** + * Get the httpProxy property: The HTTP proxy server endpoint to use. + * + * @return the httpProxy value. + */ + public String httpProxy() { + return this.httpProxy; + } + + /** + * Set the httpProxy property: The HTTP proxy server endpoint to use. + * + * @param httpProxy the httpProxy value to set. + * @return the ManagedClusterHttpProxyConfig object itself. + */ + public ManagedClusterHttpProxyConfig withHttpProxy(String httpProxy) { + this.httpProxy = httpProxy; + return this; + } + + /** + * Get the httpsProxy property: The HTTPS proxy server endpoint to use. + * + * @return the httpsProxy value. + */ + public String httpsProxy() { + return this.httpsProxy; + } + + /** + * Set the httpsProxy property: The HTTPS proxy server endpoint to use. + * + * @param httpsProxy the httpsProxy value to set. + * @return the ManagedClusterHttpProxyConfig object itself. + */ + public ManagedClusterHttpProxyConfig withHttpsProxy(String httpsProxy) { + this.httpsProxy = httpsProxy; + return this; + } + + /** + * Get the noProxy property: The endpoints that should not go through proxy. + * + * @return the noProxy value. + */ + public List noProxy() { + return this.noProxy; + } + + /** + * Set the noProxy property: The endpoints that should not go through proxy. + * + * @param noProxy the noProxy value to set. + * @return the ManagedClusterHttpProxyConfig object itself. + */ + public ManagedClusterHttpProxyConfig withNoProxy(List noProxy) { + this.noProxy = noProxy; + return this; + } + + /** + * Get the trustedCa property: Alternative CA cert to use for connecting to proxy servers. + * + * @return the trustedCa value. + */ + public String trustedCa() { + return this.trustedCa; + } + + /** + * Set the trustedCa property: Alternative CA cert to use for connecting to proxy servers. + * + * @param trustedCa the trustedCa value to set. + * @return the ManagedClusterHttpProxyConfig object itself. + */ + public ManagedClusterHttpProxyConfig withTrustedCa(String trustedCa) { + this.trustedCa = trustedCa; + return this; + } + + /** + * Get the enabled property: Whether to enable HTTP proxy. If disabled, the specified proxy configuration will be + * not be set on pods and nodes. If not specified, the default is true. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Whether to enable HTTP proxy. If disabled, the specified proxy configuration will be + * not be set on pods and nodes. If not specified, the default is true. + * + * @param enabled the enabled value to set. + * @return the ManagedClusterHttpProxyConfig object itself. + */ + public ManagedClusterHttpProxyConfig withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("httpProxy", this.httpProxy); + jsonWriter.writeStringField("httpsProxy", this.httpsProxy); + jsonWriter.writeArrayField("noProxy", this.noProxy, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("trustedCa", this.trustedCa); + jsonWriter.writeBooleanField("enabled", this.enabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterHttpProxyConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterHttpProxyConfig if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedClusterHttpProxyConfig. + */ + public static ManagedClusterHttpProxyConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterHttpProxyConfig deserializedManagedClusterHttpProxyConfig + = new ManagedClusterHttpProxyConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("httpProxy".equals(fieldName)) { + deserializedManagedClusterHttpProxyConfig.httpProxy = reader.getString(); + } else if ("httpsProxy".equals(fieldName)) { + deserializedManagedClusterHttpProxyConfig.httpsProxy = reader.getString(); + } else if ("noProxy".equals(fieldName)) { + List noProxy = reader.readArray(reader1 -> reader1.getString()); + deserializedManagedClusterHttpProxyConfig.noProxy = noProxy; + } else if ("trustedCa".equals(fieldName)) { + deserializedManagedClusterHttpProxyConfig.trustedCa = reader.getString(); + } else if ("enabled".equals(fieldName)) { + deserializedManagedClusterHttpProxyConfig.enabled = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterHttpProxyConfig; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterIdentity.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterIdentity.java new file mode 100644 index 000000000000..dc2d48e6f12d --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterIdentity.java @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Identity for the managed cluster. + */ +@Fluent +public final class ManagedClusterIdentity implements JsonSerializable { + /* + * The principal id of the system assigned identity which is used by master components. + */ + private String principalId; + + /* + * The tenant id of the system assigned identity which is used by master components. + */ + private String tenantId; + + /* + * The type of identity used for the managed cluster. For more information see [use managed identities in + * AKS](https://docs.microsoft.com/azure/aks/use-managed-identity). + */ + private ResourceIdentityType type; + + /* + * The delegated identity resources assigned to this managed cluster. This can only be set by another Azure Resource + * Provider, and managed cluster only accept one delegated identity resource. Internal use only. + */ + private Map delegatedResources; + + /* + * The user identity associated with the managed cluster. This identity will be used in control plane. Only one user + * assigned identity is allowed. The keys must be ARM resource IDs in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/ + * userAssignedIdentities/{identityName}'. + */ + private Map userAssignedIdentities; + + /** + * Creates an instance of ManagedClusterIdentity class. + */ + public ManagedClusterIdentity() { + } + + /** + * Get the principalId property: The principal id of the system assigned identity which is used by master + * components. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant id of the system assigned identity which is used by master components. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the type property: The type of identity used for the managed cluster. For more information see [use managed + * identities in AKS](https://docs.microsoft.com/azure/aks/use-managed-identity). + * + * @return the type value. + */ + public ResourceIdentityType type() { + return this.type; + } + + /** + * Set the type property: The type of identity used for the managed cluster. For more information see [use managed + * identities in AKS](https://docs.microsoft.com/azure/aks/use-managed-identity). + * + * @param type the type value to set. + * @return the ManagedClusterIdentity object itself. + */ + public ManagedClusterIdentity withType(ResourceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the delegatedResources property: The delegated identity resources assigned to this managed cluster. This can + * only be set by another Azure Resource Provider, and managed cluster only accept one delegated identity resource. + * Internal use only. + * + * @return the delegatedResources value. + */ + public Map delegatedResources() { + return this.delegatedResources; + } + + /** + * Set the delegatedResources property: The delegated identity resources assigned to this managed cluster. This can + * only be set by another Azure Resource Provider, and managed cluster only accept one delegated identity resource. + * Internal use only. + * + * @param delegatedResources the delegatedResources value to set. + * @return the ManagedClusterIdentity object itself. + */ + public ManagedClusterIdentity withDelegatedResources(Map delegatedResources) { + this.delegatedResources = delegatedResources; + return this; + } + + /** + * Get the userAssignedIdentities property: The user identity associated with the managed cluster. This identity + * will be used in control plane. Only one user assigned identity is allowed. The keys must be ARM resource IDs in + * the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The user identity associated with the managed cluster. This identity + * will be used in control plane. Only one user assigned identity is allowed. The keys must be ARM resource IDs in + * the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ManagedClusterIdentity object itself. + */ + public ManagedClusterIdentity withUserAssignedIdentities( + Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeMapField("delegatedResources", this.delegatedResources, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeMapField("userAssignedIdentities", this.userAssignedIdentities, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterIdentity if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedClusterIdentity. + */ + public static ManagedClusterIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterIdentity deserializedManagedClusterIdentity = new ManagedClusterIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("principalId".equals(fieldName)) { + deserializedManagedClusterIdentity.principalId = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedManagedClusterIdentity.tenantId = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedManagedClusterIdentity.type = ResourceIdentityType.fromString(reader.getString()); + } else if ("delegatedResources".equals(fieldName)) { + Map delegatedResources + = reader.readMap(reader1 -> DelegatedResource.fromJson(reader1)); + deserializedManagedClusterIdentity.delegatedResources = delegatedResources; + } else if ("userAssignedIdentities".equals(fieldName)) { + Map userAssignedIdentities = reader + .readMap(reader1 -> ManagedServiceIdentityUserAssignedIdentitiesValue.fromJson(reader1)); + deserializedManagedClusterIdentity.userAssignedIdentities = userAssignedIdentities; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterIdentity; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterIngressProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterIngressProfile.java new file mode 100644 index 000000000000..e263347279de --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterIngressProfile.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Ingress profile for the container service cluster. + */ +@Fluent +public final class ManagedClusterIngressProfile implements JsonSerializable { + /* + * App Routing settings for the ingress profile. You can find an overview and onboarding guide for this feature at + * https://learn.microsoft.com/en-us/azure/aks/app-routing?tabs=default%2Cdeploy-app-default. + */ + private ManagedClusterIngressProfileWebAppRouting webAppRouting; + + /** + * Creates an instance of ManagedClusterIngressProfile class. + */ + public ManagedClusterIngressProfile() { + } + + /** + * Get the webAppRouting property: App Routing settings for the ingress profile. You can find an overview and + * onboarding guide for this feature at + * https://learn.microsoft.com/en-us/azure/aks/app-routing?tabs=default%2Cdeploy-app-default. + * + * @return the webAppRouting value. + */ + public ManagedClusterIngressProfileWebAppRouting webAppRouting() { + return this.webAppRouting; + } + + /** + * Set the webAppRouting property: App Routing settings for the ingress profile. You can find an overview and + * onboarding guide for this feature at + * https://learn.microsoft.com/en-us/azure/aks/app-routing?tabs=default%2Cdeploy-app-default. + * + * @param webAppRouting the webAppRouting value to set. + * @return the ManagedClusterIngressProfile object itself. + */ + public ManagedClusterIngressProfile withWebAppRouting(ManagedClusterIngressProfileWebAppRouting webAppRouting) { + this.webAppRouting = webAppRouting; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("webAppRouting", this.webAppRouting); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterIngressProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterIngressProfile if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedClusterIngressProfile. + */ + public static ManagedClusterIngressProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterIngressProfile deserializedManagedClusterIngressProfile = new ManagedClusterIngressProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("webAppRouting".equals(fieldName)) { + deserializedManagedClusterIngressProfile.webAppRouting + = ManagedClusterIngressProfileWebAppRouting.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterIngressProfile; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterIngressProfileNginx.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterIngressProfileNginx.java new file mode 100644 index 000000000000..31f8fc93b1ce --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterIngressProfileNginx.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Nginx ingress controller configuration for the managed cluster ingress profile. + */ +@Fluent +public final class ManagedClusterIngressProfileNginx implements JsonSerializable { + /* + * Ingress type for the default NginxIngressController custom resource + */ + private NginxIngressControllerType defaultIngressControllerType; + + /** + * Creates an instance of ManagedClusterIngressProfileNginx class. + */ + public ManagedClusterIngressProfileNginx() { + } + + /** + * Get the defaultIngressControllerType property: Ingress type for the default NginxIngressController custom + * resource. + * + * @return the defaultIngressControllerType value. + */ + public NginxIngressControllerType defaultIngressControllerType() { + return this.defaultIngressControllerType; + } + + /** + * Set the defaultIngressControllerType property: Ingress type for the default NginxIngressController custom + * resource. + * + * @param defaultIngressControllerType the defaultIngressControllerType value to set. + * @return the ManagedClusterIngressProfileNginx object itself. + */ + public ManagedClusterIngressProfileNginx + withDefaultIngressControllerType(NginxIngressControllerType defaultIngressControllerType) { + this.defaultIngressControllerType = defaultIngressControllerType; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("defaultIngressControllerType", + this.defaultIngressControllerType == null ? null : this.defaultIngressControllerType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterIngressProfileNginx from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterIngressProfileNginx if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedClusterIngressProfileNginx. + */ + public static ManagedClusterIngressProfileNginx fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterIngressProfileNginx deserializedManagedClusterIngressProfileNginx + = new ManagedClusterIngressProfileNginx(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("defaultIngressControllerType".equals(fieldName)) { + deserializedManagedClusterIngressProfileNginx.defaultIngressControllerType + = NginxIngressControllerType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterIngressProfileNginx; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterIngressProfileWebAppRouting.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterIngressProfileWebAppRouting.java new file mode 100644 index 000000000000..bc46af622aa2 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterIngressProfileWebAppRouting.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Application Routing add-on settings for the ingress profile. + */ +@Fluent +public final class ManagedClusterIngressProfileWebAppRouting + implements JsonSerializable { + /* + * Whether to enable the Application Routing add-on. + */ + private Boolean enabled; + + /* + * Resource IDs of the DNS zones to be associated with the Application Routing add-on. Used only when Application + * Routing add-on is enabled. Public and private DNS zones can be in different resource groups, but all public DNS + * zones must be in the same resource group and all private DNS zones must be in the same resource group. + */ + private List dnsZoneResourceIds; + + /* + * Configuration for the default NginxIngressController. See more at + * https://learn.microsoft.com/en-us/azure/aks/app-routing-nginx-configuration#the-default-nginx-ingress-controller. + */ + private ManagedClusterIngressProfileNginx nginx; + + /* + * Managed identity of the Application Routing add-on. This is the identity that should be granted permissions, for + * example, to manage the associated Azure DNS resource and get certificates from Azure Key Vault. See [this + * overview of the add-on](https://learn.microsoft.com/en-us/azure/aks/web-app-routing?tabs=with-osm) for more + * instructions. + */ + private UserAssignedIdentity identity; + + /** + * Creates an instance of ManagedClusterIngressProfileWebAppRouting class. + */ + public ManagedClusterIngressProfileWebAppRouting() { + } + + /** + * Get the enabled property: Whether to enable the Application Routing add-on. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Whether to enable the Application Routing add-on. + * + * @param enabled the enabled value to set. + * @return the ManagedClusterIngressProfileWebAppRouting object itself. + */ + public ManagedClusterIngressProfileWebAppRouting withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the dnsZoneResourceIds property: Resource IDs of the DNS zones to be associated with the Application Routing + * add-on. Used only when Application Routing add-on is enabled. Public and private DNS zones can be in different + * resource groups, but all public DNS zones must be in the same resource group and all private DNS zones must be in + * the same resource group. + * + * @return the dnsZoneResourceIds value. + */ + public List dnsZoneResourceIds() { + return this.dnsZoneResourceIds; + } + + /** + * Set the dnsZoneResourceIds property: Resource IDs of the DNS zones to be associated with the Application Routing + * add-on. Used only when Application Routing add-on is enabled. Public and private DNS zones can be in different + * resource groups, but all public DNS zones must be in the same resource group and all private DNS zones must be in + * the same resource group. + * + * @param dnsZoneResourceIds the dnsZoneResourceIds value to set. + * @return the ManagedClusterIngressProfileWebAppRouting object itself. + */ + public ManagedClusterIngressProfileWebAppRouting withDnsZoneResourceIds(List dnsZoneResourceIds) { + this.dnsZoneResourceIds = dnsZoneResourceIds; + return this; + } + + /** + * Get the nginx property: Configuration for the default NginxIngressController. See more at + * https://learn.microsoft.com/en-us/azure/aks/app-routing-nginx-configuration#the-default-nginx-ingress-controller. + * + * @return the nginx value. + */ + public ManagedClusterIngressProfileNginx nginx() { + return this.nginx; + } + + /** + * Set the nginx property: Configuration for the default NginxIngressController. See more at + * https://learn.microsoft.com/en-us/azure/aks/app-routing-nginx-configuration#the-default-nginx-ingress-controller. + * + * @param nginx the nginx value to set. + * @return the ManagedClusterIngressProfileWebAppRouting object itself. + */ + public ManagedClusterIngressProfileWebAppRouting withNginx(ManagedClusterIngressProfileNginx nginx) { + this.nginx = nginx; + return this; + } + + /** + * Get the identity property: Managed identity of the Application Routing add-on. This is the identity that should + * be granted permissions, for example, to manage the associated Azure DNS resource and get certificates from Azure + * Key Vault. See [this overview of the + * add-on](https://learn.microsoft.com/en-us/azure/aks/web-app-routing?tabs=with-osm) for more instructions. + * + * @return the identity value. + */ + public UserAssignedIdentity identity() { + return this.identity; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeArrayField("dnsZoneResourceIds", this.dnsZoneResourceIds, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("nginx", this.nginx); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterIngressProfileWebAppRouting from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterIngressProfileWebAppRouting if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedClusterIngressProfileWebAppRouting. + */ + public static ManagedClusterIngressProfileWebAppRouting fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterIngressProfileWebAppRouting deserializedManagedClusterIngressProfileWebAppRouting + = new ManagedClusterIngressProfileWebAppRouting(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedManagedClusterIngressProfileWebAppRouting.enabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("dnsZoneResourceIds".equals(fieldName)) { + List dnsZoneResourceIds = reader.readArray(reader1 -> reader1.getString()); + deserializedManagedClusterIngressProfileWebAppRouting.dnsZoneResourceIds = dnsZoneResourceIds; + } else if ("nginx".equals(fieldName)) { + deserializedManagedClusterIngressProfileWebAppRouting.nginx + = ManagedClusterIngressProfileNginx.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedManagedClusterIngressProfileWebAppRouting.identity + = UserAssignedIdentity.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterIngressProfileWebAppRouting; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterLoadBalancerProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterLoadBalancerProfile.java new file mode 100644 index 000000000000..162f3371691a --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterLoadBalancerProfile.java @@ -0,0 +1,292 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Profile of the managed cluster load balancer. + */ +@Fluent +public final class ManagedClusterLoadBalancerProfile implements JsonSerializable { + /* + * Desired managed outbound IPs for the cluster load balancer. + */ + private ManagedClusterLoadBalancerProfileManagedOutboundIPs managedOutboundIPs; + + /* + * Desired outbound IP Prefix resources for the cluster load balancer. + */ + private ManagedClusterLoadBalancerProfileOutboundIPPrefixes outboundIPPrefixes; + + /* + * Desired outbound IP resources for the cluster load balancer. + */ + private ManagedClusterLoadBalancerProfileOutboundIPs outboundIPs; + + /* + * The effective outbound IP resources of the cluster load balancer. + */ + private List effectiveOutboundIPs; + + /* + * 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. + */ + private Integer allocatedOutboundPorts; + + /* + * Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The + * default value is 30 minutes. + */ + private Integer idleTimeoutInMinutes; + + /* + * Enable multiple standard load balancers per AKS cluster or not. + */ + private Boolean enableMultipleStandardLoadBalancers; + + /* + * The type of the managed inbound Load Balancer BackendPool. + */ + private BackendPoolType backendPoolType; + + /** + * Creates an instance of ManagedClusterLoadBalancerProfile class. + */ + public ManagedClusterLoadBalancerProfile() { + } + + /** + * Get the managedOutboundIPs property: Desired managed outbound IPs for the cluster load balancer. + * + * @return the managedOutboundIPs value. + */ + public ManagedClusterLoadBalancerProfileManagedOutboundIPs managedOutboundIPs() { + return this.managedOutboundIPs; + } + + /** + * Set the managedOutboundIPs property: Desired managed outbound IPs for the cluster load balancer. + * + * @param managedOutboundIPs the managedOutboundIPs value to set. + * @return the ManagedClusterLoadBalancerProfile object itself. + */ + public ManagedClusterLoadBalancerProfile + withManagedOutboundIPs(ManagedClusterLoadBalancerProfileManagedOutboundIPs managedOutboundIPs) { + this.managedOutboundIPs = managedOutboundIPs; + return this; + } + + /** + * Get the outboundIPPrefixes property: Desired outbound IP Prefix resources for the cluster load balancer. + * + * @return the outboundIPPrefixes value. + */ + public ManagedClusterLoadBalancerProfileOutboundIPPrefixes outboundIPPrefixes() { + return this.outboundIPPrefixes; + } + + /** + * Set the outboundIPPrefixes property: Desired outbound IP Prefix resources for the cluster load balancer. + * + * @param outboundIPPrefixes the outboundIPPrefixes value to set. + * @return the ManagedClusterLoadBalancerProfile object itself. + */ + public ManagedClusterLoadBalancerProfile + withOutboundIPPrefixes(ManagedClusterLoadBalancerProfileOutboundIPPrefixes outboundIPPrefixes) { + this.outboundIPPrefixes = outboundIPPrefixes; + return this; + } + + /** + * Get the outboundIPs property: Desired outbound IP resources for the cluster load balancer. + * + * @return the outboundIPs value. + */ + public ManagedClusterLoadBalancerProfileOutboundIPs outboundIPs() { + return this.outboundIPs; + } + + /** + * Set the outboundIPs property: Desired outbound IP resources for the cluster load balancer. + * + * @param outboundIPs the outboundIPs value to set. + * @return the ManagedClusterLoadBalancerProfile object itself. + */ + public ManagedClusterLoadBalancerProfile withOutboundIPs(ManagedClusterLoadBalancerProfileOutboundIPs outboundIPs) { + this.outboundIPs = outboundIPs; + return this; + } + + /** + * Get the effectiveOutboundIPs property: The effective outbound IP resources of the cluster load balancer. + * + * @return the effectiveOutboundIPs value. + */ + public List effectiveOutboundIPs() { + return this.effectiveOutboundIPs; + } + + /** + * Get the allocatedOutboundPorts property: 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. + * + * @return the allocatedOutboundPorts value. + */ + public Integer allocatedOutboundPorts() { + return this.allocatedOutboundPorts; + } + + /** + * Set the allocatedOutboundPorts property: 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. + * + * @param allocatedOutboundPorts the allocatedOutboundPorts value to set. + * @return the ManagedClusterLoadBalancerProfile object itself. + */ + public ManagedClusterLoadBalancerProfile withAllocatedOutboundPorts(Integer allocatedOutboundPorts) { + this.allocatedOutboundPorts = allocatedOutboundPorts; + return this; + } + + /** + * Get the idleTimeoutInMinutes property: Desired outbound flow idle timeout in minutes. Allowed values are in the + * range of 4 to 120 (inclusive). The default value is 30 minutes. + * + * @return the idleTimeoutInMinutes value. + */ + public Integer idleTimeoutInMinutes() { + return this.idleTimeoutInMinutes; + } + + /** + * Set the idleTimeoutInMinutes property: Desired outbound flow idle timeout in minutes. Allowed values are in the + * range of 4 to 120 (inclusive). The default value is 30 minutes. + * + * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set. + * @return the ManagedClusterLoadBalancerProfile object itself. + */ + public ManagedClusterLoadBalancerProfile withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.idleTimeoutInMinutes = idleTimeoutInMinutes; + return this; + } + + /** + * Get the enableMultipleStandardLoadBalancers property: Enable multiple standard load balancers per AKS cluster or + * not. + * + * @return the enableMultipleStandardLoadBalancers value. + */ + public Boolean enableMultipleStandardLoadBalancers() { + return this.enableMultipleStandardLoadBalancers; + } + + /** + * Set the enableMultipleStandardLoadBalancers property: Enable multiple standard load balancers per AKS cluster or + * not. + * + * @param enableMultipleStandardLoadBalancers the enableMultipleStandardLoadBalancers value to set. + * @return the ManagedClusterLoadBalancerProfile object itself. + */ + public ManagedClusterLoadBalancerProfile + withEnableMultipleStandardLoadBalancers(Boolean enableMultipleStandardLoadBalancers) { + this.enableMultipleStandardLoadBalancers = enableMultipleStandardLoadBalancers; + return this; + } + + /** + * Get the backendPoolType property: The type of the managed inbound Load Balancer BackendPool. + * + * @return the backendPoolType value. + */ + public BackendPoolType backendPoolType() { + return this.backendPoolType; + } + + /** + * Set the backendPoolType property: The type of the managed inbound Load Balancer BackendPool. + * + * @param backendPoolType the backendPoolType value to set. + * @return the ManagedClusterLoadBalancerProfile object itself. + */ + public ManagedClusterLoadBalancerProfile withBackendPoolType(BackendPoolType backendPoolType) { + this.backendPoolType = backendPoolType; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("managedOutboundIPs", this.managedOutboundIPs); + jsonWriter.writeJsonField("outboundIPPrefixes", this.outboundIPPrefixes); + jsonWriter.writeJsonField("outboundIPs", this.outboundIPs); + jsonWriter.writeNumberField("allocatedOutboundPorts", this.allocatedOutboundPorts); + jsonWriter.writeNumberField("idleTimeoutInMinutes", this.idleTimeoutInMinutes); + jsonWriter.writeBooleanField("enableMultipleStandardLoadBalancers", this.enableMultipleStandardLoadBalancers); + jsonWriter.writeStringField("backendPoolType", + this.backendPoolType == null ? null : this.backendPoolType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterLoadBalancerProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterLoadBalancerProfile if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedClusterLoadBalancerProfile. + */ + public static ManagedClusterLoadBalancerProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterLoadBalancerProfile deserializedManagedClusterLoadBalancerProfile + = new ManagedClusterLoadBalancerProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("managedOutboundIPs".equals(fieldName)) { + deserializedManagedClusterLoadBalancerProfile.managedOutboundIPs + = ManagedClusterLoadBalancerProfileManagedOutboundIPs.fromJson(reader); + } else if ("outboundIPPrefixes".equals(fieldName)) { + deserializedManagedClusterLoadBalancerProfile.outboundIPPrefixes + = ManagedClusterLoadBalancerProfileOutboundIPPrefixes.fromJson(reader); + } else if ("outboundIPs".equals(fieldName)) { + deserializedManagedClusterLoadBalancerProfile.outboundIPs + = ManagedClusterLoadBalancerProfileOutboundIPs.fromJson(reader); + } else if ("effectiveOutboundIPs".equals(fieldName)) { + List effectiveOutboundIPs + = reader.readArray(reader1 -> ResourceReference.fromJson(reader1)); + deserializedManagedClusterLoadBalancerProfile.effectiveOutboundIPs = effectiveOutboundIPs; + } else if ("allocatedOutboundPorts".equals(fieldName)) { + deserializedManagedClusterLoadBalancerProfile.allocatedOutboundPorts + = reader.getNullable(JsonReader::getInt); + } else if ("idleTimeoutInMinutes".equals(fieldName)) { + deserializedManagedClusterLoadBalancerProfile.idleTimeoutInMinutes + = reader.getNullable(JsonReader::getInt); + } else if ("enableMultipleStandardLoadBalancers".equals(fieldName)) { + deserializedManagedClusterLoadBalancerProfile.enableMultipleStandardLoadBalancers + = reader.getNullable(JsonReader::getBoolean); + } else if ("backendPoolType".equals(fieldName)) { + deserializedManagedClusterLoadBalancerProfile.backendPoolType + = BackendPoolType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterLoadBalancerProfile; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterLoadBalancerProfileManagedOutboundIPs.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterLoadBalancerProfileManagedOutboundIPs.java new file mode 100644 index 000000000000..81e34f33c1b7 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterLoadBalancerProfileManagedOutboundIPs.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Desired managed outbound IPs for the cluster load balancer. + */ +@Fluent +public final class ManagedClusterLoadBalancerProfileManagedOutboundIPs + implements JsonSerializable { + /* + * 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. + */ + private Integer count; + + /* + * 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. + */ + private Integer countIPv6; + + /** + * Creates an instance of ManagedClusterLoadBalancerProfileManagedOutboundIPs class. + */ + public ManagedClusterLoadBalancerProfileManagedOutboundIPs() { + } + + /** + * Get the count property: 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. + * + * @return the count value. + */ + public Integer count() { + return this.count; + } + + /** + * Set the count property: 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. + * + * @param count the count value to set. + * @return the ManagedClusterLoadBalancerProfileManagedOutboundIPs object itself. + */ + public ManagedClusterLoadBalancerProfileManagedOutboundIPs withCount(Integer count) { + this.count = count; + return this; + } + + /** + * Get the countIPv6 property: 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. + * + * @return the countIPv6 value. + */ + public Integer countIPv6() { + return this.countIPv6; + } + + /** + * Set the countIPv6 property: 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. + * + * @param countIPv6 the countIPv6 value to set. + * @return the ManagedClusterLoadBalancerProfileManagedOutboundIPs object itself. + */ + public ManagedClusterLoadBalancerProfileManagedOutboundIPs withCountIPv6(Integer countIPv6) { + this.countIPv6 = countIPv6; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("count", this.count); + jsonWriter.writeNumberField("countIPv6", this.countIPv6); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterLoadBalancerProfileManagedOutboundIPs from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterLoadBalancerProfileManagedOutboundIPs if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedClusterLoadBalancerProfileManagedOutboundIPs. + */ + public static ManagedClusterLoadBalancerProfileManagedOutboundIPs fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterLoadBalancerProfileManagedOutboundIPs deserializedManagedClusterLoadBalancerProfileManagedOutboundIPs + = new ManagedClusterLoadBalancerProfileManagedOutboundIPs(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("count".equals(fieldName)) { + deserializedManagedClusterLoadBalancerProfileManagedOutboundIPs.count + = reader.getNullable(JsonReader::getInt); + } else if ("countIPv6".equals(fieldName)) { + deserializedManagedClusterLoadBalancerProfileManagedOutboundIPs.countIPv6 + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterLoadBalancerProfileManagedOutboundIPs; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterLoadBalancerProfileOutboundIPPrefixes.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterLoadBalancerProfileOutboundIPPrefixes.java new file mode 100644 index 000000000000..0b8852acc474 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterLoadBalancerProfileOutboundIPPrefixes.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Desired outbound IP Prefix resources for the cluster load balancer. + */ +@Fluent +public final class ManagedClusterLoadBalancerProfileOutboundIPPrefixes + implements JsonSerializable { + /* + * A list of public IP prefix resources. + */ + private List publicIPPrefixes; + + /** + * Creates an instance of ManagedClusterLoadBalancerProfileOutboundIPPrefixes class. + */ + public ManagedClusterLoadBalancerProfileOutboundIPPrefixes() { + } + + /** + * Get the publicIPPrefixes property: A list of public IP prefix resources. + * + * @return the publicIPPrefixes value. + */ + public List publicIPPrefixes() { + return this.publicIPPrefixes; + } + + /** + * Set the publicIPPrefixes property: A list of public IP prefix resources. + * + * @param publicIPPrefixes the publicIPPrefixes value to set. + * @return the ManagedClusterLoadBalancerProfileOutboundIPPrefixes object itself. + */ + public ManagedClusterLoadBalancerProfileOutboundIPPrefixes + withPublicIPPrefixes(List publicIPPrefixes) { + this.publicIPPrefixes = publicIPPrefixes; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("publicIPPrefixes", this.publicIPPrefixes, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterLoadBalancerProfileOutboundIPPrefixes from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterLoadBalancerProfileOutboundIPPrefixes if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedClusterLoadBalancerProfileOutboundIPPrefixes. + */ + public static ManagedClusterLoadBalancerProfileOutboundIPPrefixes fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterLoadBalancerProfileOutboundIPPrefixes deserializedManagedClusterLoadBalancerProfileOutboundIPPrefixes + = new ManagedClusterLoadBalancerProfileOutboundIPPrefixes(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("publicIPPrefixes".equals(fieldName)) { + List publicIPPrefixes + = reader.readArray(reader1 -> ResourceReference.fromJson(reader1)); + deserializedManagedClusterLoadBalancerProfileOutboundIPPrefixes.publicIPPrefixes = publicIPPrefixes; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterLoadBalancerProfileOutboundIPPrefixes; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterLoadBalancerProfileOutboundIPs.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterLoadBalancerProfileOutboundIPs.java new file mode 100644 index 000000000000..6002a985a6f6 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterLoadBalancerProfileOutboundIPs.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Desired outbound IP resources for the cluster load balancer. + */ +@Fluent +public final class ManagedClusterLoadBalancerProfileOutboundIPs + implements JsonSerializable { + /* + * A list of public IP resources. + */ + private List publicIPs; + + /** + * Creates an instance of ManagedClusterLoadBalancerProfileOutboundIPs class. + */ + public ManagedClusterLoadBalancerProfileOutboundIPs() { + } + + /** + * Get the publicIPs property: A list of public IP resources. + * + * @return the publicIPs value. + */ + public List publicIPs() { + return this.publicIPs; + } + + /** + * Set the publicIPs property: A list of public IP resources. + * + * @param publicIPs the publicIPs value to set. + * @return the ManagedClusterLoadBalancerProfileOutboundIPs object itself. + */ + public ManagedClusterLoadBalancerProfileOutboundIPs withPublicIPs(List publicIPs) { + this.publicIPs = publicIPs; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("publicIPs", this.publicIPs, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterLoadBalancerProfileOutboundIPs from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterLoadBalancerProfileOutboundIPs if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedClusterLoadBalancerProfileOutboundIPs. + */ + public static ManagedClusterLoadBalancerProfileOutboundIPs fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterLoadBalancerProfileOutboundIPs deserializedManagedClusterLoadBalancerProfileOutboundIPs + = new ManagedClusterLoadBalancerProfileOutboundIPs(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("publicIPs".equals(fieldName)) { + List publicIPs + = reader.readArray(reader1 -> ResourceReference.fromJson(reader1)); + deserializedManagedClusterLoadBalancerProfileOutboundIPs.publicIPs = publicIPs; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterLoadBalancerProfileOutboundIPs; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterManagedOutboundIPProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterManagedOutboundIPProfile.java new file mode 100644 index 000000000000..88e25b205909 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterManagedOutboundIPProfile.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Profile of the managed outbound IP resources of the managed cluster. + */ +@Fluent +public final class ManagedClusterManagedOutboundIPProfile + implements JsonSerializable { + /* + * 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. + */ + private Integer count; + + /** + * Creates an instance of ManagedClusterManagedOutboundIPProfile class. + */ + public ManagedClusterManagedOutboundIPProfile() { + } + + /** + * Get the count property: 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. + * + * @return the count value. + */ + public Integer count() { + return this.count; + } + + /** + * Set the count property: 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. + * + * @param count the count value to set. + * @return the ManagedClusterManagedOutboundIPProfile object itself. + */ + public ManagedClusterManagedOutboundIPProfile withCount(Integer count) { + this.count = count; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("count", this.count); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterManagedOutboundIPProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterManagedOutboundIPProfile if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedClusterManagedOutboundIPProfile. + */ + public static ManagedClusterManagedOutboundIPProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterManagedOutboundIPProfile deserializedManagedClusterManagedOutboundIPProfile + = new ManagedClusterManagedOutboundIPProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("count".equals(fieldName)) { + deserializedManagedClusterManagedOutboundIPProfile.count = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterManagedOutboundIPProfile; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterMetricsProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterMetricsProfile.java new file mode 100644 index 000000000000..36df001f6a45 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterMetricsProfile.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The metrics profile for the ManagedCluster. + */ +@Fluent +public final class ManagedClusterMetricsProfile implements JsonSerializable { + /* + * The configuration for detailed per-Kubernetes resource cost analysis. + */ + private ManagedClusterCostAnalysis costAnalysis; + + /** + * Creates an instance of ManagedClusterMetricsProfile class. + */ + public ManagedClusterMetricsProfile() { + } + + /** + * Get the costAnalysis property: The configuration for detailed per-Kubernetes resource cost analysis. + * + * @return the costAnalysis value. + */ + public ManagedClusterCostAnalysis costAnalysis() { + return this.costAnalysis; + } + + /** + * Set the costAnalysis property: The configuration for detailed per-Kubernetes resource cost analysis. + * + * @param costAnalysis the costAnalysis value to set. + * @return the ManagedClusterMetricsProfile object itself. + */ + public ManagedClusterMetricsProfile withCostAnalysis(ManagedClusterCostAnalysis costAnalysis) { + this.costAnalysis = costAnalysis; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("costAnalysis", this.costAnalysis); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterMetricsProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterMetricsProfile if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedClusterMetricsProfile. + */ + public static ManagedClusterMetricsProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterMetricsProfile deserializedManagedClusterMetricsProfile = new ManagedClusterMetricsProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("costAnalysis".equals(fieldName)) { + deserializedManagedClusterMetricsProfile.costAnalysis = ManagedClusterCostAnalysis.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterMetricsProfile; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterNATGatewayProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterNATGatewayProfile.java new file mode 100644 index 000000000000..53c36e3dc720 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterNATGatewayProfile.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Profile of the managed cluster NAT gateway. + */ +@Fluent +public final class ManagedClusterNATGatewayProfile implements JsonSerializable { + /* + * Profile of the managed outbound IP resources of the cluster NAT gateway. + */ + private ManagedClusterManagedOutboundIPProfile managedOutboundIPProfile; + + /* + * The effective outbound IP resources of the cluster NAT gateway. + */ + private List effectiveOutboundIPs; + + /* + * Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The + * default value is 4 minutes. + */ + private Integer idleTimeoutInMinutes; + + /** + * Creates an instance of ManagedClusterNATGatewayProfile class. + */ + public ManagedClusterNATGatewayProfile() { + } + + /** + * Get the managedOutboundIPProfile property: Profile of the managed outbound IP resources of the cluster NAT + * gateway. + * + * @return the managedOutboundIPProfile value. + */ + public ManagedClusterManagedOutboundIPProfile managedOutboundIPProfile() { + return this.managedOutboundIPProfile; + } + + /** + * Set the managedOutboundIPProfile property: Profile of the managed outbound IP resources of the cluster NAT + * gateway. + * + * @param managedOutboundIPProfile the managedOutboundIPProfile value to set. + * @return the ManagedClusterNATGatewayProfile object itself. + */ + public ManagedClusterNATGatewayProfile + withManagedOutboundIPProfile(ManagedClusterManagedOutboundIPProfile managedOutboundIPProfile) { + this.managedOutboundIPProfile = managedOutboundIPProfile; + return this; + } + + /** + * Get the effectiveOutboundIPs property: The effective outbound IP resources of the cluster NAT gateway. + * + * @return the effectiveOutboundIPs value. + */ + public List effectiveOutboundIPs() { + return this.effectiveOutboundIPs; + } + + /** + * Get the idleTimeoutInMinutes property: Desired outbound flow idle timeout in minutes. Allowed values are in the + * range of 4 to 120 (inclusive). The default value is 4 minutes. + * + * @return the idleTimeoutInMinutes value. + */ + public Integer idleTimeoutInMinutes() { + return this.idleTimeoutInMinutes; + } + + /** + * Set the idleTimeoutInMinutes property: Desired outbound flow idle timeout in minutes. Allowed values are in the + * range of 4 to 120 (inclusive). The default value is 4 minutes. + * + * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set. + * @return the ManagedClusterNATGatewayProfile object itself. + */ + public ManagedClusterNATGatewayProfile withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.idleTimeoutInMinutes = idleTimeoutInMinutes; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("managedOutboundIPProfile", this.managedOutboundIPProfile); + jsonWriter.writeNumberField("idleTimeoutInMinutes", this.idleTimeoutInMinutes); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterNATGatewayProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterNATGatewayProfile if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedClusterNATGatewayProfile. + */ + public static ManagedClusterNATGatewayProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterNATGatewayProfile deserializedManagedClusterNATGatewayProfile + = new ManagedClusterNATGatewayProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("managedOutboundIPProfile".equals(fieldName)) { + deserializedManagedClusterNATGatewayProfile.managedOutboundIPProfile + = ManagedClusterManagedOutboundIPProfile.fromJson(reader); + } else if ("effectiveOutboundIPs".equals(fieldName)) { + List effectiveOutboundIPs + = reader.readArray(reader1 -> ResourceReference.fromJson(reader1)); + deserializedManagedClusterNATGatewayProfile.effectiveOutboundIPs = effectiveOutboundIPs; + } else if ("idleTimeoutInMinutes".equals(fieldName)) { + deserializedManagedClusterNATGatewayProfile.idleTimeoutInMinutes + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterNATGatewayProfile; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterNodeProvisioningProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterNodeProvisioningProfile.java new file mode 100644 index 000000000000..f653211151ac --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterNodeProvisioningProfile.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Node provisioning profile for the managed cluster. + */ +@Fluent +public final class ManagedClusterNodeProvisioningProfile + implements JsonSerializable { + /* + * The node provisioning mode. If not specified, the default is Manual. + */ + private NodeProvisioningMode mode; + + /* + * The set of default Karpenter NodePools (CRDs) configured for node provisioning. This field has no effect unless + * mode is 'Auto'. Warning: Changing this from Auto to None on an existing cluster will cause the default Karpenter + * NodePools to be deleted, which will drain and delete the nodes associated with those pools. It is strongly + * recommended to not do this unless there are idle nodes ready to take the pods evicted by that action. If not + * specified, the default is Auto. For more information see aka.ms/aks/nap#node-pools. + */ + private NodeProvisioningDefaultNodePools defaultNodePools; + + /** + * Creates an instance of ManagedClusterNodeProvisioningProfile class. + */ + public ManagedClusterNodeProvisioningProfile() { + } + + /** + * Get the mode property: The node provisioning mode. If not specified, the default is Manual. + * + * @return the mode value. + */ + public NodeProvisioningMode mode() { + return this.mode; + } + + /** + * Set the mode property: The node provisioning mode. If not specified, the default is Manual. + * + * @param mode the mode value to set. + * @return the ManagedClusterNodeProvisioningProfile object itself. + */ + public ManagedClusterNodeProvisioningProfile withMode(NodeProvisioningMode mode) { + this.mode = mode; + return this; + } + + /** + * Get the defaultNodePools property: The set of default Karpenter NodePools (CRDs) configured for node + * provisioning. This field has no effect unless mode is 'Auto'. Warning: Changing this from Auto to None on an + * existing cluster will cause the default Karpenter NodePools to be deleted, which will drain and delete the nodes + * associated with those pools. It is strongly recommended to not do this unless there are idle nodes ready to take + * the pods evicted by that action. If not specified, the default is Auto. For more information see + * aka.ms/aks/nap#node-pools. + * + * @return the defaultNodePools value. + */ + public NodeProvisioningDefaultNodePools defaultNodePools() { + return this.defaultNodePools; + } + + /** + * Set the defaultNodePools property: The set of default Karpenter NodePools (CRDs) configured for node + * provisioning. This field has no effect unless mode is 'Auto'. Warning: Changing this from Auto to None on an + * existing cluster will cause the default Karpenter NodePools to be deleted, which will drain and delete the nodes + * associated with those pools. It is strongly recommended to not do this unless there are idle nodes ready to take + * the pods evicted by that action. If not specified, the default is Auto. For more information see + * aka.ms/aks/nap#node-pools. + * + * @param defaultNodePools the defaultNodePools value to set. + * @return the ManagedClusterNodeProvisioningProfile object itself. + */ + public ManagedClusterNodeProvisioningProfile + withDefaultNodePools(NodeProvisioningDefaultNodePools defaultNodePools) { + this.defaultNodePools = defaultNodePools; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + jsonWriter.writeStringField("defaultNodePools", + this.defaultNodePools == null ? null : this.defaultNodePools.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterNodeProvisioningProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterNodeProvisioningProfile if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedClusterNodeProvisioningProfile. + */ + public static ManagedClusterNodeProvisioningProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterNodeProvisioningProfile deserializedManagedClusterNodeProvisioningProfile + = new ManagedClusterNodeProvisioningProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("mode".equals(fieldName)) { + deserializedManagedClusterNodeProvisioningProfile.mode + = NodeProvisioningMode.fromString(reader.getString()); + } else if ("defaultNodePools".equals(fieldName)) { + deserializedManagedClusterNodeProvisioningProfile.defaultNodePools + = NodeProvisioningDefaultNodePools.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterNodeProvisioningProfile; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterNodeResourceGroupProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterNodeResourceGroupProfile.java new file mode 100644 index 000000000000..b18ee426771d --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterNodeResourceGroupProfile.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Node resource group lockdown profile for a managed cluster. + */ +@Fluent +public final class ManagedClusterNodeResourceGroupProfile + implements JsonSerializable { + /* + * The restriction level applied to the cluster's node resource group. If not specified, the default is + * 'Unrestricted' + */ + private RestrictionLevel restrictionLevel; + + /** + * Creates an instance of ManagedClusterNodeResourceGroupProfile class. + */ + public ManagedClusterNodeResourceGroupProfile() { + } + + /** + * Get the restrictionLevel property: The restriction level applied to the cluster's node resource group. If not + * specified, the default is 'Unrestricted'. + * + * @return the restrictionLevel value. + */ + public RestrictionLevel restrictionLevel() { + return this.restrictionLevel; + } + + /** + * Set the restrictionLevel property: The restriction level applied to the cluster's node resource group. If not + * specified, the default is 'Unrestricted'. + * + * @param restrictionLevel the restrictionLevel value to set. + * @return the ManagedClusterNodeResourceGroupProfile object itself. + */ + public ManagedClusterNodeResourceGroupProfile withRestrictionLevel(RestrictionLevel restrictionLevel) { + this.restrictionLevel = restrictionLevel; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("restrictionLevel", + this.restrictionLevel == null ? null : this.restrictionLevel.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterNodeResourceGroupProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterNodeResourceGroupProfile if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedClusterNodeResourceGroupProfile. + */ + public static ManagedClusterNodeResourceGroupProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterNodeResourceGroupProfile deserializedManagedClusterNodeResourceGroupProfile + = new ManagedClusterNodeResourceGroupProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("restrictionLevel".equals(fieldName)) { + deserializedManagedClusterNodeResourceGroupProfile.restrictionLevel + = RestrictionLevel.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterNodeResourceGroupProfile; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterOIDCIssuerProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterOIDCIssuerProfile.java new file mode 100644 index 000000000000..53d726301eab --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterOIDCIssuerProfile.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The OIDC issuer profile of the Managed Cluster. + */ +@Fluent +public final class ManagedClusterOIDCIssuerProfile implements JsonSerializable { + /* + * The OIDC issuer url of the Managed Cluster. + */ + private String issuerUrl; + + /* + * Whether the OIDC issuer is enabled. + */ + private Boolean enabled; + + /** + * Creates an instance of ManagedClusterOIDCIssuerProfile class. + */ + public ManagedClusterOIDCIssuerProfile() { + } + + /** + * Get the issuerUrl property: The OIDC issuer url of the Managed Cluster. + * + * @return the issuerUrl value. + */ + public String issuerUrl() { + return this.issuerUrl; + } + + /** + * Get the enabled property: Whether the OIDC issuer is enabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Whether the OIDC issuer is enabled. + * + * @param enabled the enabled value to set. + * @return the ManagedClusterOIDCIssuerProfile object itself. + */ + public ManagedClusterOIDCIssuerProfile withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterOIDCIssuerProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterOIDCIssuerProfile if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedClusterOIDCIssuerProfile. + */ + public static ManagedClusterOIDCIssuerProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterOIDCIssuerProfile deserializedManagedClusterOIDCIssuerProfile + = new ManagedClusterOIDCIssuerProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("issuerURL".equals(fieldName)) { + deserializedManagedClusterOIDCIssuerProfile.issuerUrl = reader.getString(); + } else if ("enabled".equals(fieldName)) { + deserializedManagedClusterOIDCIssuerProfile.enabled = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterOIDCIssuerProfile; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentity.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentity.java new file mode 100644 index 000000000000..cb2ad6b7d700 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentity.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Details about the pod identity assigned to the Managed Cluster. + */ +@Fluent +public final class ManagedClusterPodIdentity implements JsonSerializable { + /* + * The name of the pod identity. + */ + private String name; + + /* + * The namespace of the pod identity. + */ + private String namespace; + + /* + * The binding selector to use for the AzureIdentityBinding resource. + */ + private String bindingSelector; + + /* + * The user assigned identity details. + */ + private UserAssignedIdentity identity; + + /* + * The current provisioning state of the pod identity. + */ + private ManagedClusterPodIdentityProvisioningState provisioningState; + + /* + * The provisioning information for the pod identity. + */ + private ManagedClusterPodIdentityProvisioningInfo provisioningInfo; + + /** + * Creates an instance of ManagedClusterPodIdentity class. + */ + public ManagedClusterPodIdentity() { + } + + /** + * Get the name property: The name of the pod identity. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the pod identity. + * + * @param name the name value to set. + * @return the ManagedClusterPodIdentity object itself. + */ + public ManagedClusterPodIdentity withName(String name) { + this.name = name; + return this; + } + + /** + * Get the namespace property: The namespace of the pod identity. + * + * @return the namespace value. + */ + public String namespace() { + return this.namespace; + } + + /** + * Set the namespace property: The namespace of the pod identity. + * + * @param namespace the namespace value to set. + * @return the ManagedClusterPodIdentity object itself. + */ + public ManagedClusterPodIdentity withNamespace(String namespace) { + this.namespace = namespace; + return this; + } + + /** + * Get the bindingSelector property: The binding selector to use for the AzureIdentityBinding resource. + * + * @return the bindingSelector value. + */ + public String bindingSelector() { + return this.bindingSelector; + } + + /** + * Set the bindingSelector property: The binding selector to use for the AzureIdentityBinding resource. + * + * @param bindingSelector the bindingSelector value to set. + * @return the ManagedClusterPodIdentity object itself. + */ + public ManagedClusterPodIdentity withBindingSelector(String bindingSelector) { + this.bindingSelector = bindingSelector; + return this; + } + + /** + * Get the identity property: The user assigned identity details. + * + * @return the identity value. + */ + public UserAssignedIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The user assigned identity details. + * + * @param identity the identity value to set. + * @return the ManagedClusterPodIdentity object itself. + */ + public ManagedClusterPodIdentity withIdentity(UserAssignedIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the provisioningState property: The current provisioning state of the pod identity. + * + * @return the provisioningState value. + */ + public ManagedClusterPodIdentityProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the provisioningInfo property: The provisioning information for the pod identity. + * + * @return the provisioningInfo value. + */ + public ManagedClusterPodIdentityProvisioningInfo provisioningInfo() { + return this.provisioningInfo; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("namespace", this.namespace); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeStringField("bindingSelector", this.bindingSelector); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterPodIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterPodIdentity if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ManagedClusterPodIdentity. + */ + public static ManagedClusterPodIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterPodIdentity deserializedManagedClusterPodIdentity = new ManagedClusterPodIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedManagedClusterPodIdentity.name = reader.getString(); + } else if ("namespace".equals(fieldName)) { + deserializedManagedClusterPodIdentity.namespace = reader.getString(); + } else if ("identity".equals(fieldName)) { + deserializedManagedClusterPodIdentity.identity = UserAssignedIdentity.fromJson(reader); + } else if ("bindingSelector".equals(fieldName)) { + deserializedManagedClusterPodIdentity.bindingSelector = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedManagedClusterPodIdentity.provisioningState + = ManagedClusterPodIdentityProvisioningState.fromString(reader.getString()); + } else if ("provisioningInfo".equals(fieldName)) { + deserializedManagedClusterPodIdentity.provisioningInfo + = ManagedClusterPodIdentityProvisioningInfo.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterPodIdentity; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityException.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityException.java new file mode 100644 index 000000000000..0a83385b175f --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityException.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * A pod identity exception, which allows pods with certain labels to access the Azure Instance Metadata Service (IMDS) + * endpoint without being intercepted by the node-managed identity (NMI) server. See [disable AAD Pod Identity for a + * specific Pod/Application](https://azure.github.io/aad-pod-identity/docs/configure/application_exception/) for more + * details. + */ +@Fluent +public final class ManagedClusterPodIdentityException implements JsonSerializable { + /* + * The name of the pod identity exception. + */ + private String name; + + /* + * The namespace of the pod identity exception. + */ + private String namespace; + + /* + * The pod labels to match. + */ + private Map podLabels; + + /** + * Creates an instance of ManagedClusterPodIdentityException class. + */ + public ManagedClusterPodIdentityException() { + } + + /** + * Get the name property: The name of the pod identity exception. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the pod identity exception. + * + * @param name the name value to set. + * @return the ManagedClusterPodIdentityException object itself. + */ + public ManagedClusterPodIdentityException withName(String name) { + this.name = name; + return this; + } + + /** + * Get the namespace property: The namespace of the pod identity exception. + * + * @return the namespace value. + */ + public String namespace() { + return this.namespace; + } + + /** + * Set the namespace property: The namespace of the pod identity exception. + * + * @param namespace the namespace value to set. + * @return the ManagedClusterPodIdentityException object itself. + */ + public ManagedClusterPodIdentityException withNamespace(String namespace) { + this.namespace = namespace; + return this; + } + + /** + * Get the podLabels property: The pod labels to match. + * + * @return the podLabels value. + */ + public Map podLabels() { + return this.podLabels; + } + + /** + * Set the podLabels property: The pod labels to match. + * + * @param podLabels the podLabels value to set. + * @return the ManagedClusterPodIdentityException object itself. + */ + public ManagedClusterPodIdentityException withPodLabels(Map podLabels) { + this.podLabels = podLabels; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("namespace", this.namespace); + jsonWriter.writeMapField("podLabels", this.podLabels, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterPodIdentityException from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterPodIdentityException if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ManagedClusterPodIdentityException. + */ + public static ManagedClusterPodIdentityException fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterPodIdentityException deserializedManagedClusterPodIdentityException + = new ManagedClusterPodIdentityException(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedManagedClusterPodIdentityException.name = reader.getString(); + } else if ("namespace".equals(fieldName)) { + deserializedManagedClusterPodIdentityException.namespace = reader.getString(); + } else if ("podLabels".equals(fieldName)) { + Map podLabels = reader.readMap(reader1 -> reader1.getString()); + deserializedManagedClusterPodIdentityException.podLabels = podLabels; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterPodIdentityException; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityProfile.java new file mode 100644 index 000000000000..9409bd77a535 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityProfile.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The pod identity profile of the Managed Cluster. See [use AAD pod + * identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity) for more details on pod identity + * integration. + */ +@Fluent +public final class ManagedClusterPodIdentityProfile implements JsonSerializable { + /* + * Whether the pod identity addon is enabled. + */ + private Boolean enabled; + + /* + * Whether pod identity is allowed to run on clusters with Kubenet networking. 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. + */ + private Boolean allowNetworkPluginKubenet; + + /* + * The pod identities to use in the cluster. + */ + private List userAssignedIdentities; + + /* + * The pod identity exceptions to allow. + */ + private List userAssignedIdentityExceptions; + + /** + * Creates an instance of ManagedClusterPodIdentityProfile class. + */ + public ManagedClusterPodIdentityProfile() { + } + + /** + * Get the enabled property: Whether the pod identity addon is enabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Whether the pod identity addon is enabled. + * + * @param enabled the enabled value to set. + * @return the ManagedClusterPodIdentityProfile object itself. + */ + public ManagedClusterPodIdentityProfile withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the allowNetworkPluginKubenet property: Whether pod identity is allowed to run on clusters with Kubenet + * networking. 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. + * + * @return the allowNetworkPluginKubenet value. + */ + public Boolean allowNetworkPluginKubenet() { + return this.allowNetworkPluginKubenet; + } + + /** + * Set the allowNetworkPluginKubenet property: Whether pod identity is allowed to run on clusters with Kubenet + * networking. 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. + * + * @param allowNetworkPluginKubenet the allowNetworkPluginKubenet value to set. + * @return the ManagedClusterPodIdentityProfile object itself. + */ + public ManagedClusterPodIdentityProfile withAllowNetworkPluginKubenet(Boolean allowNetworkPluginKubenet) { + this.allowNetworkPluginKubenet = allowNetworkPluginKubenet; + return this; + } + + /** + * Get the userAssignedIdentities property: The pod identities to use in the cluster. + * + * @return the userAssignedIdentities value. + */ + public List userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The pod identities to use in the cluster. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ManagedClusterPodIdentityProfile object itself. + */ + public ManagedClusterPodIdentityProfile + withUserAssignedIdentities(List userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Get the userAssignedIdentityExceptions property: The pod identity exceptions to allow. + * + * @return the userAssignedIdentityExceptions value. + */ + public List userAssignedIdentityExceptions() { + return this.userAssignedIdentityExceptions; + } + + /** + * Set the userAssignedIdentityExceptions property: The pod identity exceptions to allow. + * + * @param userAssignedIdentityExceptions the userAssignedIdentityExceptions value to set. + * @return the ManagedClusterPodIdentityProfile object itself. + */ + public ManagedClusterPodIdentityProfile + withUserAssignedIdentityExceptions(List userAssignedIdentityExceptions) { + this.userAssignedIdentityExceptions = userAssignedIdentityExceptions; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeBooleanField("allowNetworkPluginKubenet", this.allowNetworkPluginKubenet); + jsonWriter.writeArrayField("userAssignedIdentities", this.userAssignedIdentities, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("userAssignedIdentityExceptions", this.userAssignedIdentityExceptions, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterPodIdentityProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterPodIdentityProfile if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedClusterPodIdentityProfile. + */ + public static ManagedClusterPodIdentityProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterPodIdentityProfile deserializedManagedClusterPodIdentityProfile + = new ManagedClusterPodIdentityProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedManagedClusterPodIdentityProfile.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("allowNetworkPluginKubenet".equals(fieldName)) { + deserializedManagedClusterPodIdentityProfile.allowNetworkPluginKubenet + = reader.getNullable(JsonReader::getBoolean); + } else if ("userAssignedIdentities".equals(fieldName)) { + List userAssignedIdentities + = reader.readArray(reader1 -> ManagedClusterPodIdentity.fromJson(reader1)); + deserializedManagedClusterPodIdentityProfile.userAssignedIdentities = userAssignedIdentities; + } else if ("userAssignedIdentityExceptions".equals(fieldName)) { + List userAssignedIdentityExceptions + = reader.readArray(reader1 -> ManagedClusterPodIdentityException.fromJson(reader1)); + deserializedManagedClusterPodIdentityProfile.userAssignedIdentityExceptions + = userAssignedIdentityExceptions; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterPodIdentityProfile; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityProvisioningError.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityProvisioningError.java new file mode 100644 index 000000000000..0ab6c95f45d7 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityProvisioningError.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * An error response from the pod identity provisioning. + */ +@Immutable +public final class ManagedClusterPodIdentityProvisioningError + implements JsonSerializable { + /* + * Details about the error. + */ + private ManagedClusterPodIdentityProvisioningErrorBody error; + + /** + * Creates an instance of ManagedClusterPodIdentityProvisioningError class. + */ + private ManagedClusterPodIdentityProvisioningError() { + } + + /** + * Get the error property: Details about the error. + * + * @return the error value. + */ + public ManagedClusterPodIdentityProvisioningErrorBody error() { + return this.error; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("error", this.error); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterPodIdentityProvisioningError from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterPodIdentityProvisioningError if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedClusterPodIdentityProvisioningError. + */ + public static ManagedClusterPodIdentityProvisioningError fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterPodIdentityProvisioningError deserializedManagedClusterPodIdentityProvisioningError + = new ManagedClusterPodIdentityProvisioningError(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("error".equals(fieldName)) { + deserializedManagedClusterPodIdentityProvisioningError.error + = ManagedClusterPodIdentityProvisioningErrorBody.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterPodIdentityProvisioningError; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityProvisioningErrorBody.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityProvisioningErrorBody.java new file mode 100644 index 000000000000..ab63946d209d --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityProvisioningErrorBody.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * An error response from the pod identity provisioning. + */ +@Immutable +public final class ManagedClusterPodIdentityProvisioningErrorBody + implements JsonSerializable { + /* + * An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + */ + private String code; + + /* + * A message describing the error, intended to be suitable for display in a user interface. + */ + private String message; + + /* + * The target of the particular error. For example, the name of the property in error. + */ + private String target; + + /* + * A list of additional details about the error. + */ + private List details; + + /** + * Creates an instance of ManagedClusterPodIdentityProvisioningErrorBody class. + */ + private ManagedClusterPodIdentityProvisioningErrorBody() { + } + + /** + * Get the code property: An identifier for the error. Codes are invariant and are intended to be consumed + * programmatically. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Get the message property: A message describing the error, intended to be suitable for display in a user + * interface. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the target property: The target of the particular error. For example, the name of the property in error. + * + * @return the target value. + */ + public String target() { + return this.target; + } + + /** + * Get the details property: A list of additional details about the error. + * + * @return the details value. + */ + public List details() { + return this.details; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("code", this.code); + jsonWriter.writeStringField("message", this.message); + jsonWriter.writeStringField("target", this.target); + jsonWriter.writeArrayField("details", this.details, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterPodIdentityProvisioningErrorBody from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterPodIdentityProvisioningErrorBody if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedClusterPodIdentityProvisioningErrorBody. + */ + public static ManagedClusterPodIdentityProvisioningErrorBody fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterPodIdentityProvisioningErrorBody deserializedManagedClusterPodIdentityProvisioningErrorBody + = new ManagedClusterPodIdentityProvisioningErrorBody(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + deserializedManagedClusterPodIdentityProvisioningErrorBody.code = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedManagedClusterPodIdentityProvisioningErrorBody.message = reader.getString(); + } else if ("target".equals(fieldName)) { + deserializedManagedClusterPodIdentityProvisioningErrorBody.target = reader.getString(); + } else if ("details".equals(fieldName)) { + List details + = reader.readArray(reader1 -> ManagedClusterPodIdentityProvisioningErrorBody.fromJson(reader1)); + deserializedManagedClusterPodIdentityProvisioningErrorBody.details = details; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterPodIdentityProvisioningErrorBody; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityProvisioningInfo.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityProvisioningInfo.java new file mode 100644 index 000000000000..ecb02da99efe --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityProvisioningInfo.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Pod identity provisioning information. + */ +@Immutable +public final class ManagedClusterPodIdentityProvisioningInfo + implements JsonSerializable { + /* + * Pod identity assignment error (if any). + */ + private ManagedClusterPodIdentityProvisioningError error; + + /** + * Creates an instance of ManagedClusterPodIdentityProvisioningInfo class. + */ + private ManagedClusterPodIdentityProvisioningInfo() { + } + + /** + * Get the error property: Pod identity assignment error (if any). + * + * @return the error value. + */ + public ManagedClusterPodIdentityProvisioningError error() { + return this.error; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("error", this.error); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterPodIdentityProvisioningInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterPodIdentityProvisioningInfo if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedClusterPodIdentityProvisioningInfo. + */ + public static ManagedClusterPodIdentityProvisioningInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterPodIdentityProvisioningInfo deserializedManagedClusterPodIdentityProvisioningInfo + = new ManagedClusterPodIdentityProvisioningInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("error".equals(fieldName)) { + deserializedManagedClusterPodIdentityProvisioningInfo.error + = ManagedClusterPodIdentityProvisioningError.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterPodIdentityProvisioningInfo; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityProvisioningState.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityProvisioningState.java new file mode 100644 index 000000000000..d2161f27fbab --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityProvisioningState.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The current provisioning state of the pod identity. + */ +public final class ManagedClusterPodIdentityProvisioningState + extends ExpandableStringEnum { + /** + * Pod identity is assigned. + */ + public static final ManagedClusterPodIdentityProvisioningState ASSIGNED = fromString("Assigned"); + + /** + * Pod identity assignment was canceled. + */ + public static final ManagedClusterPodIdentityProvisioningState CANCELED = fromString("Canceled"); + + /** + * Pod identity is being deleted. + */ + public static final ManagedClusterPodIdentityProvisioningState DELETING = fromString("Deleting"); + + /** + * Pod identity assignment failed. + */ + public static final ManagedClusterPodIdentityProvisioningState FAILED = fromString("Failed"); + + /** + * Pod identity assignment succeeded. + */ + public static final ManagedClusterPodIdentityProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Pod identity is being updated. + */ + public static final ManagedClusterPodIdentityProvisioningState UPDATING = fromString("Updating"); + + /** + * Creates a new instance of ManagedClusterPodIdentityProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagedClusterPodIdentityProvisioningState() { + } + + /** + * Creates or finds a ManagedClusterPodIdentityProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedClusterPodIdentityProvisioningState. + */ + public static ManagedClusterPodIdentityProvisioningState fromString(String name) { + return fromString(name, ManagedClusterPodIdentityProvisioningState.class); + } + + /** + * Gets known ManagedClusterPodIdentityProvisioningState values. + * + * @return known ManagedClusterPodIdentityProvisioningState values. + */ + public static Collection values() { + return values(ManagedClusterPodIdentityProvisioningState.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPoolUpgradeProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPoolUpgradeProfile.java new file mode 100644 index 000000000000..b20a48964871 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPoolUpgradeProfile.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The list of available upgrade versions. + */ +@Immutable +public final class ManagedClusterPoolUpgradeProfile implements JsonSerializable { + /* + * The Kubernetes version (major.minor.patch). + */ + private String kubernetesVersion; + + /* + * The Agent Pool name. + */ + private String name; + + /* + * The operating system type. The default is Linux. + */ + private OSType osType; + + /* + * List of orchestrator types and versions available for upgrade. + */ + private List upgrades; + + /** + * Creates an instance of ManagedClusterPoolUpgradeProfile class. + */ + private ManagedClusterPoolUpgradeProfile() { + } + + /** + * Get the kubernetesVersion property: The Kubernetes version (major.minor.patch). + * + * @return the kubernetesVersion value. + */ + public String kubernetesVersion() { + return this.kubernetesVersion; + } + + /** + * Get the name property: The Agent Pool name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the osType property: The operating system type. The default is Linux. + * + * @return the osType value. + */ + public OSType osType() { + return this.osType; + } + + /** + * Get the upgrades property: List of orchestrator types and versions available for upgrade. + * + * @return the upgrades value. + */ + public List upgrades() { + return this.upgrades; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kubernetesVersion", this.kubernetesVersion); + jsonWriter.writeStringField("osType", this.osType == null ? null : this.osType.toString()); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeArrayField("upgrades", this.upgrades, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterPoolUpgradeProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterPoolUpgradeProfile if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ManagedClusterPoolUpgradeProfile. + */ + public static ManagedClusterPoolUpgradeProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterPoolUpgradeProfile deserializedManagedClusterPoolUpgradeProfile + = new ManagedClusterPoolUpgradeProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kubernetesVersion".equals(fieldName)) { + deserializedManagedClusterPoolUpgradeProfile.kubernetesVersion = reader.getString(); + } else if ("osType".equals(fieldName)) { + deserializedManagedClusterPoolUpgradeProfile.osType = OSType.fromString(reader.getString()); + } else if ("name".equals(fieldName)) { + deserializedManagedClusterPoolUpgradeProfile.name = reader.getString(); + } else if ("upgrades".equals(fieldName)) { + List upgrades + = reader.readArray(reader1 -> ManagedClusterPoolUpgradeProfileUpgradesItem.fromJson(reader1)); + deserializedManagedClusterPoolUpgradeProfile.upgrades = upgrades; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterPoolUpgradeProfile; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPoolUpgradeProfileUpgradesItem.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPoolUpgradeProfileUpgradesItem.java new file mode 100644 index 000000000000..3e99f50a3f95 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPoolUpgradeProfileUpgradesItem.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Available upgrades for an AgentPool. + */ +@Immutable +public final class ManagedClusterPoolUpgradeProfileUpgradesItem + implements JsonSerializable { + /* + * The Kubernetes version (major.minor.patch). + */ + private String kubernetesVersion; + + /* + * Whether the Kubernetes version is currently in preview. + */ + private Boolean isPreview; + + /** + * Creates an instance of ManagedClusterPoolUpgradeProfileUpgradesItem class. + */ + private ManagedClusterPoolUpgradeProfileUpgradesItem() { + } + + /** + * Get the kubernetesVersion property: The Kubernetes version (major.minor.patch). + * + * @return the kubernetesVersion value. + */ + public String kubernetesVersion() { + return this.kubernetesVersion; + } + + /** + * Get the isPreview property: Whether the Kubernetes version is currently in preview. + * + * @return the isPreview value. + */ + public Boolean isPreview() { + return this.isPreview; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kubernetesVersion", this.kubernetesVersion); + jsonWriter.writeBooleanField("isPreview", this.isPreview); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterPoolUpgradeProfileUpgradesItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterPoolUpgradeProfileUpgradesItem if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedClusterPoolUpgradeProfileUpgradesItem. + */ + public static ManagedClusterPoolUpgradeProfileUpgradesItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterPoolUpgradeProfileUpgradesItem deserializedManagedClusterPoolUpgradeProfileUpgradesItem + = new ManagedClusterPoolUpgradeProfileUpgradesItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kubernetesVersion".equals(fieldName)) { + deserializedManagedClusterPoolUpgradeProfileUpgradesItem.kubernetesVersion = reader.getString(); + } else if ("isPreview".equals(fieldName)) { + deserializedManagedClusterPoolUpgradeProfileUpgradesItem.isPreview + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterPoolUpgradeProfileUpgradesItem; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPropertiesAutoScalerProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPropertiesAutoScalerProfile.java new file mode 100644 index 000000000000..61425bce5bbf --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPropertiesAutoScalerProfile.java @@ -0,0 +1,727 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters to be applied to the cluster-autoscaler when enabled. + */ +@Fluent +public final class ManagedClusterPropertiesAutoScalerProfile + implements JsonSerializable { + /* + * Detects similar node pools and balances the number of nodes between them. Valid values are 'true' and 'false' + */ + private String balanceSimilarNodeGroups; + + /* + * DaemonSet pods will be gracefully terminated from empty nodes. If set to true, all daemonset pods on empty nodes + * will be evicted before deletion of the node. If the daemonset pod cannot be evicted another node will be chosen + * for scaling. If set to false, the node will be deleted without ensuring that daemonset pods are deleted or + * evicted. + */ + private Boolean daemonsetEvictionForEmptyNodes; + + /* + * DaemonSet pods will be gracefully terminated from non-empty nodes. If set to true, all daemonset pods on occupied + * nodes will be evicted before deletion of the node. If the daemonset pod cannot be evicted another node will be + * chosen for scaling. If set to false, the node will be deleted without ensuring that daemonset pods are deleted or + * evicted. + */ + private Boolean daemonsetEvictionForOccupiedNodes; + + /* + * Should CA ignore DaemonSet pods when calculating resource utilization for scaling down. If set to true, the + * resources used by daemonset will be taken into account when making scaling down decisions. + */ + private Boolean ignoreDaemonsetsUtilization; + + /* + * The expander to use when scaling up. 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. + */ + private Expander expander; + + /* + * The maximum number of empty nodes that can be deleted at the same time. This must be a positive integer. The + * default is 10. + */ + private String maxEmptyBulkDelete; + + /* + * The maximum number of seconds the cluster autoscaler waits for pod termination when trying to scale down a node. + * The default is 600. + */ + private String maxGracefulTerminationSec; + + /* + * The maximum time the autoscaler waits for a node to be provisioned. The default is '15m'. Values must be an + * integer followed by an 'm'. No unit of time other than minutes (m) is supported. + */ + private String maxNodeProvisionTime; + + /* + * The maximum percentage of unready nodes in the cluster. After this percentage is exceeded, cluster autoscaler + * halts operations. The default is 45. The maximum is 100 and the minimum is 0. + */ + private String maxTotalUnreadyPercentage; + + /* + * Ignore unscheduled pods before they're a certain age. 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). + */ + private String newPodScaleUpDelay; + + /* + * The number of allowed unready nodes, irrespective of max-total-unready-percentage. This must be an integer. The + * default is 3. + */ + private String okTotalUnreadyCount; + + /* + * How often cluster is reevaluated for scale up or down. The default is '10'. Values must be an integer number of + * seconds. + */ + private String scanInterval; + + /* + * How long after scale up that scale down evaluation resumes. The default is '10m'. Values must be an integer + * followed by an 'm'. No unit of time other than minutes (m) is supported. + */ + private String scaleDownDelayAfterAdd; + + /* + * How long after node deletion that scale down evaluation resumes. 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. + */ + private String scaleDownDelayAfterDelete; + + /* + * How long after scale down failure that scale down evaluation resumes. The default is '3m'. Values must be an + * integer followed by an 'm'. No unit of time other than minutes (m) is supported. + */ + private String scaleDownDelayAfterFailure; + + /* + * How long a node should be unneeded before it is eligible for scale down. The default is '10m'. Values must be an + * integer followed by an 'm'. No unit of time other than minutes (m) is supported. + */ + private String scaleDownUnneededTime; + + /* + * How long an unready node should be unneeded before it is eligible for scale down. The default is '20m'. Values + * must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + */ + private String scaleDownUnreadyTime; + + /* + * Node utilization level, defined as sum of requested resources divided by capacity, below which a node can be + * considered for scale down. The default is '0.5'. + */ + private String scaleDownUtilizationThreshold; + + /* + * If cluster autoscaler will skip deleting nodes with pods with local storage, for example, EmptyDir or HostPath. + * The default is true. + */ + private String skipNodesWithLocalStorage; + + /* + * If cluster autoscaler will skip deleting nodes with pods from kube-system (except for DaemonSet or mirror pods). + * The default is true. + */ + private String skipNodesWithSystemPods; + + /** + * Creates an instance of ManagedClusterPropertiesAutoScalerProfile class. + */ + public ManagedClusterPropertiesAutoScalerProfile() { + } + + /** + * Get the balanceSimilarNodeGroups property: Detects similar node pools and balances the number of nodes between + * them. Valid values are 'true' and 'false'. + * + * @return the balanceSimilarNodeGroups value. + */ + public String balanceSimilarNodeGroups() { + return this.balanceSimilarNodeGroups; + } + + /** + * Set the balanceSimilarNodeGroups property: Detects similar node pools and balances the number of nodes between + * them. Valid values are 'true' and 'false'. + * + * @param balanceSimilarNodeGroups the balanceSimilarNodeGroups value to set. + * @return the ManagedClusterPropertiesAutoScalerProfile object itself. + */ + public ManagedClusterPropertiesAutoScalerProfile withBalanceSimilarNodeGroups(String balanceSimilarNodeGroups) { + this.balanceSimilarNodeGroups = balanceSimilarNodeGroups; + return this; + } + + /** + * Get the daemonsetEvictionForEmptyNodes property: DaemonSet pods will be gracefully terminated from empty nodes. + * If set to true, all daemonset pods on empty nodes will be evicted before deletion of the node. If the daemonset + * pod cannot be evicted another node will be chosen for scaling. If set to false, the node will be deleted without + * ensuring that daemonset pods are deleted or evicted. + * + * @return the daemonsetEvictionForEmptyNodes value. + */ + public Boolean daemonsetEvictionForEmptyNodes() { + return this.daemonsetEvictionForEmptyNodes; + } + + /** + * Set the daemonsetEvictionForEmptyNodes property: DaemonSet pods will be gracefully terminated from empty nodes. + * If set to true, all daemonset pods on empty nodes will be evicted before deletion of the node. If the daemonset + * pod cannot be evicted another node will be chosen for scaling. If set to false, the node will be deleted without + * ensuring that daemonset pods are deleted or evicted. + * + * @param daemonsetEvictionForEmptyNodes the daemonsetEvictionForEmptyNodes value to set. + * @return the ManagedClusterPropertiesAutoScalerProfile object itself. + */ + public ManagedClusterPropertiesAutoScalerProfile + withDaemonsetEvictionForEmptyNodes(Boolean daemonsetEvictionForEmptyNodes) { + this.daemonsetEvictionForEmptyNodes = daemonsetEvictionForEmptyNodes; + return this; + } + + /** + * Get the daemonsetEvictionForOccupiedNodes property: DaemonSet pods will be gracefully terminated from non-empty + * nodes. If set to true, all daemonset pods on occupied nodes will be evicted before deletion of the node. If the + * daemonset pod cannot be evicted another node will be chosen for scaling. If set to false, the node will be + * deleted without ensuring that daemonset pods are deleted or evicted. + * + * @return the daemonsetEvictionForOccupiedNodes value. + */ + public Boolean daemonsetEvictionForOccupiedNodes() { + return this.daemonsetEvictionForOccupiedNodes; + } + + /** + * Set the daemonsetEvictionForOccupiedNodes property: DaemonSet pods will be gracefully terminated from non-empty + * nodes. If set to true, all daemonset pods on occupied nodes will be evicted before deletion of the node. If the + * daemonset pod cannot be evicted another node will be chosen for scaling. If set to false, the node will be + * deleted without ensuring that daemonset pods are deleted or evicted. + * + * @param daemonsetEvictionForOccupiedNodes the daemonsetEvictionForOccupiedNodes value to set. + * @return the ManagedClusterPropertiesAutoScalerProfile object itself. + */ + public ManagedClusterPropertiesAutoScalerProfile + withDaemonsetEvictionForOccupiedNodes(Boolean daemonsetEvictionForOccupiedNodes) { + this.daemonsetEvictionForOccupiedNodes = daemonsetEvictionForOccupiedNodes; + return this; + } + + /** + * Get the ignoreDaemonsetsUtilization property: Should CA ignore DaemonSet pods when calculating resource + * utilization for scaling down. If set to true, the resources used by daemonset will be taken into account when + * making scaling down decisions. + * + * @return the ignoreDaemonsetsUtilization value. + */ + public Boolean ignoreDaemonsetsUtilization() { + return this.ignoreDaemonsetsUtilization; + } + + /** + * Set the ignoreDaemonsetsUtilization property: Should CA ignore DaemonSet pods when calculating resource + * utilization for scaling down. If set to true, the resources used by daemonset will be taken into account when + * making scaling down decisions. + * + * @param ignoreDaemonsetsUtilization the ignoreDaemonsetsUtilization value to set. + * @return the ManagedClusterPropertiesAutoScalerProfile object itself. + */ + public ManagedClusterPropertiesAutoScalerProfile + withIgnoreDaemonsetsUtilization(Boolean ignoreDaemonsetsUtilization) { + this.ignoreDaemonsetsUtilization = ignoreDaemonsetsUtilization; + return this; + } + + /** + * Get the expander property: The expander to use when scaling up. 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. + * + * @return the expander value. + */ + public Expander expander() { + return this.expander; + } + + /** + * Set the expander property: The expander to use when scaling up. 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. + * + * @param expander the expander value to set. + * @return the ManagedClusterPropertiesAutoScalerProfile object itself. + */ + public ManagedClusterPropertiesAutoScalerProfile withExpander(Expander expander) { + this.expander = expander; + return this; + } + + /** + * Get the maxEmptyBulkDelete property: The maximum number of empty nodes that can be deleted at the same time. This + * must be a positive integer. The default is 10. + * + * @return the maxEmptyBulkDelete value. + */ + public String maxEmptyBulkDelete() { + return this.maxEmptyBulkDelete; + } + + /** + * Set the maxEmptyBulkDelete property: The maximum number of empty nodes that can be deleted at the same time. This + * must be a positive integer. The default is 10. + * + * @param maxEmptyBulkDelete the maxEmptyBulkDelete value to set. + * @return the ManagedClusterPropertiesAutoScalerProfile object itself. + */ + public ManagedClusterPropertiesAutoScalerProfile withMaxEmptyBulkDelete(String maxEmptyBulkDelete) { + this.maxEmptyBulkDelete = maxEmptyBulkDelete; + return this; + } + + /** + * Get the maxGracefulTerminationSec property: The maximum number of seconds the cluster autoscaler waits for pod + * termination when trying to scale down a node. The default is 600. + * + * @return the maxGracefulTerminationSec value. + */ + public String maxGracefulTerminationSec() { + return this.maxGracefulTerminationSec; + } + + /** + * Set the maxGracefulTerminationSec property: The maximum number of seconds the cluster autoscaler waits for pod + * termination when trying to scale down a node. The default is 600. + * + * @param maxGracefulTerminationSec the maxGracefulTerminationSec value to set. + * @return the ManagedClusterPropertiesAutoScalerProfile object itself. + */ + public ManagedClusterPropertiesAutoScalerProfile withMaxGracefulTerminationSec(String maxGracefulTerminationSec) { + this.maxGracefulTerminationSec = maxGracefulTerminationSec; + return this; + } + + /** + * Get the maxNodeProvisionTime property: The maximum time the autoscaler waits for a node to be provisioned. The + * default is '15m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is + * supported. + * + * @return the maxNodeProvisionTime value. + */ + public String maxNodeProvisionTime() { + return this.maxNodeProvisionTime; + } + + /** + * Set the maxNodeProvisionTime property: The maximum time the autoscaler waits for a node to be provisioned. The + * default is '15m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is + * supported. + * + * @param maxNodeProvisionTime the maxNodeProvisionTime value to set. + * @return the ManagedClusterPropertiesAutoScalerProfile object itself. + */ + public ManagedClusterPropertiesAutoScalerProfile withMaxNodeProvisionTime(String maxNodeProvisionTime) { + this.maxNodeProvisionTime = maxNodeProvisionTime; + return this; + } + + /** + * Get the maxTotalUnreadyPercentage property: The maximum percentage of unready nodes in the cluster. After this + * percentage is exceeded, cluster autoscaler halts operations. The default is 45. The maximum is 100 and the + * minimum is 0. + * + * @return the maxTotalUnreadyPercentage value. + */ + public String maxTotalUnreadyPercentage() { + return this.maxTotalUnreadyPercentage; + } + + /** + * Set the maxTotalUnreadyPercentage property: The maximum percentage of unready nodes in the cluster. After this + * percentage is exceeded, cluster autoscaler halts operations. The default is 45. The maximum is 100 and the + * minimum is 0. + * + * @param maxTotalUnreadyPercentage the maxTotalUnreadyPercentage value to set. + * @return the ManagedClusterPropertiesAutoScalerProfile object itself. + */ + public ManagedClusterPropertiesAutoScalerProfile withMaxTotalUnreadyPercentage(String maxTotalUnreadyPercentage) { + this.maxTotalUnreadyPercentage = maxTotalUnreadyPercentage; + return this; + } + + /** + * Get the newPodScaleUpDelay property: Ignore unscheduled pods before they're a certain age. 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). + * + * @return the newPodScaleUpDelay value. + */ + public String newPodScaleUpDelay() { + return this.newPodScaleUpDelay; + } + + /** + * Set the newPodScaleUpDelay property: Ignore unscheduled pods before they're a certain age. 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). + * + * @param newPodScaleUpDelay the newPodScaleUpDelay value to set. + * @return the ManagedClusterPropertiesAutoScalerProfile object itself. + */ + public ManagedClusterPropertiesAutoScalerProfile withNewPodScaleUpDelay(String newPodScaleUpDelay) { + this.newPodScaleUpDelay = newPodScaleUpDelay; + return this; + } + + /** + * Get the okTotalUnreadyCount property: The number of allowed unready nodes, irrespective of + * max-total-unready-percentage. This must be an integer. The default is 3. + * + * @return the okTotalUnreadyCount value. + */ + public String okTotalUnreadyCount() { + return this.okTotalUnreadyCount; + } + + /** + * Set the okTotalUnreadyCount property: The number of allowed unready nodes, irrespective of + * max-total-unready-percentage. This must be an integer. The default is 3. + * + * @param okTotalUnreadyCount the okTotalUnreadyCount value to set. + * @return the ManagedClusterPropertiesAutoScalerProfile object itself. + */ + public ManagedClusterPropertiesAutoScalerProfile withOkTotalUnreadyCount(String okTotalUnreadyCount) { + this.okTotalUnreadyCount = okTotalUnreadyCount; + return this; + } + + /** + * Get the scanInterval property: How often cluster is reevaluated for scale up or down. The default is '10'. Values + * must be an integer number of seconds. + * + * @return the scanInterval value. + */ + public String scanInterval() { + return this.scanInterval; + } + + /** + * Set the scanInterval property: How often cluster is reevaluated for scale up or down. The default is '10'. Values + * must be an integer number of seconds. + * + * @param scanInterval the scanInterval value to set. + * @return the ManagedClusterPropertiesAutoScalerProfile object itself. + */ + public ManagedClusterPropertiesAutoScalerProfile withScanInterval(String scanInterval) { + this.scanInterval = scanInterval; + return this; + } + + /** + * Get the scaleDownDelayAfterAdd property: How long after scale up that scale down evaluation resumes. The default + * is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + * + * @return the scaleDownDelayAfterAdd value. + */ + public String scaleDownDelayAfterAdd() { + return this.scaleDownDelayAfterAdd; + } + + /** + * Set the scaleDownDelayAfterAdd property: How long after scale up that scale down evaluation resumes. The default + * is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + * + * @param scaleDownDelayAfterAdd the scaleDownDelayAfterAdd value to set. + * @return the ManagedClusterPropertiesAutoScalerProfile object itself. + */ + public ManagedClusterPropertiesAutoScalerProfile withScaleDownDelayAfterAdd(String scaleDownDelayAfterAdd) { + this.scaleDownDelayAfterAdd = scaleDownDelayAfterAdd; + return this; + } + + /** + * Get the scaleDownDelayAfterDelete property: How long after node deletion that scale down evaluation resumes. 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. + * + * @return the scaleDownDelayAfterDelete value. + */ + public String scaleDownDelayAfterDelete() { + return this.scaleDownDelayAfterDelete; + } + + /** + * Set the scaleDownDelayAfterDelete property: How long after node deletion that scale down evaluation resumes. 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. + * + * @param scaleDownDelayAfterDelete the scaleDownDelayAfterDelete value to set. + * @return the ManagedClusterPropertiesAutoScalerProfile object itself. + */ + public ManagedClusterPropertiesAutoScalerProfile withScaleDownDelayAfterDelete(String scaleDownDelayAfterDelete) { + this.scaleDownDelayAfterDelete = scaleDownDelayAfterDelete; + return this; + } + + /** + * Get the scaleDownDelayAfterFailure property: How long after scale down failure that scale down evaluation + * resumes. The default is '3m'. Values must be an integer followed by an 'm'. No unit of time other than minutes + * (m) is supported. + * + * @return the scaleDownDelayAfterFailure value. + */ + public String scaleDownDelayAfterFailure() { + return this.scaleDownDelayAfterFailure; + } + + /** + * Set the scaleDownDelayAfterFailure property: How long after scale down failure that scale down evaluation + * resumes. The default is '3m'. Values must be an integer followed by an 'm'. No unit of time other than minutes + * (m) is supported. + * + * @param scaleDownDelayAfterFailure the scaleDownDelayAfterFailure value to set. + * @return the ManagedClusterPropertiesAutoScalerProfile object itself. + */ + public ManagedClusterPropertiesAutoScalerProfile withScaleDownDelayAfterFailure(String scaleDownDelayAfterFailure) { + this.scaleDownDelayAfterFailure = scaleDownDelayAfterFailure; + return this; + } + + /** + * Get the scaleDownUnneededTime property: How long a node should be unneeded before it is eligible for scale down. + * The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is + * supported. + * + * @return the scaleDownUnneededTime value. + */ + public String scaleDownUnneededTime() { + return this.scaleDownUnneededTime; + } + + /** + * Set the scaleDownUnneededTime property: How long a node should be unneeded before it is eligible for scale down. + * The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is + * supported. + * + * @param scaleDownUnneededTime the scaleDownUnneededTime value to set. + * @return the ManagedClusterPropertiesAutoScalerProfile object itself. + */ + public ManagedClusterPropertiesAutoScalerProfile withScaleDownUnneededTime(String scaleDownUnneededTime) { + this.scaleDownUnneededTime = scaleDownUnneededTime; + return this; + } + + /** + * Get the scaleDownUnreadyTime property: How long an unready node should be unneeded before it is eligible for + * scale down. The default is '20m'. Values must be an integer followed by an 'm'. No unit of time other than + * minutes (m) is supported. + * + * @return the scaleDownUnreadyTime value. + */ + public String scaleDownUnreadyTime() { + return this.scaleDownUnreadyTime; + } + + /** + * Set the scaleDownUnreadyTime property: How long an unready node should be unneeded before it is eligible for + * scale down. The default is '20m'. Values must be an integer followed by an 'm'. No unit of time other than + * minutes (m) is supported. + * + * @param scaleDownUnreadyTime the scaleDownUnreadyTime value to set. + * @return the ManagedClusterPropertiesAutoScalerProfile object itself. + */ + public ManagedClusterPropertiesAutoScalerProfile withScaleDownUnreadyTime(String scaleDownUnreadyTime) { + this.scaleDownUnreadyTime = scaleDownUnreadyTime; + return this; + } + + /** + * Get the scaleDownUtilizationThreshold property: Node utilization level, defined as sum of requested resources + * divided by capacity, below which a node can be considered for scale down. The default is '0.5'. + * + * @return the scaleDownUtilizationThreshold value. + */ + public String scaleDownUtilizationThreshold() { + return this.scaleDownUtilizationThreshold; + } + + /** + * Set the scaleDownUtilizationThreshold property: Node utilization level, defined as sum of requested resources + * divided by capacity, below which a node can be considered for scale down. The default is '0.5'. + * + * @param scaleDownUtilizationThreshold the scaleDownUtilizationThreshold value to set. + * @return the ManagedClusterPropertiesAutoScalerProfile object itself. + */ + public ManagedClusterPropertiesAutoScalerProfile + withScaleDownUtilizationThreshold(String scaleDownUtilizationThreshold) { + this.scaleDownUtilizationThreshold = scaleDownUtilizationThreshold; + return this; + } + + /** + * Get the skipNodesWithLocalStorage property: If cluster autoscaler will skip deleting nodes with pods with local + * storage, for example, EmptyDir or HostPath. The default is true. + * + * @return the skipNodesWithLocalStorage value. + */ + public String skipNodesWithLocalStorage() { + return this.skipNodesWithLocalStorage; + } + + /** + * Set the skipNodesWithLocalStorage property: If cluster autoscaler will skip deleting nodes with pods with local + * storage, for example, EmptyDir or HostPath. The default is true. + * + * @param skipNodesWithLocalStorage the skipNodesWithLocalStorage value to set. + * @return the ManagedClusterPropertiesAutoScalerProfile object itself. + */ + public ManagedClusterPropertiesAutoScalerProfile withSkipNodesWithLocalStorage(String skipNodesWithLocalStorage) { + this.skipNodesWithLocalStorage = skipNodesWithLocalStorage; + return this; + } + + /** + * Get the skipNodesWithSystemPods property: If cluster autoscaler will skip deleting nodes with pods from + * kube-system (except for DaemonSet or mirror pods). The default is true. + * + * @return the skipNodesWithSystemPods value. + */ + public String skipNodesWithSystemPods() { + return this.skipNodesWithSystemPods; + } + + /** + * Set the skipNodesWithSystemPods property: If cluster autoscaler will skip deleting nodes with pods from + * kube-system (except for DaemonSet or mirror pods). The default is true. + * + * @param skipNodesWithSystemPods the skipNodesWithSystemPods value to set. + * @return the ManagedClusterPropertiesAutoScalerProfile object itself. + */ + public ManagedClusterPropertiesAutoScalerProfile withSkipNodesWithSystemPods(String skipNodesWithSystemPods) { + this.skipNodesWithSystemPods = skipNodesWithSystemPods; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("balance-similar-node-groups", this.balanceSimilarNodeGroups); + jsonWriter.writeBooleanField("daemonset-eviction-for-empty-nodes", this.daemonsetEvictionForEmptyNodes); + jsonWriter.writeBooleanField("daemonset-eviction-for-occupied-nodes", this.daemonsetEvictionForOccupiedNodes); + jsonWriter.writeBooleanField("ignore-daemonsets-utilization", this.ignoreDaemonsetsUtilization); + jsonWriter.writeStringField("expander", this.expander == null ? null : this.expander.toString()); + jsonWriter.writeStringField("max-empty-bulk-delete", this.maxEmptyBulkDelete); + jsonWriter.writeStringField("max-graceful-termination-sec", this.maxGracefulTerminationSec); + jsonWriter.writeStringField("max-node-provision-time", this.maxNodeProvisionTime); + jsonWriter.writeStringField("max-total-unready-percentage", this.maxTotalUnreadyPercentage); + jsonWriter.writeStringField("new-pod-scale-up-delay", this.newPodScaleUpDelay); + jsonWriter.writeStringField("ok-total-unready-count", this.okTotalUnreadyCount); + jsonWriter.writeStringField("scan-interval", this.scanInterval); + jsonWriter.writeStringField("scale-down-delay-after-add", this.scaleDownDelayAfterAdd); + jsonWriter.writeStringField("scale-down-delay-after-delete", this.scaleDownDelayAfterDelete); + jsonWriter.writeStringField("scale-down-delay-after-failure", this.scaleDownDelayAfterFailure); + jsonWriter.writeStringField("scale-down-unneeded-time", this.scaleDownUnneededTime); + jsonWriter.writeStringField("scale-down-unready-time", this.scaleDownUnreadyTime); + jsonWriter.writeStringField("scale-down-utilization-threshold", this.scaleDownUtilizationThreshold); + jsonWriter.writeStringField("skip-nodes-with-local-storage", this.skipNodesWithLocalStorage); + jsonWriter.writeStringField("skip-nodes-with-system-pods", this.skipNodesWithSystemPods); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterPropertiesAutoScalerProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterPropertiesAutoScalerProfile if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedClusterPropertiesAutoScalerProfile. + */ + public static ManagedClusterPropertiesAutoScalerProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterPropertiesAutoScalerProfile deserializedManagedClusterPropertiesAutoScalerProfile + = new ManagedClusterPropertiesAutoScalerProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("balance-similar-node-groups".equals(fieldName)) { + deserializedManagedClusterPropertiesAutoScalerProfile.balanceSimilarNodeGroups = reader.getString(); + } else if ("daemonset-eviction-for-empty-nodes".equals(fieldName)) { + deserializedManagedClusterPropertiesAutoScalerProfile.daemonsetEvictionForEmptyNodes + = reader.getNullable(JsonReader::getBoolean); + } else if ("daemonset-eviction-for-occupied-nodes".equals(fieldName)) { + deserializedManagedClusterPropertiesAutoScalerProfile.daemonsetEvictionForOccupiedNodes + = reader.getNullable(JsonReader::getBoolean); + } else if ("ignore-daemonsets-utilization".equals(fieldName)) { + deserializedManagedClusterPropertiesAutoScalerProfile.ignoreDaemonsetsUtilization + = reader.getNullable(JsonReader::getBoolean); + } else if ("expander".equals(fieldName)) { + deserializedManagedClusterPropertiesAutoScalerProfile.expander + = Expander.fromString(reader.getString()); + } else if ("max-empty-bulk-delete".equals(fieldName)) { + deserializedManagedClusterPropertiesAutoScalerProfile.maxEmptyBulkDelete = reader.getString(); + } else if ("max-graceful-termination-sec".equals(fieldName)) { + deserializedManagedClusterPropertiesAutoScalerProfile.maxGracefulTerminationSec + = reader.getString(); + } else if ("max-node-provision-time".equals(fieldName)) { + deserializedManagedClusterPropertiesAutoScalerProfile.maxNodeProvisionTime = reader.getString(); + } else if ("max-total-unready-percentage".equals(fieldName)) { + deserializedManagedClusterPropertiesAutoScalerProfile.maxTotalUnreadyPercentage + = reader.getString(); + } else if ("new-pod-scale-up-delay".equals(fieldName)) { + deserializedManagedClusterPropertiesAutoScalerProfile.newPodScaleUpDelay = reader.getString(); + } else if ("ok-total-unready-count".equals(fieldName)) { + deserializedManagedClusterPropertiesAutoScalerProfile.okTotalUnreadyCount = reader.getString(); + } else if ("scan-interval".equals(fieldName)) { + deserializedManagedClusterPropertiesAutoScalerProfile.scanInterval = reader.getString(); + } else if ("scale-down-delay-after-add".equals(fieldName)) { + deserializedManagedClusterPropertiesAutoScalerProfile.scaleDownDelayAfterAdd = reader.getString(); + } else if ("scale-down-delay-after-delete".equals(fieldName)) { + deserializedManagedClusterPropertiesAutoScalerProfile.scaleDownDelayAfterDelete + = reader.getString(); + } else if ("scale-down-delay-after-failure".equals(fieldName)) { + deserializedManagedClusterPropertiesAutoScalerProfile.scaleDownDelayAfterFailure + = reader.getString(); + } else if ("scale-down-unneeded-time".equals(fieldName)) { + deserializedManagedClusterPropertiesAutoScalerProfile.scaleDownUnneededTime = reader.getString(); + } else if ("scale-down-unready-time".equals(fieldName)) { + deserializedManagedClusterPropertiesAutoScalerProfile.scaleDownUnreadyTime = reader.getString(); + } else if ("scale-down-utilization-threshold".equals(fieldName)) { + deserializedManagedClusterPropertiesAutoScalerProfile.scaleDownUtilizationThreshold + = reader.getString(); + } else if ("skip-nodes-with-local-storage".equals(fieldName)) { + deserializedManagedClusterPropertiesAutoScalerProfile.skipNodesWithLocalStorage + = reader.getString(); + } else if ("skip-nodes-with-system-pods".equals(fieldName)) { + deserializedManagedClusterPropertiesAutoScalerProfile.skipNodesWithSystemPods = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterPropertiesAutoScalerProfile; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSKU.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSKU.java new file mode 100644 index 000000000000..1338acb9fd8d --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSKU.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The SKU of a Managed Cluster. + */ +@Fluent +public final class ManagedClusterSKU implements JsonSerializable { + /* + * The name of a managed cluster SKU. + */ + private ManagedClusterSKUName name; + + /* + * The tier 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. + */ + private ManagedClusterSKUTier tier; + + /** + * Creates an instance of ManagedClusterSKU class. + */ + public ManagedClusterSKU() { + } + + /** + * Get the name property: The name of a managed cluster SKU. + * + * @return the name value. + */ + public ManagedClusterSKUName name() { + return this.name; + } + + /** + * Set the name property: The name of a managed cluster SKU. + * + * @param name the name value to set. + * @return the ManagedClusterSKU object itself. + */ + public ManagedClusterSKU withName(ManagedClusterSKUName name) { + this.name = name; + return this; + } + + /** + * Get the tier property: The tier 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. + * + * @return the tier value. + */ + public ManagedClusterSKUTier tier() { + return this.tier; + } + + /** + * Set the tier property: The tier 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. + * + * @param tier the tier value to set. + * @return the ManagedClusterSKU object itself. + */ + public ManagedClusterSKU withTier(ManagedClusterSKUTier tier) { + this.tier = tier; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + jsonWriter.writeStringField("tier", this.tier == null ? null : this.tier.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterSKU from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterSKU if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedClusterSKU. + */ + public static ManagedClusterSKU fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterSKU deserializedManagedClusterSKU = new ManagedClusterSKU(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedManagedClusterSKU.name = ManagedClusterSKUName.fromString(reader.getString()); + } else if ("tier".equals(fieldName)) { + deserializedManagedClusterSKU.tier = ManagedClusterSKUTier.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterSKU; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSKUName.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSKUName.java new file mode 100644 index 000000000000..450287723862 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSKUName.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The name of a managed cluster SKU. + */ +public final class ManagedClusterSKUName extends ExpandableStringEnum { + /** + * Base option for the AKS control plane. + */ + public static final ManagedClusterSKUName BASE = fromString("Base"); + + /** + * Automatic clusters are optimized to run most production workloads with configuration that follows AKS best + * practices and recommendations for cluster and workload setup, scalability, and security. For more details about + * Automatic clusters see aka.ms/aks/automatic. + */ + public static final ManagedClusterSKUName AUTOMATIC = fromString("Automatic"); + + /** + * Creates a new instance of ManagedClusterSKUName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagedClusterSKUName() { + } + + /** + * Creates or finds a ManagedClusterSKUName from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedClusterSKUName. + */ + public static ManagedClusterSKUName fromString(String name) { + return fromString(name, ManagedClusterSKUName.class); + } + + /** + * Gets known ManagedClusterSKUName values. + * + * @return known ManagedClusterSKUName values. + */ + public static Collection values() { + return values(ManagedClusterSKUName.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSKUTier.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSKUTier.java new file mode 100644 index 000000000000..cb9d4c443d09 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSKUTier.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The tier 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. + */ +public final class ManagedClusterSKUTier extends ExpandableStringEnum { + /** + * 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 final ManagedClusterSKUTier PREMIUM = fromString("Premium"); + + /** + * 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 final ManagedClusterSKUTier STANDARD = fromString("Standard"); + + /** + * 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 final ManagedClusterSKUTier FREE = fromString("Free"); + + /** + * Creates a new instance of ManagedClusterSKUTier value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagedClusterSKUTier() { + } + + /** + * Creates or finds a ManagedClusterSKUTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedClusterSKUTier. + */ + public static ManagedClusterSKUTier fromString(String name) { + return fromString(name, ManagedClusterSKUTier.class); + } + + /** + * Gets known ManagedClusterSKUTier values. + * + * @return known ManagedClusterSKUTier values. + */ + public static Collection values() { + return values(ManagedClusterSKUTier.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSecurityProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSecurityProfile.java new file mode 100644 index 000000000000..8d57ff10d773 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSecurityProfile.java @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Security profile for the container service cluster. + */ +@Fluent +public final class ManagedClusterSecurityProfile implements JsonSerializable { + /* + * Microsoft Defender settings for the security profile. + */ + private ManagedClusterSecurityProfileDefender defender; + + /* + * Azure Key Vault [key management service](https://kubernetes.io/docs/tasks/administer-cluster/kms-provider/) + * settings for the security profile. + */ + private AzureKeyVaultKms azureKeyVaultKms; + + /* + * 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. + */ + private ManagedClusterSecurityProfileWorkloadIdentity workloadIdentity; + + /* + * Image Cleaner settings for the security profile. + */ + private ManagedClusterSecurityProfileImageCleaner imageCleaner; + + /* + * A list of up to 10 base64 encoded CAs that will be added to the trust store on all nodes in the cluster. For more + * information see [Custom CA Trust + * Certificates](https://learn.microsoft.com/en-us/azure/aks/custom-certificate-authority). + */ + private List customCATrustCertificates; + + /** + * Creates an instance of ManagedClusterSecurityProfile class. + */ + public ManagedClusterSecurityProfile() { + } + + /** + * Get the defender property: Microsoft Defender settings for the security profile. + * + * @return the defender value. + */ + public ManagedClusterSecurityProfileDefender defender() { + return this.defender; + } + + /** + * Set the defender property: Microsoft Defender settings for the security profile. + * + * @param defender the defender value to set. + * @return the ManagedClusterSecurityProfile object itself. + */ + public ManagedClusterSecurityProfile withDefender(ManagedClusterSecurityProfileDefender defender) { + this.defender = defender; + return this; + } + + /** + * Get the azureKeyVaultKms property: Azure Key Vault [key management + * service](https://kubernetes.io/docs/tasks/administer-cluster/kms-provider/) settings for the security profile. + * + * @return the azureKeyVaultKms value. + */ + public AzureKeyVaultKms azureKeyVaultKms() { + return this.azureKeyVaultKms; + } + + /** + * Set the azureKeyVaultKms property: Azure Key Vault [key management + * service](https://kubernetes.io/docs/tasks/administer-cluster/kms-provider/) settings for the security profile. + * + * @param azureKeyVaultKms the azureKeyVaultKms value to set. + * @return the ManagedClusterSecurityProfile object itself. + */ + public ManagedClusterSecurityProfile withAzureKeyVaultKms(AzureKeyVaultKms azureKeyVaultKms) { + this.azureKeyVaultKms = azureKeyVaultKms; + return this; + } + + /** + * Get the workloadIdentity property: 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. + * + * @return the workloadIdentity value. + */ + public ManagedClusterSecurityProfileWorkloadIdentity workloadIdentity() { + return this.workloadIdentity; + } + + /** + * Set the workloadIdentity property: 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. + * + * @param workloadIdentity the workloadIdentity value to set. + * @return the ManagedClusterSecurityProfile object itself. + */ + public ManagedClusterSecurityProfile + withWorkloadIdentity(ManagedClusterSecurityProfileWorkloadIdentity workloadIdentity) { + this.workloadIdentity = workloadIdentity; + return this; + } + + /** + * Get the imageCleaner property: Image Cleaner settings for the security profile. + * + * @return the imageCleaner value. + */ + public ManagedClusterSecurityProfileImageCleaner imageCleaner() { + return this.imageCleaner; + } + + /** + * Set the imageCleaner property: Image Cleaner settings for the security profile. + * + * @param imageCleaner the imageCleaner value to set. + * @return the ManagedClusterSecurityProfile object itself. + */ + public ManagedClusterSecurityProfile withImageCleaner(ManagedClusterSecurityProfileImageCleaner imageCleaner) { + this.imageCleaner = imageCleaner; + return this; + } + + /** + * Get the customCATrustCertificates property: A list of up to 10 base64 encoded CAs that will be added to the trust + * store on all nodes in the cluster. For more information see [Custom CA Trust + * Certificates](https://learn.microsoft.com/en-us/azure/aks/custom-certificate-authority). + * + * @return the customCATrustCertificates value. + */ + public List customCATrustCertificates() { + return this.customCATrustCertificates; + } + + /** + * Set the customCATrustCertificates property: A list of up to 10 base64 encoded CAs that will be added to the trust + * store on all nodes in the cluster. For more information see [Custom CA Trust + * Certificates](https://learn.microsoft.com/en-us/azure/aks/custom-certificate-authority). + * + * @param customCATrustCertificates the customCATrustCertificates value to set. + * @return the ManagedClusterSecurityProfile object itself. + */ + public ManagedClusterSecurityProfile withCustomCATrustCertificates(List customCATrustCertificates) { + this.customCATrustCertificates = customCATrustCertificates; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("defender", this.defender); + jsonWriter.writeJsonField("azureKeyVaultKms", this.azureKeyVaultKms); + jsonWriter.writeJsonField("workloadIdentity", this.workloadIdentity); + jsonWriter.writeJsonField("imageCleaner", this.imageCleaner); + jsonWriter.writeArrayField("customCATrustCertificates", this.customCATrustCertificates, + (writer, element) -> writer.writeBinary(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterSecurityProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterSecurityProfile if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedClusterSecurityProfile. + */ + public static ManagedClusterSecurityProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterSecurityProfile deserializedManagedClusterSecurityProfile + = new ManagedClusterSecurityProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("defender".equals(fieldName)) { + deserializedManagedClusterSecurityProfile.defender + = ManagedClusterSecurityProfileDefender.fromJson(reader); + } else if ("azureKeyVaultKms".equals(fieldName)) { + deserializedManagedClusterSecurityProfile.azureKeyVaultKms = AzureKeyVaultKms.fromJson(reader); + } else if ("workloadIdentity".equals(fieldName)) { + deserializedManagedClusterSecurityProfile.workloadIdentity + = ManagedClusterSecurityProfileWorkloadIdentity.fromJson(reader); + } else if ("imageCleaner".equals(fieldName)) { + deserializedManagedClusterSecurityProfile.imageCleaner + = ManagedClusterSecurityProfileImageCleaner.fromJson(reader); + } else if ("customCATrustCertificates".equals(fieldName)) { + List customCATrustCertificates = reader.readArray(reader1 -> reader1.getBinary()); + deserializedManagedClusterSecurityProfile.customCATrustCertificates = customCATrustCertificates; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterSecurityProfile; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSecurityProfileDefender.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSecurityProfileDefender.java new file mode 100644 index 000000000000..0ca3eed4c7db --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSecurityProfileDefender.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Microsoft Defender settings for the security profile. + */ +@Fluent +public final class ManagedClusterSecurityProfileDefender + implements JsonSerializable { + /* + * 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. + */ + private String logAnalyticsWorkspaceResourceId; + + /* + * Microsoft Defender threat detection for Cloud settings for the security profile. + */ + private ManagedClusterSecurityProfileDefenderSecurityMonitoring securityMonitoring; + + /** + * Creates an instance of ManagedClusterSecurityProfileDefender class. + */ + public ManagedClusterSecurityProfileDefender() { + } + + /** + * Get the logAnalyticsWorkspaceResourceId property: 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. + * + * @return the logAnalyticsWorkspaceResourceId value. + */ + public String logAnalyticsWorkspaceResourceId() { + return this.logAnalyticsWorkspaceResourceId; + } + + /** + * Set the logAnalyticsWorkspaceResourceId property: 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. + * + * @param logAnalyticsWorkspaceResourceId the logAnalyticsWorkspaceResourceId value to set. + * @return the ManagedClusterSecurityProfileDefender object itself. + */ + public ManagedClusterSecurityProfileDefender + withLogAnalyticsWorkspaceResourceId(String logAnalyticsWorkspaceResourceId) { + this.logAnalyticsWorkspaceResourceId = logAnalyticsWorkspaceResourceId; + return this; + } + + /** + * Get the securityMonitoring property: Microsoft Defender threat detection for Cloud settings for the security + * profile. + * + * @return the securityMonitoring value. + */ + public ManagedClusterSecurityProfileDefenderSecurityMonitoring securityMonitoring() { + return this.securityMonitoring; + } + + /** + * Set the securityMonitoring property: Microsoft Defender threat detection for Cloud settings for the security + * profile. + * + * @param securityMonitoring the securityMonitoring value to set. + * @return the ManagedClusterSecurityProfileDefender object itself. + */ + public ManagedClusterSecurityProfileDefender + withSecurityMonitoring(ManagedClusterSecurityProfileDefenderSecurityMonitoring securityMonitoring) { + this.securityMonitoring = securityMonitoring; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("logAnalyticsWorkspaceResourceId", this.logAnalyticsWorkspaceResourceId); + jsonWriter.writeJsonField("securityMonitoring", this.securityMonitoring); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterSecurityProfileDefender from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterSecurityProfileDefender if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedClusterSecurityProfileDefender. + */ + public static ManagedClusterSecurityProfileDefender fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterSecurityProfileDefender deserializedManagedClusterSecurityProfileDefender + = new ManagedClusterSecurityProfileDefender(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("logAnalyticsWorkspaceResourceId".equals(fieldName)) { + deserializedManagedClusterSecurityProfileDefender.logAnalyticsWorkspaceResourceId + = reader.getString(); + } else if ("securityMonitoring".equals(fieldName)) { + deserializedManagedClusterSecurityProfileDefender.securityMonitoring + = ManagedClusterSecurityProfileDefenderSecurityMonitoring.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterSecurityProfileDefender; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSecurityProfileDefenderSecurityMonitoring.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSecurityProfileDefenderSecurityMonitoring.java new file mode 100644 index 000000000000..5f6d1912974e --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSecurityProfileDefenderSecurityMonitoring.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Microsoft Defender settings for the security profile threat detection. + */ +@Fluent +public final class ManagedClusterSecurityProfileDefenderSecurityMonitoring + implements JsonSerializable { + /* + * Whether to enable Defender threat detection + */ + private Boolean enabled; + + /** + * Creates an instance of ManagedClusterSecurityProfileDefenderSecurityMonitoring class. + */ + public ManagedClusterSecurityProfileDefenderSecurityMonitoring() { + } + + /** + * Get the enabled property: Whether to enable Defender threat detection. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Whether to enable Defender threat detection. + * + * @param enabled the enabled value to set. + * @return the ManagedClusterSecurityProfileDefenderSecurityMonitoring object itself. + */ + public ManagedClusterSecurityProfileDefenderSecurityMonitoring withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterSecurityProfileDefenderSecurityMonitoring from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterSecurityProfileDefenderSecurityMonitoring if the JsonReader was pointing to + * an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedClusterSecurityProfileDefenderSecurityMonitoring. + */ + public static ManagedClusterSecurityProfileDefenderSecurityMonitoring fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterSecurityProfileDefenderSecurityMonitoring deserializedManagedClusterSecurityProfileDefenderSecurityMonitoring + = new ManagedClusterSecurityProfileDefenderSecurityMonitoring(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedManagedClusterSecurityProfileDefenderSecurityMonitoring.enabled + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterSecurityProfileDefenderSecurityMonitoring; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSecurityProfileImageCleaner.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSecurityProfileImageCleaner.java new file mode 100644 index 000000000000..e68d50063207 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSecurityProfileImageCleaner.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * 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. + */ +@Fluent +public final class ManagedClusterSecurityProfileImageCleaner + implements JsonSerializable { + /* + * Whether to enable Image Cleaner on AKS cluster. + */ + private Boolean enabled; + + /* + * Image Cleaner scanning interval in hours. + */ + private Integer intervalHours; + + /** + * Creates an instance of ManagedClusterSecurityProfileImageCleaner class. + */ + public ManagedClusterSecurityProfileImageCleaner() { + } + + /** + * Get the enabled property: Whether to enable Image Cleaner on AKS cluster. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Whether to enable Image Cleaner on AKS cluster. + * + * @param enabled the enabled value to set. + * @return the ManagedClusterSecurityProfileImageCleaner object itself. + */ + public ManagedClusterSecurityProfileImageCleaner withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the intervalHours property: Image Cleaner scanning interval in hours. + * + * @return the intervalHours value. + */ + public Integer intervalHours() { + return this.intervalHours; + } + + /** + * Set the intervalHours property: Image Cleaner scanning interval in hours. + * + * @param intervalHours the intervalHours value to set. + * @return the ManagedClusterSecurityProfileImageCleaner object itself. + */ + public ManagedClusterSecurityProfileImageCleaner withIntervalHours(Integer intervalHours) { + this.intervalHours = intervalHours; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeNumberField("intervalHours", this.intervalHours); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterSecurityProfileImageCleaner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterSecurityProfileImageCleaner if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedClusterSecurityProfileImageCleaner. + */ + public static ManagedClusterSecurityProfileImageCleaner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterSecurityProfileImageCleaner deserializedManagedClusterSecurityProfileImageCleaner + = new ManagedClusterSecurityProfileImageCleaner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedManagedClusterSecurityProfileImageCleaner.enabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("intervalHours".equals(fieldName)) { + deserializedManagedClusterSecurityProfileImageCleaner.intervalHours + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterSecurityProfileImageCleaner; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSecurityProfileWorkloadIdentity.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSecurityProfileWorkloadIdentity.java new file mode 100644 index 000000000000..917f0e6f9605 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSecurityProfileWorkloadIdentity.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Workload identity settings for the security profile. + */ +@Fluent +public final class ManagedClusterSecurityProfileWorkloadIdentity + implements JsonSerializable { + /* + * Whether to enable workload identity. + */ + private Boolean enabled; + + /** + * Creates an instance of ManagedClusterSecurityProfileWorkloadIdentity class. + */ + public ManagedClusterSecurityProfileWorkloadIdentity() { + } + + /** + * Get the enabled property: Whether to enable workload identity. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Whether to enable workload identity. + * + * @param enabled the enabled value to set. + * @return the ManagedClusterSecurityProfileWorkloadIdentity object itself. + */ + public ManagedClusterSecurityProfileWorkloadIdentity withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterSecurityProfileWorkloadIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterSecurityProfileWorkloadIdentity if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedClusterSecurityProfileWorkloadIdentity. + */ + public static ManagedClusterSecurityProfileWorkloadIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterSecurityProfileWorkloadIdentity deserializedManagedClusterSecurityProfileWorkloadIdentity + = new ManagedClusterSecurityProfileWorkloadIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedManagedClusterSecurityProfileWorkloadIdentity.enabled + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterSecurityProfileWorkloadIdentity; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterServicePrincipalProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterServicePrincipalProfile.java new file mode 100644 index 000000000000..90687a2ed2fe --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterServicePrincipalProfile.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Information about a service principal identity for the cluster to use for manipulating Azure APIs. + */ +@Fluent +public final class ManagedClusterServicePrincipalProfile + implements JsonSerializable { + /* + * The ID for the service principal. + */ + private String clientId; + + /* + * The secret password associated with the service principal in plain text. + */ + private String secret; + + /** + * Creates an instance of ManagedClusterServicePrincipalProfile class. + */ + public ManagedClusterServicePrincipalProfile() { + } + + /** + * Get the clientId property: The ID for the service principal. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: The ID for the service principal. + * + * @param clientId the clientId value to set. + * @return the ManagedClusterServicePrincipalProfile object itself. + */ + public ManagedClusterServicePrincipalProfile withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the secret property: The secret password associated with the service principal in plain text. + * + * @return the secret value. + */ + public String secret() { + return this.secret; + } + + /** + * Set the secret property: The secret password associated with the service principal in plain text. + * + * @param secret the secret value to set. + * @return the ManagedClusterServicePrincipalProfile object itself. + */ + public ManagedClusterServicePrincipalProfile withSecret(String secret) { + this.secret = secret; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("clientId", this.clientId); + jsonWriter.writeStringField("secret", this.secret); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterServicePrincipalProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterServicePrincipalProfile if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ManagedClusterServicePrincipalProfile. + */ + public static ManagedClusterServicePrincipalProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterServicePrincipalProfile deserializedManagedClusterServicePrincipalProfile + = new ManagedClusterServicePrincipalProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clientId".equals(fieldName)) { + deserializedManagedClusterServicePrincipalProfile.clientId = reader.getString(); + } else if ("secret".equals(fieldName)) { + deserializedManagedClusterServicePrincipalProfile.secret = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterServicePrincipalProfile; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterStaticEgressGatewayProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterStaticEgressGatewayProfile.java new file mode 100644 index 000000000000..7bba355f263a --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterStaticEgressGatewayProfile.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The Static Egress Gateway addon configuration for the cluster. + */ +@Fluent +public final class ManagedClusterStaticEgressGatewayProfile + implements JsonSerializable { + /* + * Enable Static Egress Gateway addon. Indicates if Static Egress Gateway addon is enabled or not. + */ + private Boolean enabled; + + /** + * Creates an instance of ManagedClusterStaticEgressGatewayProfile class. + */ + public ManagedClusterStaticEgressGatewayProfile() { + } + + /** + * Get the enabled property: Enable Static Egress Gateway addon. Indicates if Static Egress Gateway addon is enabled + * or not. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Enable Static Egress Gateway addon. Indicates if Static Egress Gateway addon is enabled + * or not. + * + * @param enabled the enabled value to set. + * @return the ManagedClusterStaticEgressGatewayProfile object itself. + */ + public ManagedClusterStaticEgressGatewayProfile withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterStaticEgressGatewayProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterStaticEgressGatewayProfile if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedClusterStaticEgressGatewayProfile. + */ + public static ManagedClusterStaticEgressGatewayProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterStaticEgressGatewayProfile deserializedManagedClusterStaticEgressGatewayProfile + = new ManagedClusterStaticEgressGatewayProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedManagedClusterStaticEgressGatewayProfile.enabled + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterStaticEgressGatewayProfile; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterStatus.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterStatus.java new file mode 100644 index 000000000000..ec70e6738d94 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterStatus.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.exception.ManagementError; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Contains read-only information about the Managed Cluster. + */ +@Immutable +public final class ManagedClusterStatus implements JsonSerializable { + /* + * The error details information of the managed cluster. Preserves the detailed info of failure. If there was no + * error, this field is omitted. + */ + private ManagementError provisioningError; + + /** + * Creates an instance of ManagedClusterStatus class. + */ + public ManagedClusterStatus() { + } + + /** + * Get the provisioningError property: The error details information of the managed cluster. Preserves the detailed + * info of failure. If there was no error, this field is omitted. + * + * @return the provisioningError value. + */ + public ManagementError provisioningError() { + return this.provisioningError; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterStatus if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedClusterStatus. + */ + public static ManagedClusterStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterStatus deserializedManagedClusterStatus = new ManagedClusterStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningError".equals(fieldName)) { + deserializedManagedClusterStatus.provisioningError = ManagementError.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterStatus; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterStorageProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterStorageProfile.java new file mode 100644 index 000000000000..cdcca2eb76fc --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterStorageProfile.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Storage profile for the container service cluster. + */ +@Fluent +public final class ManagedClusterStorageProfile implements JsonSerializable { + /* + * AzureDisk CSI Driver settings for the storage profile. + */ + private ManagedClusterStorageProfileDiskCSIDriver diskCSIDriver; + + /* + * AzureFile CSI Driver settings for the storage profile. + */ + private ManagedClusterStorageProfileFileCSIDriver fileCSIDriver; + + /* + * Snapshot Controller settings for the storage profile. + */ + private ManagedClusterStorageProfileSnapshotController snapshotController; + + /* + * AzureBlob CSI Driver settings for the storage profile. + */ + private ManagedClusterStorageProfileBlobCSIDriver blobCSIDriver; + + /** + * Creates an instance of ManagedClusterStorageProfile class. + */ + public ManagedClusterStorageProfile() { + } + + /** + * Get the diskCSIDriver property: AzureDisk CSI Driver settings for the storage profile. + * + * @return the diskCSIDriver value. + */ + public ManagedClusterStorageProfileDiskCSIDriver diskCSIDriver() { + return this.diskCSIDriver; + } + + /** + * Set the diskCSIDriver property: AzureDisk CSI Driver settings for the storage profile. + * + * @param diskCSIDriver the diskCSIDriver value to set. + * @return the ManagedClusterStorageProfile object itself. + */ + public ManagedClusterStorageProfile withDiskCSIDriver(ManagedClusterStorageProfileDiskCSIDriver diskCSIDriver) { + this.diskCSIDriver = diskCSIDriver; + return this; + } + + /** + * Get the fileCSIDriver property: AzureFile CSI Driver settings for the storage profile. + * + * @return the fileCSIDriver value. + */ + public ManagedClusterStorageProfileFileCSIDriver fileCSIDriver() { + return this.fileCSIDriver; + } + + /** + * Set the fileCSIDriver property: AzureFile CSI Driver settings for the storage profile. + * + * @param fileCSIDriver the fileCSIDriver value to set. + * @return the ManagedClusterStorageProfile object itself. + */ + public ManagedClusterStorageProfile withFileCSIDriver(ManagedClusterStorageProfileFileCSIDriver fileCSIDriver) { + this.fileCSIDriver = fileCSIDriver; + return this; + } + + /** + * Get the snapshotController property: Snapshot Controller settings for the storage profile. + * + * @return the snapshotController value. + */ + public ManagedClusterStorageProfileSnapshotController snapshotController() { + return this.snapshotController; + } + + /** + * Set the snapshotController property: Snapshot Controller settings for the storage profile. + * + * @param snapshotController the snapshotController value to set. + * @return the ManagedClusterStorageProfile object itself. + */ + public ManagedClusterStorageProfile + withSnapshotController(ManagedClusterStorageProfileSnapshotController snapshotController) { + this.snapshotController = snapshotController; + return this; + } + + /** + * Get the blobCSIDriver property: AzureBlob CSI Driver settings for the storage profile. + * + * @return the blobCSIDriver value. + */ + public ManagedClusterStorageProfileBlobCSIDriver blobCSIDriver() { + return this.blobCSIDriver; + } + + /** + * Set the blobCSIDriver property: AzureBlob CSI Driver settings for the storage profile. + * + * @param blobCSIDriver the blobCSIDriver value to set. + * @return the ManagedClusterStorageProfile object itself. + */ + public ManagedClusterStorageProfile withBlobCSIDriver(ManagedClusterStorageProfileBlobCSIDriver blobCSIDriver) { + this.blobCSIDriver = blobCSIDriver; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("diskCSIDriver", this.diskCSIDriver); + jsonWriter.writeJsonField("fileCSIDriver", this.fileCSIDriver); + jsonWriter.writeJsonField("snapshotController", this.snapshotController); + jsonWriter.writeJsonField("blobCSIDriver", this.blobCSIDriver); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterStorageProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterStorageProfile if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedClusterStorageProfile. + */ + public static ManagedClusterStorageProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterStorageProfile deserializedManagedClusterStorageProfile = new ManagedClusterStorageProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("diskCSIDriver".equals(fieldName)) { + deserializedManagedClusterStorageProfile.diskCSIDriver + = ManagedClusterStorageProfileDiskCSIDriver.fromJson(reader); + } else if ("fileCSIDriver".equals(fieldName)) { + deserializedManagedClusterStorageProfile.fileCSIDriver + = ManagedClusterStorageProfileFileCSIDriver.fromJson(reader); + } else if ("snapshotController".equals(fieldName)) { + deserializedManagedClusterStorageProfile.snapshotController + = ManagedClusterStorageProfileSnapshotController.fromJson(reader); + } else if ("blobCSIDriver".equals(fieldName)) { + deserializedManagedClusterStorageProfile.blobCSIDriver + = ManagedClusterStorageProfileBlobCSIDriver.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterStorageProfile; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterStorageProfileBlobCSIDriver.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterStorageProfileBlobCSIDriver.java new file mode 100644 index 000000000000..7b84599ab9dd --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterStorageProfileBlobCSIDriver.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * AzureBlob CSI Driver settings for the storage profile. + */ +@Fluent +public final class ManagedClusterStorageProfileBlobCSIDriver + implements JsonSerializable { + /* + * Whether to enable AzureBlob CSI Driver. The default value is false. + */ + private Boolean enabled; + + /** + * Creates an instance of ManagedClusterStorageProfileBlobCSIDriver class. + */ + public ManagedClusterStorageProfileBlobCSIDriver() { + } + + /** + * Get the enabled property: Whether to enable AzureBlob CSI Driver. The default value is false. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Whether to enable AzureBlob CSI Driver. The default value is false. + * + * @param enabled the enabled value to set. + * @return the ManagedClusterStorageProfileBlobCSIDriver object itself. + */ + public ManagedClusterStorageProfileBlobCSIDriver withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterStorageProfileBlobCSIDriver from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterStorageProfileBlobCSIDriver if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedClusterStorageProfileBlobCSIDriver. + */ + public static ManagedClusterStorageProfileBlobCSIDriver fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterStorageProfileBlobCSIDriver deserializedManagedClusterStorageProfileBlobCSIDriver + = new ManagedClusterStorageProfileBlobCSIDriver(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedManagedClusterStorageProfileBlobCSIDriver.enabled + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterStorageProfileBlobCSIDriver; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterStorageProfileDiskCSIDriver.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterStorageProfileDiskCSIDriver.java new file mode 100644 index 000000000000..583a6155d195 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterStorageProfileDiskCSIDriver.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * AzureDisk CSI Driver settings for the storage profile. + */ +@Fluent +public final class ManagedClusterStorageProfileDiskCSIDriver + implements JsonSerializable { + /* + * Whether to enable AzureDisk CSI Driver. The default value is true. + */ + private Boolean enabled; + + /** + * Creates an instance of ManagedClusterStorageProfileDiskCSIDriver class. + */ + public ManagedClusterStorageProfileDiskCSIDriver() { + } + + /** + * Get the enabled property: Whether to enable AzureDisk CSI Driver. The default value is true. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Whether to enable AzureDisk CSI Driver. The default value is true. + * + * @param enabled the enabled value to set. + * @return the ManagedClusterStorageProfileDiskCSIDriver object itself. + */ + public ManagedClusterStorageProfileDiskCSIDriver withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterStorageProfileDiskCSIDriver from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterStorageProfileDiskCSIDriver if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedClusterStorageProfileDiskCSIDriver. + */ + public static ManagedClusterStorageProfileDiskCSIDriver fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterStorageProfileDiskCSIDriver deserializedManagedClusterStorageProfileDiskCSIDriver + = new ManagedClusterStorageProfileDiskCSIDriver(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedManagedClusterStorageProfileDiskCSIDriver.enabled + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterStorageProfileDiskCSIDriver; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterStorageProfileFileCSIDriver.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterStorageProfileFileCSIDriver.java new file mode 100644 index 000000000000..23f2a9195d21 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterStorageProfileFileCSIDriver.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * AzureFile CSI Driver settings for the storage profile. + */ +@Fluent +public final class ManagedClusterStorageProfileFileCSIDriver + implements JsonSerializable { + /* + * Whether to enable AzureFile CSI Driver. The default value is true. + */ + private Boolean enabled; + + /** + * Creates an instance of ManagedClusterStorageProfileFileCSIDriver class. + */ + public ManagedClusterStorageProfileFileCSIDriver() { + } + + /** + * Get the enabled property: Whether to enable AzureFile CSI Driver. The default value is true. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Whether to enable AzureFile CSI Driver. The default value is true. + * + * @param enabled the enabled value to set. + * @return the ManagedClusterStorageProfileFileCSIDriver object itself. + */ + public ManagedClusterStorageProfileFileCSIDriver withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterStorageProfileFileCSIDriver from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterStorageProfileFileCSIDriver if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedClusterStorageProfileFileCSIDriver. + */ + public static ManagedClusterStorageProfileFileCSIDriver fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterStorageProfileFileCSIDriver deserializedManagedClusterStorageProfileFileCSIDriver + = new ManagedClusterStorageProfileFileCSIDriver(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedManagedClusterStorageProfileFileCSIDriver.enabled + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterStorageProfileFileCSIDriver; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterStorageProfileSnapshotController.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterStorageProfileSnapshotController.java new file mode 100644 index 000000000000..f2dfc52c081c --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterStorageProfileSnapshotController.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Snapshot Controller settings for the storage profile. + */ +@Fluent +public final class ManagedClusterStorageProfileSnapshotController + implements JsonSerializable { + /* + * Whether to enable Snapshot Controller. The default value is true. + */ + private Boolean enabled; + + /** + * Creates an instance of ManagedClusterStorageProfileSnapshotController class. + */ + public ManagedClusterStorageProfileSnapshotController() { + } + + /** + * Get the enabled property: Whether to enable Snapshot Controller. The default value is true. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Whether to enable Snapshot Controller. The default value is true. + * + * @param enabled the enabled value to set. + * @return the ManagedClusterStorageProfileSnapshotController object itself. + */ + public ManagedClusterStorageProfileSnapshotController withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterStorageProfileSnapshotController from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterStorageProfileSnapshotController if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedClusterStorageProfileSnapshotController. + */ + public static ManagedClusterStorageProfileSnapshotController fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterStorageProfileSnapshotController deserializedManagedClusterStorageProfileSnapshotController + = new ManagedClusterStorageProfileSnapshotController(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedManagedClusterStorageProfileSnapshotController.enabled + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterStorageProfileSnapshotController; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterUpgradeProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterUpgradeProfile.java new file mode 100644 index 000000000000..8826d08d0f7b --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterUpgradeProfile.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterUpgradeProfileInner; +import java.util.List; + +/** + * An immutable client-side representation of ManagedClusterUpgradeProfile. + */ +public interface ManagedClusterUpgradeProfile { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the controlPlaneProfile property: The list of available upgrade versions for the control plane. + * + * @return the controlPlaneProfile value. + */ + ManagedClusterPoolUpgradeProfile controlPlaneProfile(); + + /** + * Gets the agentPoolProfiles property: The list of available upgrade versions for agent pools. + * + * @return the agentPoolProfiles value. + */ + List agentPoolProfiles(); + + /** + * Gets the inner + * com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterUpgradeProfileInner object. + * + * @return the inner object. + */ + ManagedClusterUpgradeProfileInner innerModel(); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterWindowsProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterWindowsProfile.java new file mode 100644 index 000000000000..064c0ec37292 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterWindowsProfile.java @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Profile for Windows VMs in the managed cluster. + */ +@Fluent +public final class ManagedClusterWindowsProfile implements JsonSerializable { + /* + * Specifies the name of the administrator account.

**Restriction:** Cannot end in "."

+ * **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".

+ * **Minimum-length:** 1 character

**Max-length:** 20 characters + */ + private String adminUsername; + + /* + * Specifies the password of the administrator account.

**Minimum-length:** 8 characters

+ * **Max-length:** 123 characters

**Complexity requirements:** 3 out of 4 conditions below need to be + * fulfilled
Has lower characters
Has upper characters
Has a digit
Has a special character (Regex + * match [\W_])

**Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", + * "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" + */ + private String adminPassword; + + /* + * The license type to use for Windows VMs. See [Azure Hybrid User + * Benefits](https://azure.microsoft.com/pricing/hybrid-benefit/faq/) for more details. + */ + private LicenseType licenseType; + + /* + * Whether to enable CSI proxy. For more details on CSI proxy, see the [CSI proxy GitHub + * repo](https://github.com/kubernetes-csi/csi-proxy). + */ + private Boolean enableCSIProxy; + + /* + * The Windows gMSA Profile in the Managed Cluster. + */ + private WindowsGmsaProfile gmsaProfile; + + /** + * Creates an instance of ManagedClusterWindowsProfile class. + */ + public ManagedClusterWindowsProfile() { + } + + /** + * Get the adminUsername property: 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. + * + * @return the adminUsername value. + */ + public String adminUsername() { + return this.adminUsername; + } + + /** + * Set the adminUsername property: 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. + * + * @param adminUsername the adminUsername value to set. + * @return the ManagedClusterWindowsProfile object itself. + */ + public ManagedClusterWindowsProfile withAdminUsername(String adminUsername) { + this.adminUsername = adminUsername; + return this; + } + + /** + * Get the adminPassword property: 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!". + * + * @return the adminPassword value. + */ + public String adminPassword() { + return this.adminPassword; + } + + /** + * Set the adminPassword property: 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!". + * + * @param adminPassword the adminPassword value to set. + * @return the ManagedClusterWindowsProfile object itself. + */ + public ManagedClusterWindowsProfile withAdminPassword(String adminPassword) { + this.adminPassword = adminPassword; + return this; + } + + /** + * Get the licenseType property: The license type to use for Windows VMs. See [Azure Hybrid User + * Benefits](https://azure.microsoft.com/pricing/hybrid-benefit/faq/) for more details. + * + * @return the licenseType value. + */ + public LicenseType licenseType() { + return this.licenseType; + } + + /** + * Set the licenseType property: The license type to use for Windows VMs. See [Azure Hybrid User + * Benefits](https://azure.microsoft.com/pricing/hybrid-benefit/faq/) for more details. + * + * @param licenseType the licenseType value to set. + * @return the ManagedClusterWindowsProfile object itself. + */ + public ManagedClusterWindowsProfile withLicenseType(LicenseType licenseType) { + this.licenseType = licenseType; + return this; + } + + /** + * Get the enableCSIProxy property: Whether to enable CSI proxy. For more details on CSI proxy, see the [CSI proxy + * GitHub repo](https://github.com/kubernetes-csi/csi-proxy). + * + * @return the enableCSIProxy value. + */ + public Boolean enableCSIProxy() { + return this.enableCSIProxy; + } + + /** + * Set the enableCSIProxy property: Whether to enable CSI proxy. For more details on CSI proxy, see the [CSI proxy + * GitHub repo](https://github.com/kubernetes-csi/csi-proxy). + * + * @param enableCSIProxy the enableCSIProxy value to set. + * @return the ManagedClusterWindowsProfile object itself. + */ + public ManagedClusterWindowsProfile withEnableCSIProxy(Boolean enableCSIProxy) { + this.enableCSIProxy = enableCSIProxy; + return this; + } + + /** + * Get the gmsaProfile property: The Windows gMSA Profile in the Managed Cluster. + * + * @return the gmsaProfile value. + */ + public WindowsGmsaProfile gmsaProfile() { + return this.gmsaProfile; + } + + /** + * Set the gmsaProfile property: The Windows gMSA Profile in the Managed Cluster. + * + * @param gmsaProfile the gmsaProfile value to set. + * @return the ManagedClusterWindowsProfile object itself. + */ + public ManagedClusterWindowsProfile withGmsaProfile(WindowsGmsaProfile gmsaProfile) { + this.gmsaProfile = gmsaProfile; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("adminUsername", this.adminUsername); + jsonWriter.writeStringField("adminPassword", this.adminPassword); + jsonWriter.writeStringField("licenseType", this.licenseType == null ? null : this.licenseType.toString()); + jsonWriter.writeBooleanField("enableCSIProxy", this.enableCSIProxy); + jsonWriter.writeJsonField("gmsaProfile", this.gmsaProfile); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterWindowsProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterWindowsProfile if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ManagedClusterWindowsProfile. + */ + public static ManagedClusterWindowsProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterWindowsProfile deserializedManagedClusterWindowsProfile = new ManagedClusterWindowsProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("adminUsername".equals(fieldName)) { + deserializedManagedClusterWindowsProfile.adminUsername = reader.getString(); + } else if ("adminPassword".equals(fieldName)) { + deserializedManagedClusterWindowsProfile.adminPassword = reader.getString(); + } else if ("licenseType".equals(fieldName)) { + deserializedManagedClusterWindowsProfile.licenseType = LicenseType.fromString(reader.getString()); + } else if ("enableCSIProxy".equals(fieldName)) { + deserializedManagedClusterWindowsProfile.enableCSIProxy + = reader.getNullable(JsonReader::getBoolean); + } else if ("gmsaProfile".equals(fieldName)) { + deserializedManagedClusterWindowsProfile.gmsaProfile = WindowsGmsaProfile.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterWindowsProfile; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterWorkloadAutoScalerProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterWorkloadAutoScalerProfile.java new file mode 100644 index 000000000000..2808db85ea82 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterWorkloadAutoScalerProfile.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Workload Auto-scaler profile for the managed cluster. + */ +@Fluent +public final class ManagedClusterWorkloadAutoScalerProfile + implements JsonSerializable { + /* + * KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler profile. + */ + private ManagedClusterWorkloadAutoScalerProfileKeda keda; + + /* + * VPA (Vertical Pod Autoscaler) settings for the workload auto-scaler profile. + */ + private ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler verticalPodAutoscaler; + + /** + * Creates an instance of ManagedClusterWorkloadAutoScalerProfile class. + */ + public ManagedClusterWorkloadAutoScalerProfile() { + } + + /** + * Get the keda property: KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler profile. + * + * @return the keda value. + */ + public ManagedClusterWorkloadAutoScalerProfileKeda keda() { + return this.keda; + } + + /** + * Set the keda property: KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler profile. + * + * @param keda the keda value to set. + * @return the ManagedClusterWorkloadAutoScalerProfile object itself. + */ + public ManagedClusterWorkloadAutoScalerProfile withKeda(ManagedClusterWorkloadAutoScalerProfileKeda keda) { + this.keda = keda; + return this; + } + + /** + * Get the verticalPodAutoscaler property: VPA (Vertical Pod Autoscaler) settings for the workload auto-scaler + * profile. + * + * @return the verticalPodAutoscaler value. + */ + public ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler verticalPodAutoscaler() { + return this.verticalPodAutoscaler; + } + + /** + * Set the verticalPodAutoscaler property: VPA (Vertical Pod Autoscaler) settings for the workload auto-scaler + * profile. + * + * @param verticalPodAutoscaler the verticalPodAutoscaler value to set. + * @return the ManagedClusterWorkloadAutoScalerProfile object itself. + */ + public ManagedClusterWorkloadAutoScalerProfile + withVerticalPodAutoscaler(ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler verticalPodAutoscaler) { + this.verticalPodAutoscaler = verticalPodAutoscaler; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("keda", this.keda); + jsonWriter.writeJsonField("verticalPodAutoscaler", this.verticalPodAutoscaler); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterWorkloadAutoScalerProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterWorkloadAutoScalerProfile if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedClusterWorkloadAutoScalerProfile. + */ + public static ManagedClusterWorkloadAutoScalerProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterWorkloadAutoScalerProfile deserializedManagedClusterWorkloadAutoScalerProfile + = new ManagedClusterWorkloadAutoScalerProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keda".equals(fieldName)) { + deserializedManagedClusterWorkloadAutoScalerProfile.keda + = ManagedClusterWorkloadAutoScalerProfileKeda.fromJson(reader); + } else if ("verticalPodAutoscaler".equals(fieldName)) { + deserializedManagedClusterWorkloadAutoScalerProfile.verticalPodAutoscaler + = ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterWorkloadAutoScalerProfile; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterWorkloadAutoScalerProfileKeda.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterWorkloadAutoScalerProfileKeda.java new file mode 100644 index 000000000000..9c6ac7c95cc7 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterWorkloadAutoScalerProfileKeda.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler profile. + */ +@Fluent +public final class ManagedClusterWorkloadAutoScalerProfileKeda + implements JsonSerializable { + /* + * Whether to enable KEDA. + */ + private boolean enabled; + + /** + * Creates an instance of ManagedClusterWorkloadAutoScalerProfileKeda class. + */ + public ManagedClusterWorkloadAutoScalerProfileKeda() { + } + + /** + * Get the enabled property: Whether to enable KEDA. + * + * @return the enabled value. + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Whether to enable KEDA. + * + * @param enabled the enabled value to set. + * @return the ManagedClusterWorkloadAutoScalerProfileKeda object itself. + */ + public ManagedClusterWorkloadAutoScalerProfileKeda withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterWorkloadAutoScalerProfileKeda from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterWorkloadAutoScalerProfileKeda if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ManagedClusterWorkloadAutoScalerProfileKeda. + */ + public static ManagedClusterWorkloadAutoScalerProfileKeda fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterWorkloadAutoScalerProfileKeda deserializedManagedClusterWorkloadAutoScalerProfileKeda + = new ManagedClusterWorkloadAutoScalerProfileKeda(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedManagedClusterWorkloadAutoScalerProfileKeda.enabled = reader.getBoolean(); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterWorkloadAutoScalerProfileKeda; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler.java new file mode 100644 index 000000000000..9bd748e342c7 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * VPA (Vertical Pod Autoscaler) settings for the workload auto-scaler profile. + */ +@Fluent +public final class ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler + implements JsonSerializable { + /* + * Whether to enable VPA. Default value is false. + */ + private boolean enabled; + + /** + * Creates an instance of ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler class. + */ + public ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler() { + } + + /** + * Get the enabled property: Whether to enable VPA. Default value is false. + * + * @return the enabled value. + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Whether to enable VPA. Default value is false. + * + * @param enabled the enabled value to set. + * @return the ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler object itself. + */ + public ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler if the JsonReader was + * pointing to an instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the + * ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler. + */ + public static ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler deserializedManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler + = new ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler.enabled + = reader.getBoolean(); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusters.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusters.java new file mode 100644 index 000000000000..e30a4edc2e1e --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusters.java @@ -0,0 +1,784 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of ManagedClusters. + */ +public interface ManagedClusters { + /** + * Gets a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a managed cluster along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String resourceName, + Context context); + + /** + * Gets a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a managed cluster. + */ + ManagedCluster getByResourceGroup(String resourceGroupName, String resourceName); + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String resourceName); + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String resourceName, String ifMatch, Context context); + + /** + * Lists managed clusters in the specified subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ManagedCluster list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists managed clusters in the specified subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ManagedCluster list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets a list of managed clusters in the specified subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of managed clusters in the specified subscription as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Gets a list of managed clusters in the specified subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of managed clusters in the specified subscription as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Gets an access profile of a managed cluster. + * + * **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) + * . + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param roleName The name of the role for managed cluster accessProfile resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an access profile of a managed cluster. + * + * **WARNING**: This API will be deprecated along with {@link Response}. + */ + Response getAccessProfileWithResponse(String resourceGroupName, String resourceName, + String roleName, Context context); + + /** + * Gets an access profile of a managed cluster. + * + * **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) + * . + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param roleName The name of the role for managed cluster accessProfile resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an access profile of a managed cluster. + * + * **WARNING**: This API will be deprecated. + */ + ManagedClusterAccessProfile getAccessProfile(String resourceGroupName, String resourceName, String roleName); + + /** + * Lists the admin credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param serverFqdn server fqdn type for credentials to be returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list credential result response along with {@link Response}. + */ + Response listClusterAdminCredentialsWithResponse(String resourceGroupName, String resourceName, + String serverFqdn, Context context); + + /** + * Lists the admin credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list credential result response. + */ + CredentialResults listClusterAdminCredentials(String resourceGroupName, String resourceName); + + /** + * Lists the user credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param serverFqdn server fqdn type for credentials to be returned. + * @param format 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list credential result response along with {@link Response}. + */ + Response listClusterUserCredentialsWithResponse(String resourceGroupName, String resourceName, + String serverFqdn, Format format, Context context); + + /** + * Lists the user credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list credential result response. + */ + CredentialResults listClusterUserCredentials(String resourceGroupName, String resourceName); + + /** + * Lists the cluster monitoring user credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param serverFqdn server fqdn type for credentials to be returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list credential result response along with {@link Response}. + */ + Response listClusterMonitoringUserCredentialsWithResponse(String resourceGroupName, + String resourceName, String serverFqdn, Context context); + + /** + * Lists the cluster monitoring user credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list credential result response. + */ + CredentialResults listClusterMonitoringUserCredentials(String resourceGroupName, String resourceName); + + /** + * Reset the Service Principal Profile of a managed cluster. + * + * This action cannot be performed on a cluster that is not using a service principal. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The service principal profile to set on the managed cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void resetServicePrincipalProfile(String resourceGroupName, String resourceName, + ManagedClusterServicePrincipalProfile parameters); + + /** + * Reset the Service Principal Profile of a managed cluster. + * + * This action cannot be performed on a cluster that is not using a service principal. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The service principal profile to set on the managed cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void resetServicePrincipalProfile(String resourceGroupName, String resourceName, + ManagedClusterServicePrincipalProfile parameters, Context context); + + /** + * Reset the AAD Profile of a managed cluster. + * + * **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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The AAD profile to set on the Managed Cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void resetAADProfile(String resourceGroupName, String resourceName, ManagedClusterAADProfile parameters); + + /** + * Reset the AAD Profile of a managed cluster. + * + * **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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The AAD profile to set on the Managed Cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void resetAADProfile(String resourceGroupName, String resourceName, ManagedClusterAADProfile parameters, + Context context); + + /** + * Rotates the certificates of a managed cluster. + * + * See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about + * rotating managed cluster certificates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void rotateClusterCertificates(String resourceGroupName, String resourceName); + + /** + * Rotates the certificates of a managed cluster. + * + * See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about + * rotating managed cluster certificates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void rotateClusterCertificates(String resourceGroupName, String resourceName, Context context); + + /** + * Aborts last operation running on managed cluster. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void abortLatestOperation(String resourceGroupName, String resourceName); + + /** + * Aborts last operation running on managed cluster. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void abortLatestOperation(String resourceGroupName, String resourceName, Context context); + + /** + * Rotates the service account signing keys of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void rotateServiceAccountSigningKeys(String resourceGroupName, String resourceName); + + /** + * Rotates the service account signing keys of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void rotateServiceAccountSigningKeys(String resourceGroupName, String resourceName, Context context); + + /** + * Stops a Managed Cluster + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(String resourceGroupName, String resourceName); + + /** + * Stops a Managed Cluster + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(String resourceGroupName, String resourceName, Context context); + + /** + * Starts a previously stopped Managed Cluster + * + * See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting + * a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String resourceGroupName, String resourceName); + + /** + * Starts a previously stopped Managed Cluster + * + * See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting + * a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String resourceGroupName, String resourceName, Context context); + + /** + * Submits a command to run against the Managed Cluster. + * + * 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). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param requestPayload The run command request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + RunCommandResult runCommand(String resourceGroupName, String resourceName, RunCommandRequest requestPayload); + + /** + * Submits a command to run against the Managed Cluster. + * + * 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). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param requestPayload The run command request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + RunCommandResult runCommand(String resourceGroupName, String resourceName, RunCommandRequest requestPayload, + Context context); + + /** + * Gets the results of a command which has been run on the Managed Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param commandId Id of the command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the results of a command which has been run on the Managed Cluster. + */ + Response getCommandResultWithResponse(String resourceGroupName, String resourceName, + String commandId, Context context); + + /** + * Gets the results of a command which has been run on the Managed Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param commandId Id of the command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the results of a command which has been run on the Managed Cluster. + */ + RunCommandResult getCommandResult(String resourceGroupName, String resourceName, String commandId); + + /** + * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed + * cluster. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed + * cluster. + * + * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster + * as paginated response with {@link PagedIterable}. + */ + PagedIterable listOutboundNetworkDependenciesEndpoints(String resourceGroupName, + String resourceName); + + /** + * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed + * cluster. + * + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed + * cluster. + * + * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster + * as paginated response with {@link PagedIterable}. + */ + PagedIterable listOutboundNetworkDependenciesEndpoints(String resourceGroupName, + String resourceName, Context context); + + /** + * Gets the upgrade profile of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upgrade profile of a managed cluster along with {@link Response}. + */ + Response getUpgradeProfileWithResponse(String resourceGroupName, String resourceName, + Context context); + + /** + * Gets the upgrade profile of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upgrade profile of a managed cluster. + */ + ManagedClusterUpgradeProfile getUpgradeProfile(String resourceGroupName, String resourceName); + + /** + * Gets a mesh revision profile for a specified mesh in the specified location. + * + * Contains extra metadata on the revision, including supported revisions, cluster compatibility and available + * upgrades. + * + * @param location The name of the Azure region. + * @param mode The mode of the mesh. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a mesh revision profile for a specified mesh in the specified location. + * + * Contains extra metadata on the revision, including supported revisions, cluster compatibility and available + * upgrades along with {@link Response}. + */ + Response getMeshRevisionProfileWithResponse(String location, String mode, Context context); + + /** + * Gets a mesh revision profile for a specified mesh in the specified location. + * + * Contains extra metadata on the revision, including supported revisions, cluster compatibility and available + * upgrades. + * + * @param location The name of the Azure region. + * @param mode The mode of the mesh. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a mesh revision profile for a specified mesh in the specified location. + * + * Contains extra metadata on the revision, including supported revisions, cluster compatibility and available + * upgrades. + */ + MeshRevisionProfile getMeshRevisionProfile(String location, String mode); + + /** + * Lists mesh revision profiles for all meshes in the specified location. + * + * Contains extra metadata on each revision, including supported revisions, cluster compatibility and available + * upgrades. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return holds an array of MeshRevisionsProfiles as paginated response with {@link PagedIterable}. + */ + PagedIterable listMeshRevisionProfiles(String location); + + /** + * Lists mesh revision profiles for all meshes in the specified location. + * + * Contains extra metadata on each revision, including supported revisions, cluster compatibility and available + * upgrades. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return holds an array of MeshRevisionsProfiles as paginated response with {@link PagedIterable}. + */ + PagedIterable listMeshRevisionProfiles(String location, Context context); + + /** + * Gets available upgrades for a service mesh in a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param mode The mode of the mesh. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return available upgrades for a service mesh in a cluster along with {@link Response}. + */ + Response getMeshUpgradeProfileWithResponse(String resourceGroupName, String resourceName, + String mode, Context context); + + /** + * Gets available upgrades for a service mesh in a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param mode The mode of the mesh. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return available upgrades for a service mesh in a cluster. + */ + MeshUpgradeProfile getMeshUpgradeProfile(String resourceGroupName, String resourceName, String mode); + + /** + * Lists available upgrades for all service meshes in a specific cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return holds an array of MeshUpgradeProfiles as paginated response with {@link PagedIterable}. + */ + PagedIterable listMeshUpgradeProfiles(String resourceGroupName, String resourceName); + + /** + * Lists available upgrades for all service meshes in a specific cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return holds an array of MeshUpgradeProfiles as paginated response with {@link PagedIterable}. + */ + PagedIterable listMeshUpgradeProfiles(String resourceGroupName, String resourceName, + Context context); + + /** + * Gets a list of supported Kubernetes versions in the specified subscription. + * + * Contains extra metadata on the version, including supported patch versions, capabilities, available upgrades, and + * details on preview status of the version. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of supported Kubernetes versions in the specified subscription. + * + * Contains extra metadata on the version, including supported patch versions, capabilities, available upgrades, and + * details on preview status of the version along with {@link Response}. + */ + Response listKubernetesVersionsWithResponse(String location, Context context); + + /** + * Gets a list of supported Kubernetes versions in the specified subscription. + * + * Contains extra metadata on the version, including supported patch versions, capabilities, available upgrades, and + * details on preview status of the version. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of supported Kubernetes versions in the specified subscription. + * + * Contains extra metadata on the version, including supported patch versions, capabilities, available upgrades, and + * details on preview status of the version. + */ + KubernetesVersionListResult listKubernetesVersions(String location); + + /** + * Gets a managed cluster. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a managed cluster along with {@link Response}. + */ + ManagedCluster getById(String id); + + /** + * Gets a managed cluster. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a managed cluster along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a managed cluster. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a managed cluster. + * + * @param id the resource ID. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, String ifMatch, Context context); + + /** + * Begins definition for a new ManagedCluster resource. + * + * @param name resource name. + * @return the first stage of the new ManagedCluster definition. + */ + ManagedCluster.DefinitionStages.Blank define(String name); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClustersGetCommandResultHeaders.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClustersGetCommandResultHeaders.java new file mode 100644 index 000000000000..81611bda88a7 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClustersGetCommandResultHeaders.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; + +/** + * The ManagedClustersGetCommandResultHeaders model. + */ +@Immutable +public final class ManagedClustersGetCommandResultHeaders { + /* + * The location property. + */ + private final String location; + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of ManagedClustersGetCommandResultHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public ManagedClustersGetCommandResultHeaders(HttpHeaders rawHeaders) { + this.location = rawHeaders.getValue(HttpHeaderName.LOCATION); + } + + /** + * Get the location property: The location property. + * + * @return the location value. + */ + public String location() { + return this.location; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClustersGetCommandResultResponse.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClustersGetCommandResultResponse.java new file mode 100644 index 000000000000..3c4b989ce92d --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClustersGetCommandResultResponse.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.containerservice.generated.fluent.models.RunCommandResultInner; + +/** + * Contains all response data for the getCommandResult operation. + */ +public final class ManagedClustersGetCommandResultResponse + extends ResponseBase { + /** + * Creates an instance of ManagedClustersGetCommandResultResponse. + * + * @param request the request which resulted in this ManagedClustersGetCommandResultResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ManagedClustersGetCommandResultResponse(HttpRequest request, int statusCode, HttpHeaders rawHeaders, + RunCommandResultInner value, ManagedClustersGetCommandResultHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ + @Override + public RunCommandResultInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedNamespace.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedNamespace.java new file mode 100644 index 000000000000..e15072e8f010 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedNamespace.java @@ -0,0 +1,285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedNamespaceInner; +import java.util.Map; + +/** + * An immutable client-side representation of ManagedNamespace. + */ +public interface ManagedNamespace { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: Properties of a namespace. + * + * @return the properties value. + */ + NamespaceProperties properties(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the eTag property: If eTag is provided in the response body, it may also be provided as a header per the + * normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. + * HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), + * and If-Range (section 14.27) header fields. + * + * @return the eTag value. + */ + String eTag(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedNamespaceInner object. + * + * @return the inner object. + */ + ManagedNamespaceInner innerModel(); + + /** + * The entirety of the ManagedNamespace definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The ManagedNamespace definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the ManagedNamespace definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the ManagedNamespace definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, resourceName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @return the next definition stage. + */ + WithCreate withExistingManagedCluster(String resourceGroupName, String resourceName); + } + + /** + * The stage of the ManagedNamespace definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithLocation, DefinitionStages.WithTags, DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + ManagedNamespace create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ManagedNamespace create(Context context); + } + + /** + * The stage of the ManagedNamespace definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + + /** + * The stage of the ManagedNamespace definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the ManagedNamespace definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Properties of a namespace.. + * + * @param properties Properties of a namespace. + * @return the next definition stage. + */ + WithCreate withProperties(NamespaceProperties properties); + } + } + + /** + * Begins update for the ManagedNamespace resource. + * + * @return the stage of resource update. + */ + ManagedNamespace.Update update(); + + /** + * The template for ManagedNamespace update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ManagedNamespace apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ManagedNamespace apply(Context context); + } + + /** + * The ManagedNamespace update stages. + */ + interface UpdateStages { + /** + * The stage of the ManagedNamespace update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ManagedNamespace refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ManagedNamespace refresh(Context context); + + /** + * Lists the credentials of a namespace. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list credential result response along with {@link Response}. + */ + Response listCredentialWithResponse(Context context); + + /** + * Lists the credentials of a namespace. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list credential result response. + */ + CredentialResults listCredential(); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedNamespaces.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedNamespaces.java new file mode 100644 index 000000000000..7a99d82fee12 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedNamespaces.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of ManagedNamespaces. + */ +public interface ManagedNamespaces { + /** + * Gets the specified namespace of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified namespace of a managed cluster along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String resourceName, + String managedNamespaceName, Context context); + + /** + * Gets the specified namespace of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified namespace of a managed cluster. + */ + ManagedNamespace get(String resourceGroupName, String resourceName, String managedNamespaceName); + + /** + * Deletes a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String resourceName, String managedNamespaceName); + + /** + * Deletes a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String resourceName, String managedNamespaceName, Context context); + + /** + * Gets a list of managed namespaces in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of managed namespaces in the specified managed cluster as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByManagedCluster(String resourceGroupName, String resourceName); + + /** + * Gets a list of managed namespaces in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of managed namespaces in the specified managed cluster as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByManagedCluster(String resourceGroupName, String resourceName, + Context context); + + /** + * Lists the credentials of a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list credential result response along with {@link Response}. + */ + Response listCredentialWithResponse(String resourceGroupName, String resourceName, + String managedNamespaceName, Context context); + + /** + * Lists the credentials of a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param managedNamespaceName The name of the managed namespace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list credential result response. + */ + CredentialResults listCredential(String resourceGroupName, String resourceName, String managedNamespaceName); + + /** + * Gets the specified namespace of a managed cluster. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified namespace of a managed cluster along with {@link Response}. + */ + ManagedNamespace getById(String id); + + /** + * Gets the specified namespace of a managed cluster. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified namespace of a managed cluster along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a namespace. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a namespace. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ManagedNamespace resource. + * + * @param name resource name. + * @return the first stage of the new ManagedNamespace definition. + */ + ManagedNamespace.DefinitionStages.Blank define(String name); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedServiceIdentityUserAssignedIdentitiesValue.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedServiceIdentityUserAssignedIdentitiesValue.java new file mode 100644 index 000000000000..ecef349852eb --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedServiceIdentityUserAssignedIdentitiesValue.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * User assigned identity properties. + */ +@Immutable +public final class ManagedServiceIdentityUserAssignedIdentitiesValue + implements JsonSerializable { + /* + * The principal id of user assigned identity. + */ + private String principalId; + + /* + * The client id of user assigned identity. + */ + private String clientId; + + /** + * Creates an instance of ManagedServiceIdentityUserAssignedIdentitiesValue class. + */ + public ManagedServiceIdentityUserAssignedIdentitiesValue() { + } + + /** + * Get the principalId property: The principal id of user assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client id of user assigned identity. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedServiceIdentityUserAssignedIdentitiesValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedServiceIdentityUserAssignedIdentitiesValue if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedServiceIdentityUserAssignedIdentitiesValue. + */ + public static ManagedServiceIdentityUserAssignedIdentitiesValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedServiceIdentityUserAssignedIdentitiesValue deserializedManagedServiceIdentityUserAssignedIdentitiesValue + = new ManagedServiceIdentityUserAssignedIdentitiesValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("principalId".equals(fieldName)) { + deserializedManagedServiceIdentityUserAssignedIdentitiesValue.principalId = reader.getString(); + } else if ("clientId".equals(fieldName)) { + deserializedManagedServiceIdentityUserAssignedIdentitiesValue.clientId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedServiceIdentityUserAssignedIdentitiesValue; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManualScaleProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManualScaleProfile.java new file mode 100644 index 000000000000..9aae313c9584 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManualScaleProfile.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Specifications on number of machines. + */ +@Fluent +public final class ManualScaleProfile implements JsonSerializable { + /* + * VM size that AKS will use when creating and scaling e.g. 'Standard_E4s_v3', 'Standard_E16s_v3' or + * 'Standard_D16s_v5'. + */ + private String size; + + /* + * Number of nodes. + */ + private Integer count; + + /** + * Creates an instance of ManualScaleProfile class. + */ + public ManualScaleProfile() { + } + + /** + * Get the size property: VM size that AKS will use when creating and scaling e.g. 'Standard_E4s_v3', + * 'Standard_E16s_v3' or 'Standard_D16s_v5'. + * + * @return the size value. + */ + public String size() { + return this.size; + } + + /** + * Set the size property: VM size that AKS will use when creating and scaling e.g. 'Standard_E4s_v3', + * 'Standard_E16s_v3' or 'Standard_D16s_v5'. + * + * @param size the size value to set. + * @return the ManualScaleProfile object itself. + */ + public ManualScaleProfile withSize(String size) { + this.size = size; + return this; + } + + /** + * Get the count property: Number of nodes. + * + * @return the count value. + */ + public Integer count() { + return this.count; + } + + /** + * Set the count property: Number of nodes. + * + * @param count the count value to set. + * @return the ManualScaleProfile object itself. + */ + public ManualScaleProfile withCount(Integer count) { + this.count = count; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("size", this.size); + jsonWriter.writeNumberField("count", this.count); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManualScaleProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManualScaleProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ManualScaleProfile. + */ + public static ManualScaleProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManualScaleProfile deserializedManualScaleProfile = new ManualScaleProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("size".equals(fieldName)) { + deserializedManualScaleProfile.size = reader.getString(); + } else if ("count".equals(fieldName)) { + deserializedManualScaleProfile.count = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedManualScaleProfile; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MeshRevision.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MeshRevision.java new file mode 100644 index 000000000000..42495590a5d1 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MeshRevision.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Holds information on upgrades and compatibility for given major.minor mesh release. + */ +@Immutable +public class MeshRevision implements JsonSerializable { + /* + * The revision of the mesh release. + */ + private String revision; + + /* + * List of revisions available for upgrade of a specific mesh revision + */ + private List upgrades; + + /* + * List of items this revision of service mesh is compatible with, and their associated versions. + */ + private List compatibleWith; + + /** + * Creates an instance of MeshRevision class. + */ + protected MeshRevision() { + } + + /** + * Get the revision property: The revision of the mesh release. + * + * @return the revision value. + */ + public String revision() { + return this.revision; + } + + /** + * Set the revision property: The revision of the mesh release. + * + * @param revision the revision value to set. + * @return the MeshRevision object itself. + */ + MeshRevision withRevision(String revision) { + this.revision = revision; + return this; + } + + /** + * Get the upgrades property: List of revisions available for upgrade of a specific mesh revision. + * + * @return the upgrades value. + */ + public List upgrades() { + return this.upgrades; + } + + /** + * Set the upgrades property: List of revisions available for upgrade of a specific mesh revision. + * + * @param upgrades the upgrades value to set. + * @return the MeshRevision object itself. + */ + MeshRevision withUpgrades(List upgrades) { + this.upgrades = upgrades; + return this; + } + + /** + * Get the compatibleWith property: List of items this revision of service mesh is compatible with, and their + * associated versions. + * + * @return the compatibleWith value. + */ + public List compatibleWith() { + return this.compatibleWith; + } + + /** + * Set the compatibleWith property: List of items this revision of service mesh is compatible with, and their + * associated versions. + * + * @param compatibleWith the compatibleWith value to set. + * @return the MeshRevision object itself. + */ + MeshRevision withCompatibleWith(List compatibleWith) { + this.compatibleWith = compatibleWith; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("revision", this.revision); + jsonWriter.writeArrayField("upgrades", this.upgrades, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("compatibleWith", this.compatibleWith, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MeshRevision from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MeshRevision if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MeshRevision. + */ + public static MeshRevision fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MeshRevision deserializedMeshRevision = new MeshRevision(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("revision".equals(fieldName)) { + deserializedMeshRevision.revision = reader.getString(); + } else if ("upgrades".equals(fieldName)) { + List upgrades = reader.readArray(reader1 -> reader1.getString()); + deserializedMeshRevision.upgrades = upgrades; + } else if ("compatibleWith".equals(fieldName)) { + List compatibleWith + = reader.readArray(reader1 -> CompatibleVersions.fromJson(reader1)); + deserializedMeshRevision.compatibleWith = compatibleWith; + } else { + reader.skipChildren(); + } + } + + return deserializedMeshRevision; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MeshRevisionProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MeshRevisionProfile.java new file mode 100644 index 000000000000..1264ad995696 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MeshRevisionProfile.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.containerservice.generated.fluent.models.MeshRevisionProfileInner; + +/** + * An immutable client-side representation of MeshRevisionProfile. + */ +public interface MeshRevisionProfile { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: Mesh revision profile properties for a mesh. + * + * @return the properties value. + */ + MeshRevisionProfileProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.containerservice.generated.fluent.models.MeshRevisionProfileInner + * object. + * + * @return the inner object. + */ + MeshRevisionProfileInner innerModel(); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MeshRevisionProfileProperties.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MeshRevisionProfileProperties.java new file mode 100644 index 000000000000..6a0d842f3a1b --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MeshRevisionProfileProperties.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Mesh revision profile properties for a mesh. + */ +@Immutable +public final class MeshRevisionProfileProperties implements JsonSerializable { + /* + * Available mesh revisions. + */ + private List meshRevisions; + + /** + * Creates an instance of MeshRevisionProfileProperties class. + */ + private MeshRevisionProfileProperties() { + } + + /** + * Get the meshRevisions property: Available mesh revisions. + * + * @return the meshRevisions value. + */ + public List meshRevisions() { + return this.meshRevisions; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("meshRevisions", this.meshRevisions, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MeshRevisionProfileProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MeshRevisionProfileProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MeshRevisionProfileProperties. + */ + public static MeshRevisionProfileProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MeshRevisionProfileProperties deserializedMeshRevisionProfileProperties + = new MeshRevisionProfileProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("meshRevisions".equals(fieldName)) { + List meshRevisions = reader.readArray(reader1 -> MeshRevision.fromJson(reader1)); + deserializedMeshRevisionProfileProperties.meshRevisions = meshRevisions; + } else { + reader.skipChildren(); + } + } + + return deserializedMeshRevisionProfileProperties; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MeshUpgradeProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MeshUpgradeProfile.java new file mode 100644 index 000000000000..ff29e39dcacb --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MeshUpgradeProfile.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.containerservice.generated.fluent.models.MeshUpgradeProfileInner; + +/** + * An immutable client-side representation of MeshUpgradeProfile. + */ +public interface MeshUpgradeProfile { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: Mesh upgrade profile properties for a major.minor release. + * + * @return the properties value. + */ + MeshUpgradeProfileProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.containerservice.generated.fluent.models.MeshUpgradeProfileInner object. + * + * @return the inner object. + */ + MeshUpgradeProfileInner innerModel(); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MeshUpgradeProfileProperties.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MeshUpgradeProfileProperties.java new file mode 100644 index 000000000000..3b5eac3fd3c2 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MeshUpgradeProfileProperties.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Mesh upgrade profile properties for a major.minor release. + */ +@Immutable +public final class MeshUpgradeProfileProperties extends MeshRevision { + /* + * List of items this revision of service mesh is compatible with, and their associated versions. + */ + private List compatibleWith; + + /* + * List of revisions available for upgrade of a specific mesh revision + */ + private List upgrades; + + /* + * The revision of the mesh release. + */ + private String revision; + + /** + * Creates an instance of MeshUpgradeProfileProperties class. + */ + private MeshUpgradeProfileProperties() { + } + + /** + * Get the compatibleWith property: List of items this revision of service mesh is compatible with, and their + * associated versions. + * + * @return the compatibleWith value. + */ + @Override + public List compatibleWith() { + return this.compatibleWith; + } + + /** + * Get the upgrades property: List of revisions available for upgrade of a specific mesh revision. + * + * @return the upgrades value. + */ + @Override + public List upgrades() { + return this.upgrades; + } + + /** + * Get the revision property: The revision of the mesh release. + * + * @return the revision value. + */ + @Override + public String revision() { + return this.revision; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("revision", revision()); + jsonWriter.writeArrayField("upgrades", upgrades(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("compatibleWith", compatibleWith(), (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MeshUpgradeProfileProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MeshUpgradeProfileProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MeshUpgradeProfileProperties. + */ + public static MeshUpgradeProfileProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MeshUpgradeProfileProperties deserializedMeshUpgradeProfileProperties = new MeshUpgradeProfileProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("revision".equals(fieldName)) { + deserializedMeshUpgradeProfileProperties.revision = reader.getString(); + } else if ("upgrades".equals(fieldName)) { + List upgrades = reader.readArray(reader1 -> reader1.getString()); + deserializedMeshUpgradeProfileProperties.upgrades = upgrades; + } else if ("compatibleWith".equals(fieldName)) { + List compatibleWith + = reader.readArray(reader1 -> CompatibleVersions.fromJson(reader1)); + deserializedMeshUpgradeProfileProperties.compatibleWith = compatibleWith; + } else { + reader.skipChildren(); + } + } + + return deserializedMeshUpgradeProfileProperties; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NamespaceProperties.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NamespaceProperties.java new file mode 100644 index 000000000000..8f0d19e28c3a --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NamespaceProperties.java @@ -0,0 +1,285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Properties of a namespace managed by ARM. + */ +@Fluent +public final class NamespaceProperties implements JsonSerializable { + /* + * The current provisioning state of the namespace. + */ + private NamespaceProvisioningState provisioningState; + + /* + * The labels of managed namespace. + */ + private Map labels; + + /* + * The annotations of managed namespace. + */ + private Map annotations; + + /* + * The special FQDN used by the Azure Portal to access the Managed Cluster. This FQDN is for use only by the Azure + * Portal and should not be used by other clients. 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. + */ + private String portalFqdn; + + /* + * The default resource quota enforced upon the namespace. Customers can have other Kubernetes resource quota + * objects under the namespace. Resource quotas are additive; if multiple resource quotas are applied to a given + * namespace, then the effective limit will be one such that all quotas on the namespace can be satisfied. + */ + private ResourceQuota defaultResourceQuota; + + /* + * The default network policy enforced upon the namespace. Customers can have other Kubernetes network policy + * objects under the namespace. Network policies are additive; if a policy or policies apply to a given pod for a + * given direction, the connections allowed in that direction for the pod is the union of what all applicable + * policies allow. + */ + private NetworkPolicies defaultNetworkPolicy; + + /* + * Action if Kubernetes namespace with same name already exists. + */ + private AdoptionPolicy adoptionPolicy; + + /* + * Delete options of a namespace. + */ + private DeletePolicy deletePolicy; + + /** + * Creates an instance of NamespaceProperties class. + */ + public NamespaceProperties() { + } + + /** + * Get the provisioningState property: The current provisioning state of the namespace. + * + * @return the provisioningState value. + */ + public NamespaceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the labels property: The labels of managed namespace. + * + * @return the labels value. + */ + public Map labels() { + return this.labels; + } + + /** + * Set the labels property: The labels of managed namespace. + * + * @param labels the labels value to set. + * @return the NamespaceProperties object itself. + */ + public NamespaceProperties withLabels(Map labels) { + this.labels = labels; + return this; + } + + /** + * Get the annotations property: The annotations of managed namespace. + * + * @return the annotations value. + */ + public Map annotations() { + return this.annotations; + } + + /** + * Set the annotations property: The annotations of managed namespace. + * + * @param annotations the annotations value to set. + * @return the NamespaceProperties object itself. + */ + public NamespaceProperties withAnnotations(Map annotations) { + this.annotations = annotations; + return this; + } + + /** + * Get the portalFqdn property: The special FQDN used by the Azure Portal to access the Managed Cluster. This FQDN + * is for use only by the Azure Portal and should not be used by other clients. 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. + * + * @return the portalFqdn value. + */ + public String portalFqdn() { + return this.portalFqdn; + } + + /** + * Get the defaultResourceQuota property: The default resource quota enforced upon the namespace. Customers can have + * other Kubernetes resource quota objects under the namespace. Resource quotas are additive; if multiple resource + * quotas are applied to a given namespace, then the effective limit will be one such that all quotas on the + * namespace can be satisfied. + * + * @return the defaultResourceQuota value. + */ + public ResourceQuota defaultResourceQuota() { + return this.defaultResourceQuota; + } + + /** + * Set the defaultResourceQuota property: The default resource quota enforced upon the namespace. Customers can have + * other Kubernetes resource quota objects under the namespace. Resource quotas are additive; if multiple resource + * quotas are applied to a given namespace, then the effective limit will be one such that all quotas on the + * namespace can be satisfied. + * + * @param defaultResourceQuota the defaultResourceQuota value to set. + * @return the NamespaceProperties object itself. + */ + public NamespaceProperties withDefaultResourceQuota(ResourceQuota defaultResourceQuota) { + this.defaultResourceQuota = defaultResourceQuota; + return this; + } + + /** + * Get the defaultNetworkPolicy property: The default network policy enforced upon the namespace. Customers can have + * other Kubernetes network policy objects under the namespace. Network policies are additive; if a policy or + * policies apply to a given pod for a given direction, the connections allowed in that direction for the pod is the + * union of what all applicable policies allow. + * + * @return the defaultNetworkPolicy value. + */ + public NetworkPolicies defaultNetworkPolicy() { + return this.defaultNetworkPolicy; + } + + /** + * Set the defaultNetworkPolicy property: The default network policy enforced upon the namespace. Customers can have + * other Kubernetes network policy objects under the namespace. Network policies are additive; if a policy or + * policies apply to a given pod for a given direction, the connections allowed in that direction for the pod is the + * union of what all applicable policies allow. + * + * @param defaultNetworkPolicy the defaultNetworkPolicy value to set. + * @return the NamespaceProperties object itself. + */ + public NamespaceProperties withDefaultNetworkPolicy(NetworkPolicies defaultNetworkPolicy) { + this.defaultNetworkPolicy = defaultNetworkPolicy; + return this; + } + + /** + * Get the adoptionPolicy property: Action if Kubernetes namespace with same name already exists. + * + * @return the adoptionPolicy value. + */ + public AdoptionPolicy adoptionPolicy() { + return this.adoptionPolicy; + } + + /** + * Set the adoptionPolicy property: Action if Kubernetes namespace with same name already exists. + * + * @param adoptionPolicy the adoptionPolicy value to set. + * @return the NamespaceProperties object itself. + */ + public NamespaceProperties withAdoptionPolicy(AdoptionPolicy adoptionPolicy) { + this.adoptionPolicy = adoptionPolicy; + return this; + } + + /** + * Get the deletePolicy property: Delete options of a namespace. + * + * @return the deletePolicy value. + */ + public DeletePolicy deletePolicy() { + return this.deletePolicy; + } + + /** + * Set the deletePolicy property: Delete options of a namespace. + * + * @param deletePolicy the deletePolicy value to set. + * @return the NamespaceProperties object itself. + */ + public NamespaceProperties withDeletePolicy(DeletePolicy deletePolicy) { + this.deletePolicy = deletePolicy; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("labels", this.labels, (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("annotations", this.annotations, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("defaultResourceQuota", this.defaultResourceQuota); + jsonWriter.writeJsonField("defaultNetworkPolicy", this.defaultNetworkPolicy); + jsonWriter.writeStringField("adoptionPolicy", + this.adoptionPolicy == null ? null : this.adoptionPolicy.toString()); + jsonWriter.writeStringField("deletePolicy", this.deletePolicy == null ? null : this.deletePolicy.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NamespaceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NamespaceProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the NamespaceProperties. + */ + public static NamespaceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NamespaceProperties deserializedNamespaceProperties = new NamespaceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedNamespaceProperties.provisioningState + = NamespaceProvisioningState.fromString(reader.getString()); + } else if ("labels".equals(fieldName)) { + Map labels = reader.readMap(reader1 -> reader1.getString()); + deserializedNamespaceProperties.labels = labels; + } else if ("annotations".equals(fieldName)) { + Map annotations = reader.readMap(reader1 -> reader1.getString()); + deserializedNamespaceProperties.annotations = annotations; + } else if ("portalFqdn".equals(fieldName)) { + deserializedNamespaceProperties.portalFqdn = reader.getString(); + } else if ("defaultResourceQuota".equals(fieldName)) { + deserializedNamespaceProperties.defaultResourceQuota = ResourceQuota.fromJson(reader); + } else if ("defaultNetworkPolicy".equals(fieldName)) { + deserializedNamespaceProperties.defaultNetworkPolicy = NetworkPolicies.fromJson(reader); + } else if ("adoptionPolicy".equals(fieldName)) { + deserializedNamespaceProperties.adoptionPolicy = AdoptionPolicy.fromString(reader.getString()); + } else if ("deletePolicy".equals(fieldName)) { + deserializedNamespaceProperties.deletePolicy = DeletePolicy.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedNamespaceProperties; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NamespaceProvisioningState.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NamespaceProvisioningState.java new file mode 100644 index 000000000000..497c253e0505 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NamespaceProvisioningState.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The current provisioning state of the namespace. + */ +public final class NamespaceProvisioningState extends ExpandableStringEnum { + /** + * The namespace is being updated. + */ + public static final NamespaceProvisioningState UPDATING = fromString("Updating"); + + /** + * The namespace is being deleted. + */ + public static final NamespaceProvisioningState DELETING = fromString("Deleting"); + + /** + * The namespace is being created. + */ + public static final NamespaceProvisioningState CREATING = fromString("Creating"); + + /** + * The namespace provisioning succeeded. + */ + public static final NamespaceProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * The namespace provisioning failed. + */ + public static final NamespaceProvisioningState FAILED = fromString("Failed"); + + /** + * The namespace provisioning was canceled. + */ + public static final NamespaceProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of NamespaceProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NamespaceProvisioningState() { + } + + /** + * Creates or finds a NamespaceProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding NamespaceProvisioningState. + */ + public static NamespaceProvisioningState fromString(String name) { + return fromString(name, NamespaceProvisioningState.class); + } + + /** + * Gets known NamespaceProvisioningState values. + * + * @return known NamespaceProvisioningState values. + */ + public static Collection values() { + return values(NamespaceProvisioningState.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NetworkDataplane.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NetworkDataplane.java new file mode 100644 index 000000000000..012fec280e90 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NetworkDataplane.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Network dataplane used in the Kubernetes cluster. + */ +public final class NetworkDataplane extends ExpandableStringEnum { + /** + * Use Azure network dataplane. + */ + public static final NetworkDataplane AZURE = fromString("azure"); + + /** + * 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 final NetworkDataplane CILIUM = fromString("cilium"); + + /** + * Creates a new instance of NetworkDataplane value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NetworkDataplane() { + } + + /** + * Creates or finds a NetworkDataplane from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkDataplane. + */ + public static NetworkDataplane fromString(String name) { + return fromString(name, NetworkDataplane.class); + } + + /** + * Gets known NetworkDataplane values. + * + * @return known NetworkDataplane values. + */ + public static Collection values() { + return values(NetworkDataplane.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NetworkMode.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NetworkMode.java new file mode 100644 index 000000000000..b9d7de71d67d --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NetworkMode.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The network mode Azure CNI is configured with. This cannot be specified if networkPlugin is anything other than + * 'azure'. + */ +public final class NetworkMode extends ExpandableStringEnum { + /** + * 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 final NetworkMode TRANSPARENT = fromString("transparent"); + + /** + * This is no longer supported. + */ + public static final NetworkMode BRIDGE = fromString("bridge"); + + /** + * Creates a new instance of NetworkMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NetworkMode() { + } + + /** + * Creates or finds a NetworkMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkMode. + */ + public static NetworkMode fromString(String name) { + return fromString(name, NetworkMode.class); + } + + /** + * Gets known NetworkMode values. + * + * @return known NetworkMode values. + */ + public static Collection values() { + return values(NetworkMode.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NetworkPlugin.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NetworkPlugin.java new file mode 100644 index 000000000000..c7135b6efafc --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NetworkPlugin.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Network plugin used for building the Kubernetes network. + */ +public final class NetworkPlugin extends ExpandableStringEnum { + /** + * 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 final NetworkPlugin AZURE = fromString("azure"); + + /** + * 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 final NetworkPlugin KUBENET = fromString("kubenet"); + + /** + * 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 final NetworkPlugin NONE = fromString("none"); + + /** + * Creates a new instance of NetworkPlugin value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NetworkPlugin() { + } + + /** + * Creates or finds a NetworkPlugin from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkPlugin. + */ + public static NetworkPlugin fromString(String name) { + return fromString(name, NetworkPlugin.class); + } + + /** + * Gets known NetworkPlugin values. + * + * @return known NetworkPlugin values. + */ + public static Collection values() { + return values(NetworkPlugin.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NetworkPluginMode.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NetworkPluginMode.java new file mode 100644 index 000000000000..ef5cf7864d04 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NetworkPluginMode.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The mode the network plugin should use. + */ +public final class NetworkPluginMode extends ExpandableStringEnum { + /** + * 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 final NetworkPluginMode OVERLAY = fromString("overlay"); + + /** + * Creates a new instance of NetworkPluginMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NetworkPluginMode() { + } + + /** + * Creates or finds a NetworkPluginMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkPluginMode. + */ + public static NetworkPluginMode fromString(String name) { + return fromString(name, NetworkPluginMode.class); + } + + /** + * Gets known NetworkPluginMode values. + * + * @return known NetworkPluginMode values. + */ + public static Collection values() { + return values(NetworkPluginMode.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NetworkPolicies.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NetworkPolicies.java new file mode 100644 index 000000000000..47d5c4f1c97b --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NetworkPolicies.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Default network policy of the namespace, specifying ingress and egress rules. + */ +@Fluent +public final class NetworkPolicies implements JsonSerializable { + /* + * Enum representing different network policy rules. + */ + private PolicyRule ingress; + + /* + * Enum representing different network policy rules. + */ + private PolicyRule egress; + + /** + * Creates an instance of NetworkPolicies class. + */ + public NetworkPolicies() { + } + + /** + * Get the ingress property: Enum representing different network policy rules. + * + * @return the ingress value. + */ + public PolicyRule ingress() { + return this.ingress; + } + + /** + * Set the ingress property: Enum representing different network policy rules. + * + * @param ingress the ingress value to set. + * @return the NetworkPolicies object itself. + */ + public NetworkPolicies withIngress(PolicyRule ingress) { + this.ingress = ingress; + return this; + } + + /** + * Get the egress property: Enum representing different network policy rules. + * + * @return the egress value. + */ + public PolicyRule egress() { + return this.egress; + } + + /** + * Set the egress property: Enum representing different network policy rules. + * + * @param egress the egress value to set. + * @return the NetworkPolicies object itself. + */ + public NetworkPolicies withEgress(PolicyRule egress) { + this.egress = egress; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ingress", this.ingress == null ? null : this.ingress.toString()); + jsonWriter.writeStringField("egress", this.egress == null ? null : this.egress.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkPolicies from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkPolicies if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkPolicies. + */ + public static NetworkPolicies fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkPolicies deserializedNetworkPolicies = new NetworkPolicies(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ingress".equals(fieldName)) { + deserializedNetworkPolicies.ingress = PolicyRule.fromString(reader.getString()); + } else if ("egress".equals(fieldName)) { + deserializedNetworkPolicies.egress = PolicyRule.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkPolicies; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NetworkPolicy.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NetworkPolicy.java new file mode 100644 index 000000000000..f23b451d2362 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NetworkPolicy.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Network policy used for building the Kubernetes network. + */ +public final class NetworkPolicy extends ExpandableStringEnum { + /** + * Network policies will not be enforced. This is the default value when NetworkPolicy is not specified. + */ + public static final NetworkPolicy NONE = fromString("none"); + + /** + * 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 final NetworkPolicy CALICO = fromString("calico"); + + /** + * 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 final NetworkPolicy AZURE = fromString("azure"); + + /** + * Use Cilium to enforce network policies. This requires networkDataplane to be 'cilium'. + */ + public static final NetworkPolicy CILIUM = fromString("cilium"); + + /** + * Creates a new instance of NetworkPolicy value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NetworkPolicy() { + } + + /** + * Creates or finds a NetworkPolicy from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkPolicy. + */ + public static NetworkPolicy fromString(String name) { + return fromString(name, NetworkPolicy.class); + } + + /** + * Gets known NetworkPolicy values. + * + * @return known NetworkPolicy values. + */ + public static Collection values() { + return values(NetworkPolicy.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NginxIngressControllerType.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NginxIngressControllerType.java new file mode 100644 index 000000000000..80f00a56e518 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NginxIngressControllerType.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Ingress type for the default NginxIngressController custom resource. + */ +public final class NginxIngressControllerType extends ExpandableStringEnum { + /** + * The default NginxIngressController will be created. Users can edit the default NginxIngressController Custom + * Resource to configure load balancer annotations. + */ + public static final NginxIngressControllerType ANNOTATION_CONTROLLED = fromString("AnnotationControlled"); + + /** + * The default NginxIngressController will be created and the operator will provision an external loadbalancer with + * it. Any annotation to make the default loadbalancer internal will be overwritten. + */ + public static final NginxIngressControllerType EXTERNAL = fromString("External"); + + /** + * The default NginxIngressController will be created and the operator will provision an internal loadbalancer with + * it. Any annotation to make the default loadbalancer external will be overwritten. + */ + public static final NginxIngressControllerType INTERNAL = fromString("Internal"); + + /** + * The default Ingress Controller will not be created. It will not be deleted by the system if it exists. Users + * should delete the default NginxIngressController Custom Resource manually if desired. + */ + public static final NginxIngressControllerType NONE = fromString("None"); + + /** + * Creates a new instance of NginxIngressControllerType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NginxIngressControllerType() { + } + + /** + * Creates or finds a NginxIngressControllerType from its string representation. + * + * @param name a name to look for. + * @return the corresponding NginxIngressControllerType. + */ + public static NginxIngressControllerType fromString(String name) { + return fromString(name, NginxIngressControllerType.class); + } + + /** + * Gets known NginxIngressControllerType values. + * + * @return known NginxIngressControllerType values. + */ + public static Collection values() { + return values(NginxIngressControllerType.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NodeOSUpgradeChannel.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NodeOSUpgradeChannel.java new file mode 100644 index 000000000000..3c34c6b176cf --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NodeOSUpgradeChannel.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Node OS Upgrade Channel. Manner in which the OS on your nodes is updated. The default is NodeImage. + */ +public final class NodeOSUpgradeChannel extends ExpandableStringEnum { + /** + * 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 final NodeOSUpgradeChannel NONE = fromString("None"); + + /** + * 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 final NodeOSUpgradeChannel UNMANAGED = fromString("Unmanaged"); + + /** + * 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 final NodeOSUpgradeChannel NODE_IMAGE = fromString("NodeImage"); + + /** + * AKS downloads and updates the nodes with tested security updates. These updates honor the maintenance window + * settings and produce a new VHD that is used on new nodes. On some occasions it's not possible to apply the + * updates in place, in such cases the existing nodes will also be re-imaged to the newly produced VHD in order to + * apply the changes. This option incurs an extra cost of hosting the new Security Patch VHDs in your resource group + * for just in time consumption. + */ + public static final NodeOSUpgradeChannel SECURITY_PATCH = fromString("SecurityPatch"); + + /** + * Creates a new instance of NodeOSUpgradeChannel value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NodeOSUpgradeChannel() { + } + + /** + * Creates or finds a NodeOSUpgradeChannel from its string representation. + * + * @param name a name to look for. + * @return the corresponding NodeOSUpgradeChannel. + */ + public static NodeOSUpgradeChannel fromString(String name) { + return fromString(name, NodeOSUpgradeChannel.class); + } + + /** + * Gets known NodeOSUpgradeChannel values. + * + * @return known NodeOSUpgradeChannel values. + */ + public static Collection values() { + return values(NodeOSUpgradeChannel.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NodeProvisioningDefaultNodePools.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NodeProvisioningDefaultNodePools.java new file mode 100644 index 000000000000..ca84f8592c29 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NodeProvisioningDefaultNodePools.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The set of default Karpenter NodePools (CRDs) configured for node provisioning. This field has no effect unless mode + * is 'Auto'. Warning: Changing this from Auto to None on an existing cluster will cause the default Karpenter NodePools + * to be deleted, which will drain and delete the nodes associated with those pools. It is strongly recommended to not + * do this unless there are idle nodes ready to take the pods evicted by that action. If not specified, the default is + * Auto. For more information see aka.ms/aks/nap#node-pools. + */ +public final class NodeProvisioningDefaultNodePools extends ExpandableStringEnum { + /** + * No Karpenter NodePools are provisioned automatically. Automatic scaling will not happen unless the user creates + * one or more NodePool CRD instances. + */ + public static final NodeProvisioningDefaultNodePools NONE = fromString("None"); + + /** + * A standard set of Karpenter NodePools are provisioned. + */ + public static final NodeProvisioningDefaultNodePools AUTO = fromString("Auto"); + + /** + * Creates a new instance of NodeProvisioningDefaultNodePools value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NodeProvisioningDefaultNodePools() { + } + + /** + * Creates or finds a NodeProvisioningDefaultNodePools from its string representation. + * + * @param name a name to look for. + * @return the corresponding NodeProvisioningDefaultNodePools. + */ + public static NodeProvisioningDefaultNodePools fromString(String name) { + return fromString(name, NodeProvisioningDefaultNodePools.class); + } + + /** + * Gets known NodeProvisioningDefaultNodePools values. + * + * @return known NodeProvisioningDefaultNodePools values. + */ + public static Collection values() { + return values(NodeProvisioningDefaultNodePools.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NodeProvisioningMode.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NodeProvisioningMode.java new file mode 100644 index 000000000000..6d94ab09b31f --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NodeProvisioningMode.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The node provisioning mode. If not specified, the default is Manual. + */ +public final class NodeProvisioningMode extends ExpandableStringEnum { + /** + * Nodes are provisioned manually by the user. + */ + public static final NodeProvisioningMode MANUAL = fromString("Manual"); + + /** + * Nodes are provisioned automatically by AKS using Karpenter (See aka.ms/aks/nap for more details). Fixed size Node + * Pools can still be created, but autoscaling Node Pools cannot be. (See aka.ms/aks/nap for more details). + */ + public static final NodeProvisioningMode AUTO = fromString("Auto"); + + /** + * Creates a new instance of NodeProvisioningMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NodeProvisioningMode() { + } + + /** + * Creates or finds a NodeProvisioningMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding NodeProvisioningMode. + */ + public static NodeProvisioningMode fromString(String name) { + return fromString(name, NodeProvisioningMode.class); + } + + /** + * Gets known NodeProvisioningMode values. + * + * @return known NodeProvisioningMode values. + */ + public static Collection values() { + return values(NodeProvisioningMode.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OSDiskType.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OSDiskType.java new file mode 100644 index 000000000000..27dd29ec3544 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OSDiskType.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The OS disk type to be used for machines in the agent pool. 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 final class OSDiskType extends ExpandableStringEnum { + /** + * 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 final OSDiskType MANAGED = fromString("Managed"); + + /** + * 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 final OSDiskType EPHEMERAL = fromString("Ephemeral"); + + /** + * Creates a new instance of OSDiskType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OSDiskType() { + } + + /** + * Creates or finds a OSDiskType from its string representation. + * + * @param name a name to look for. + * @return the corresponding OSDiskType. + */ + public static OSDiskType fromString(String name) { + return fromString(name, OSDiskType.class); + } + + /** + * Gets known OSDiskType values. + * + * @return known OSDiskType values. + */ + public static Collection values() { + return values(OSDiskType.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OSSKU.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OSSKU.java new file mode 100644 index 000000000000..c07b33e3a07d --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OSSKU.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * 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 final class OSSKU extends ExpandableStringEnum { + /** + * Use Ubuntu as the OS for node images. + */ + public static final OSSKU UBUNTU = fromString("Ubuntu"); + + /** + * 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 final OSSKU AZURE_LINUX = fromString("AzureLinux"); + + /** + * Use AzureLinux3 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. For limitations, visit https://aka.ms/aks/node-images. For + * OS migration guidance, see https://aka.ms/aks/upgrade-os-version. + */ + public static final OSSKU AZURE_LINUX3 = fromString("AzureLinux3"); + + /** + * Deprecated OSSKU. Microsoft recommends that new deployments choose 'AzureLinux' instead. + */ + public static final OSSKU CBLMARINER = fromString("CBLMariner"); + + /** + * 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 final OSSKU WINDOWS2019 = fromString("Windows2019"); + + /** + * 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 final OSSKU WINDOWS2022 = fromString("Windows2022"); + + /** + * Use Ubuntu2204 as the OS for node images, however, Ubuntu 22.04 may not be supported for all nodepools. For + * limitations and supported kubernetes versions, see https://aka.ms/aks/supported-ubuntu-versions. + */ + public static final OSSKU UBUNTU2204 = fromString("Ubuntu2204"); + + /** + * Use Ubuntu2404 as the OS for node images, however, Ubuntu 24.04 may not be supported for all nodepools. For + * limitations and supported kubernetes versions, see see https://aka.ms/aks/supported-ubuntu-versions. + */ + public static final OSSKU UBUNTU2404 = fromString("Ubuntu2404"); + + /** + * Creates a new instance of OSSKU value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OSSKU() { + } + + /** + * Creates or finds a OSSKU from its string representation. + * + * @param name a name to look for. + * @return the corresponding OSSKU. + */ + public static OSSKU fromString(String name) { + return fromString(name, OSSKU.class); + } + + /** + * Gets known OSSKU values. + * + * @return known OSSKU values. + */ + public static Collection values() { + return values(OSSKU.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OSType.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OSType.java new file mode 100644 index 000000000000..dead9be0f776 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OSType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The operating system type. The default is Linux. + */ +public final class OSType extends ExpandableStringEnum { + /** + * Use Linux. + */ + public static final OSType LINUX = fromString("Linux"); + + /** + * Use Windows. + */ + public static final OSType WINDOWS = fromString("Windows"); + + /** + * Creates a new instance of OSType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OSType() { + } + + /** + * Creates or finds a OSType from its string representation. + * + * @param name a name to look for. + * @return the corresponding OSType. + */ + public static OSType fromString(String name) { + return fromString(name, OSType.class); + } + + /** + * Gets known OSType values. + * + * @return known OSType values. + */ + public static Collection values() { + return values(OSType.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OperationValue.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OperationValue.java new file mode 100644 index 000000000000..79585502cd41 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OperationValue.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.OperationValueInner; + +/** + * An immutable client-side representation of OperationValue. + */ +public interface OperationValue { + /** + * Gets the origin property: The origin of the operation. + * + * @return the origin value. + */ + String origin(); + + /** + * Gets the name property: The name of the operation. + * + * @return the name value. + */ + String name(); + + /** + * Gets the operation property: The display name of the operation. + * + * @return the operation value. + */ + String operation(); + + /** + * Gets the resource property: The display name of the resource the operation applies to. + * + * @return the resource value. + */ + String resource(); + + /** + * Gets the description property: The description of the operation. + * + * @return the description value. + */ + String description(); + + /** + * Gets the provider property: The resource provider for the operation. + * + * @return the provider value. + */ + String provider(); + + /** + * Gets the inner com.azure.resourcemanager.containerservice.generated.fluent.models.OperationValueInner object. + * + * @return the inner object. + */ + OperationValueInner innerModel(); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Operations.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Operations.java new file mode 100644 index 000000000000..3bbb4f5fbf6b --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Operations.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of Operations. + */ +public interface Operations { + /** + * Gets a list of operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of operations as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Gets a list of operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of operations as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OutboundEnvironmentEndpoint.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OutboundEnvironmentEndpoint.java new file mode 100644 index 000000000000..f3c314f58fed --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OutboundEnvironmentEndpoint.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.OutboundEnvironmentEndpointInner; +import java.util.List; + +/** + * An immutable client-side representation of OutboundEnvironmentEndpoint. + */ +public interface OutboundEnvironmentEndpoint { + /** + * Gets the category property: The category of endpoints accessed by the AKS agent node, e.g. + * azure-resource-management, apiserver, etc. + * + * @return the category value. + */ + String category(); + + /** + * Gets the endpoints property: The endpoints that AKS agent nodes connect to. + * + * @return the endpoints value. + */ + List endpoints(); + + /** + * Gets the inner + * com.azure.resourcemanager.containerservice.generated.fluent.models.OutboundEnvironmentEndpointInner object. + * + * @return the inner object. + */ + OutboundEnvironmentEndpointInner innerModel(); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OutboundType.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OutboundType.java new file mode 100644 index 000000000000..8df9ee038ece --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OutboundType.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The outbound (egress) routing method. 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 final class OutboundType extends ExpandableStringEnum { + /** + * 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 final OutboundType LOAD_BALANCER = fromString("loadBalancer"); + + /** + * 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 final OutboundType USER_DEFINED_ROUTING = fromString("userDefinedRouting"); + + /** + * The AKS-managed NAT gateway is used for egress. + */ + public static final OutboundType MANAGED_NATGATEWAY = fromString("managedNATGateway"); + + /** + * 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 final OutboundType USER_ASSIGNED_NATGATEWAY = fromString("userAssignedNATGateway"); + + /** + * The AKS cluster is not set with any outbound-type. All AKS nodes follows Azure VM default outbound behavior. + * Please refer to + * https://azure.microsoft.com/en-us/updates/default-outbound-access-for-vms-in-azure-will-be-retired-transition-to-a-new-method-of-internet-access/. + */ + public static final OutboundType NONE = fromString("none"); + + /** + * Creates a new instance of OutboundType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OutboundType() { + } + + /** + * Creates or finds a OutboundType from its string representation. + * + * @param name a name to look for. + * @return the corresponding OutboundType. + */ + public static OutboundType fromString(String name) { + return fromString(name, OutboundType.class); + } + + /** + * Gets known OutboundType values. + * + * @return known OutboundType values. + */ + public static Collection values() { + return values(OutboundType.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PodIPAllocationMode.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PodIPAllocationMode.java new file mode 100644 index 000000000000..bbc554d9d6b8 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PodIPAllocationMode.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Pod IP Allocation Mode. The IP allocation mode for pods in the agent pool. Must be used with podSubnetId. The default + * is 'DynamicIndividual'. + */ +public final class PodIPAllocationMode extends ExpandableStringEnum { + /** + * Each node gets allocated with a non-contiguous list of IP addresses assignable to pods. This is better for + * maximizing a small to medium subnet of size /16 or smaller. The Azure CNI cluster with dynamic IP allocation + * defaults to this mode if the customer does not explicitly specify a podIPAllocationMode. + */ + public static final PodIPAllocationMode DYNAMIC_INDIVIDUAL = fromString("DynamicIndividual"); + + /** + * Each node is statically allocated CIDR block(s) of size /28 = 16 IPs per block to satisfy the maxPods per node. + * Number of CIDR blocks >= (maxPods / 16). The block, rather than a single IP, counts against the Azure Vnet + * Private IP limit of 65K. Therefore block mode is suitable for running larger workloads with more than the current + * limit of 65K pods in a cluster. This mode is better suited to scale with larger subnets of /15 or bigger. + */ + public static final PodIPAllocationMode STATIC_BLOCK = fromString("StaticBlock"); + + /** + * Creates a new instance of PodIPAllocationMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PodIPAllocationMode() { + } + + /** + * Creates or finds a PodIPAllocationMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding PodIPAllocationMode. + */ + public static PodIPAllocationMode fromString(String name) { + return fromString(name, PodIPAllocationMode.class); + } + + /** + * Gets known PodIPAllocationMode values. + * + * @return known PodIPAllocationMode values. + */ + public static Collection values() { + return values(PodIPAllocationMode.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PolicyRule.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PolicyRule.java new file mode 100644 index 000000000000..361b6a68cf7b --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PolicyRule.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enum representing different network policy rules. + */ +public final class PolicyRule extends ExpandableStringEnum { + /** + * Deny all network traffic. + */ + public static final PolicyRule DENY_ALL = fromString("DenyAll"); + + /** + * Allow all network traffic. + */ + public static final PolicyRule ALLOW_ALL = fromString("AllowAll"); + + /** + * Allow traffic within the same namespace. + */ + public static final PolicyRule ALLOW_SAME_NAMESPACE = fromString("AllowSameNamespace"); + + /** + * Creates a new instance of PolicyRule value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PolicyRule() { + } + + /** + * Creates or finds a PolicyRule from its string representation. + * + * @param name a name to look for. + * @return the corresponding PolicyRule. + */ + public static PolicyRule fromString(String name) { + return fromString(name, PolicyRule.class); + } + + /** + * Gets known PolicyRule values. + * + * @return known PolicyRule values. + */ + public static Collection values() { + return values(PolicyRule.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PortRange.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PortRange.java new file mode 100644 index 000000000000..642b12d075ce --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PortRange.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The port range. + */ +@Fluent +public final class PortRange implements JsonSerializable { + /* + * 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. + */ + private Integer portStart; + + /* + * 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. + */ + private Integer portEnd; + + /* + * The network protocol of the port. + */ + private Protocol protocol; + + /** + * Creates an instance of PortRange class. + */ + public PortRange() { + } + + /** + * Get the portStart property: 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. + * + * @return the portStart value. + */ + public Integer portStart() { + return this.portStart; + } + + /** + * Set the portStart property: 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. + * + * @param portStart the portStart value to set. + * @return the PortRange object itself. + */ + public PortRange withPortStart(Integer portStart) { + this.portStart = portStart; + return this; + } + + /** + * Get the portEnd property: 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. + * + * @return the portEnd value. + */ + public Integer portEnd() { + return this.portEnd; + } + + /** + * Set the portEnd property: 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. + * + * @param portEnd the portEnd value to set. + * @return the PortRange object itself. + */ + public PortRange withPortEnd(Integer portEnd) { + this.portEnd = portEnd; + return this; + } + + /** + * Get the protocol property: The network protocol of the port. + * + * @return the protocol value. + */ + public Protocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: The network protocol of the port. + * + * @param protocol the protocol value to set. + * @return the PortRange object itself. + */ + public PortRange withProtocol(Protocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("portStart", this.portStart); + jsonWriter.writeNumberField("portEnd", this.portEnd); + jsonWriter.writeStringField("protocol", this.protocol == null ? null : this.protocol.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PortRange from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PortRange if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the PortRange. + */ + public static PortRange fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PortRange deserializedPortRange = new PortRange(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("portStart".equals(fieldName)) { + deserializedPortRange.portStart = reader.getNullable(JsonReader::getInt); + } else if ("portEnd".equals(fieldName)) { + deserializedPortRange.portEnd = reader.getNullable(JsonReader::getInt); + } else if ("protocol".equals(fieldName)) { + deserializedPortRange.protocol = Protocol.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPortRange; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PowerState.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PowerState.java new file mode 100644 index 000000000000..c5bbd828b834 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PowerState.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes the Power State of the cluster. + */ +@Fluent +public final class PowerState implements JsonSerializable { + /* + * Tells whether the cluster is Running or Stopped + */ + private Code code; + + /** + * Creates an instance of PowerState class. + */ + public PowerState() { + } + + /** + * Get the code property: Tells whether the cluster is Running or Stopped. + * + * @return the code value. + */ + public Code code() { + return this.code; + } + + /** + * Set the code property: Tells whether the cluster is Running or Stopped. + * + * @param code the code value to set. + * @return the PowerState object itself. + */ + public PowerState withCode(Code code) { + this.code = code; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("code", this.code == null ? null : this.code.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PowerState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PowerState if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the PowerState. + */ + public static PowerState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PowerState deserializedPowerState = new PowerState(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + deserializedPowerState.code = Code.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPowerState; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateEndpoint.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateEndpoint.java new file mode 100644 index 000000000000..fa9cb6fb52db --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateEndpoint.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Private endpoint which a connection belongs to. + */ +@Fluent +public final class PrivateEndpoint implements JsonSerializable { + /* + * The resource ID of the private endpoint + */ + private String id; + + /** + * Creates an instance of PrivateEndpoint class. + */ + public PrivateEndpoint() { + } + + /** + * Get the id property: The resource ID of the private endpoint. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The resource ID of the private endpoint. + * + * @param id the id value to set. + * @return the PrivateEndpoint object itself. + */ + public PrivateEndpoint withId(String id) { + this.id = id; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpoint from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpoint if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateEndpoint. + */ + public static PrivateEndpoint fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpoint deserializedPrivateEndpoint = new PrivateEndpoint(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateEndpoint.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpoint; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateEndpointConnection.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateEndpointConnection.java new file mode 100644 index 000000000000..8edb1cc4d2d3 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateEndpointConnection.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateEndpointConnectionInner; + +/** + * An immutable client-side representation of PrivateEndpointConnection. + */ +public interface PrivateEndpointConnection { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: The current provisioning state. + * + * @return the provisioningState value. + */ + PrivateEndpointConnectionProvisioningState provisioningState(); + + /** + * Gets the privateEndpoint property: The resource of private endpoint. + * + * @return the privateEndpoint value. + */ + PrivateEndpoint privateEndpoint(); + + /** + * Gets the privateLinkServiceConnectionState property: A collection of information about the state of the + * connection between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + PrivateLinkServiceConnectionState privateLinkServiceConnectionState(); + + /** + * Gets the inner com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateEndpointConnectionInner + * object. + * + * @return the inner object. + */ + PrivateEndpointConnectionInner innerModel(); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateEndpointConnectionListResult.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateEndpointConnectionListResult.java new file mode 100644 index 000000000000..4e87481fda4e --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateEndpointConnectionListResult.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateEndpointConnectionListResultInner; +import java.util.List; + +/** + * An immutable client-side representation of PrivateEndpointConnectionListResult. + */ +public interface PrivateEndpointConnectionListResult { + /** + * Gets the value property: The collection value. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner + * com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateEndpointConnectionListResultInner + * object. + * + * @return the inner object. + */ + PrivateEndpointConnectionListResultInner innerModel(); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateEndpointConnectionProvisioningState.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateEndpointConnectionProvisioningState.java new file mode 100644 index 000000000000..2075e0e685c3 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateEndpointConnectionProvisioningState.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The current provisioning state. + */ +public final class PrivateEndpointConnectionProvisioningState + extends ExpandableStringEnum { + /** + * Private endpoint connection provisioning was canceled. + */ + public static final PrivateEndpointConnectionProvisioningState CANCELED = fromString("Canceled"); + + /** + * Private endpoint connection is being created. + */ + public static final PrivateEndpointConnectionProvisioningState CREATING = fromString("Creating"); + + /** + * Private endpoint connection is being deleted. + */ + public static final PrivateEndpointConnectionProvisioningState DELETING = fromString("Deleting"); + + /** + * Private endpoint connection provisioning failed. + */ + public static final PrivateEndpointConnectionProvisioningState FAILED = fromString("Failed"); + + /** + * Private endpoint connection provisioning succeeded. + */ + public static final PrivateEndpointConnectionProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Creates a new instance of PrivateEndpointConnectionProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PrivateEndpointConnectionProvisioningState() { + } + + /** + * Creates or finds a PrivateEndpointConnectionProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateEndpointConnectionProvisioningState. + */ + public static PrivateEndpointConnectionProvisioningState fromString(String name) { + return fromString(name, PrivateEndpointConnectionProvisioningState.class); + } + + /** + * Gets known PrivateEndpointConnectionProvisioningState values. + * + * @return known PrivateEndpointConnectionProvisioningState values. + */ + public static Collection values() { + return values(PrivateEndpointConnectionProvisioningState.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateEndpointConnections.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateEndpointConnections.java new file mode 100644 index 000000000000..1fdf96c30039 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateEndpointConnections.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateEndpointConnectionInner; + +/** + * Resource collection API of PrivateEndpointConnections. + */ +public interface PrivateEndpointConnections { + /** + * Gets the specified private endpoint connection. + * + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection. + * + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters along with + * {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String resourceName, + String privateEndpointConnectionName, Context context); + + /** + * Gets the specified private endpoint connection. + * + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection. + * + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + */ + PrivateEndpointConnection get(String resourceGroupName, String resourceName, String privateEndpointConnectionName); + + /** + * Updates a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters The updated private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection along with {@link Response}. + */ + Response updateWithResponse(String resourceGroupName, String resourceName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters, Context context); + + /** + * Updates a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters The updated private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + PrivateEndpointConnection update(String resourceGroupName, String resourceName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters); + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String resourceName, String privateEndpointConnectionName); + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context); + + /** + * Gets a list of private endpoint connections in the specified managed cluster. + * + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private endpoint connections in the specified managed cluster. + * + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters along with + * {@link Response}. + */ + Response listWithResponse(String resourceGroupName, String resourceName, + Context context); + + /** + * Gets a list of private endpoint connections in the specified managed cluster. + * + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private endpoint connections in the specified managed cluster. + * + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + */ + PrivateEndpointConnectionListResult list(String resourceGroupName, String resourceName); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateLinkResource.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateLinkResource.java new file mode 100644 index 000000000000..03c98045bb34 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateLinkResource.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateLinkResourceInner; +import java.util.List; + +/** + * An immutable client-side representation of PrivateLinkResource. + */ +public interface PrivateLinkResource { + /** + * Gets the id property: The ID of the private link resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the private link resource. See [naming + * rules](https://aka.ms/search-naming-rules) for more details. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the groupId property: The group ID of the resource. + * + * @return the groupId value. + */ + String groupId(); + + /** + * Gets the requiredMembers property: The RequiredMembers of the resource. + * + * @return the requiredMembers value. + */ + List requiredMembers(); + + /** + * Gets the privateLinkServiceID property: The private link service ID of the resource, this field is exposed only + * to NRP internally. + * + * @return the privateLinkServiceID value. + */ + String privateLinkServiceID(); + + /** + * Gets the inner com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateLinkResourceInner + * object. + * + * @return the inner object. + */ + PrivateLinkResourceInner innerModel(); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateLinkResources.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateLinkResources.java new file mode 100644 index 000000000000..01373098046e --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateLinkResources.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of PrivateLinkResources. + */ +public interface PrivateLinkResources { + /** + * Gets a list of private link resources in the specified managed cluster. + * + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources in the specified managed cluster. + * + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters along with + * {@link Response}. + */ + Response listWithResponse(String resourceGroupName, String resourceName, + Context context); + + /** + * Gets a list of private link resources in the specified managed cluster. + * + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources in the specified managed cluster. + * + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + */ + PrivateLinkResourcesListResult list(String resourceGroupName, String resourceName); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateLinkResourcesListResult.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateLinkResourcesListResult.java new file mode 100644 index 000000000000..9e458c140ee8 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateLinkResourcesListResult.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateLinkResourcesListResultInner; +import java.util.List; + +/** + * An immutable client-side representation of PrivateLinkResourcesListResult. + */ +public interface PrivateLinkResourcesListResult { + /** + * Gets the value property: The collection value. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner + * com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateLinkResourcesListResultInner object. + * + * @return the inner object. + */ + PrivateLinkResourcesListResultInner innerModel(); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateLinkServiceConnectionState.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateLinkServiceConnectionState.java new file mode 100644 index 000000000000..3dd10261f8bf --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateLinkServiceConnectionState.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The state of a private link service connection. + */ +@Fluent +public final class PrivateLinkServiceConnectionState implements JsonSerializable { + /* + * The private link service connection status. + */ + private ConnectionStatus status; + + /* + * The private link service connection description. + */ + private String description; + + /** + * Creates an instance of PrivateLinkServiceConnectionState class. + */ + public PrivateLinkServiceConnectionState() { + } + + /** + * Get the status property: The private link service connection status. + * + * @return the status value. + */ + public ConnectionStatus status() { + return this.status; + } + + /** + * Set the status property: The private link service connection status. + * + * @param status the status value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withStatus(ConnectionStatus status) { + this.status = status; + return this; + } + + /** + * Get the description property: The private link service connection description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The private link service connection description. + * + * @param description the description value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withDescription(String description) { + this.description = description; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkServiceConnectionState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkServiceConnectionState if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateLinkServiceConnectionState. + */ + public static PrivateLinkServiceConnectionState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkServiceConnectionState deserializedPrivateLinkServiceConnectionState + = new PrivateLinkServiceConnectionState(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionState.status + = ConnectionStatus.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionState.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkServiceConnectionState; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Protocol.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Protocol.java new file mode 100644 index 000000000000..f3cee1f445c0 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Protocol.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The network protocol of the port. + */ +public final class Protocol extends ExpandableStringEnum { + /** + * TCP protocol. + */ + public static final Protocol TCP = fromString("TCP"); + + /** + * UDP protocol. + */ + public static final Protocol UDP = fromString("UDP"); + + /** + * Creates a new instance of Protocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Protocol() { + } + + /** + * Creates or finds a Protocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding Protocol. + */ + public static Protocol fromString(String name) { + return fromString(name, Protocol.class); + } + + /** + * Gets known Protocol values. + * + * @return known Protocol values. + */ + public static Collection values() { + return values(Protocol.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ProxyRedirectionMechanism.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ProxyRedirectionMechanism.java new file mode 100644 index 000000000000..eccd3c8ff67b --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ProxyRedirectionMechanism.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Mode of traffic redirection. + */ +public final class ProxyRedirectionMechanism extends ExpandableStringEnum { + /** + * Istio will inject an init container into each pod to redirect traffic (requires NET_ADMIN and NET_RAW). + */ + public static final ProxyRedirectionMechanism INIT_CONTAINERS = fromString("InitContainers"); + + /** + * Istio will install a chained CNI plugin to redirect traffic (recommended). + */ + public static final ProxyRedirectionMechanism CNICHAINING = fromString("CNIChaining"); + + /** + * Creates a new instance of ProxyRedirectionMechanism value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProxyRedirectionMechanism() { + } + + /** + * Creates or finds a ProxyRedirectionMechanism from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProxyRedirectionMechanism. + */ + public static ProxyRedirectionMechanism fromString(String name) { + return fromString(name, ProxyRedirectionMechanism.class); + } + + /** + * Gets known ProxyRedirectionMechanism values. + * + * @return known ProxyRedirectionMechanism values. + */ + public static Collection values() { + return values(ProxyRedirectionMechanism.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PublicNetworkAccess.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PublicNetworkAccess.java new file mode 100644 index 000000000000..48793a2ad3c5 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PublicNetworkAccess.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * PublicNetworkAccess of the managedCluster. Allow or deny public network access for AKS. + */ +public final class PublicNetworkAccess extends ExpandableStringEnum { + /** + * Inbound/Outbound to the managedCluster is allowed. + */ + public static final PublicNetworkAccess ENABLED = fromString("Enabled"); + + /** + * Inbound traffic to managedCluster is disabled, traffic from managedCluster is allowed. + */ + public static final PublicNetworkAccess DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of PublicNetworkAccess value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PublicNetworkAccess() { + } + + /** + * Creates or finds a PublicNetworkAccess from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicNetworkAccess. + */ + public static PublicNetworkAccess fromString(String name) { + return fromString(name, PublicNetworkAccess.class); + } + + /** + * Gets known PublicNetworkAccess values. + * + * @return known PublicNetworkAccess values. + */ + public static Collection values() { + return values(PublicNetworkAccess.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/RelativeMonthlySchedule.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/RelativeMonthlySchedule.java new file mode 100644 index 000000000000..596fcae9ee91 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/RelativeMonthlySchedule.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * For schedules like: 'recur every month on the first Monday' or 'recur every 3 months on last Friday'. + */ +@Fluent +public final class RelativeMonthlySchedule implements JsonSerializable { + /* + * Specifies the number of months between each set of occurrences. + */ + private int intervalMonths; + + /* + * The week index. Specifies on which week of the month the dayOfWeek applies. + */ + private Type weekIndex; + + /* + * Specifies on which day of the week the maintenance occurs. + */ + private WeekDay dayOfWeek; + + /** + * Creates an instance of RelativeMonthlySchedule class. + */ + public RelativeMonthlySchedule() { + } + + /** + * Get the intervalMonths property: Specifies the number of months between each set of occurrences. + * + * @return the intervalMonths value. + */ + public int intervalMonths() { + return this.intervalMonths; + } + + /** + * Set the intervalMonths property: Specifies the number of months between each set of occurrences. + * + * @param intervalMonths the intervalMonths value to set. + * @return the RelativeMonthlySchedule object itself. + */ + public RelativeMonthlySchedule withIntervalMonths(int intervalMonths) { + this.intervalMonths = intervalMonths; + return this; + } + + /** + * Get the weekIndex property: The week index. Specifies on which week of the month the dayOfWeek applies. + * + * @return the weekIndex value. + */ + public Type weekIndex() { + return this.weekIndex; + } + + /** + * Set the weekIndex property: The week index. Specifies on which week of the month the dayOfWeek applies. + * + * @param weekIndex the weekIndex value to set. + * @return the RelativeMonthlySchedule object itself. + */ + public RelativeMonthlySchedule withWeekIndex(Type weekIndex) { + this.weekIndex = weekIndex; + return this; + } + + /** + * Get the dayOfWeek property: Specifies on which day of the week the maintenance occurs. + * + * @return the dayOfWeek value. + */ + public WeekDay dayOfWeek() { + return this.dayOfWeek; + } + + /** + * Set the dayOfWeek property: Specifies on which day of the week the maintenance occurs. + * + * @param dayOfWeek the dayOfWeek value to set. + * @return the RelativeMonthlySchedule object itself. + */ + public RelativeMonthlySchedule withDayOfWeek(WeekDay dayOfWeek) { + this.dayOfWeek = dayOfWeek; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("intervalMonths", this.intervalMonths); + jsonWriter.writeStringField("weekIndex", this.weekIndex == null ? null : this.weekIndex.toString()); + jsonWriter.writeStringField("dayOfWeek", this.dayOfWeek == null ? null : this.dayOfWeek.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RelativeMonthlySchedule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RelativeMonthlySchedule if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RelativeMonthlySchedule. + */ + public static RelativeMonthlySchedule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RelativeMonthlySchedule deserializedRelativeMonthlySchedule = new RelativeMonthlySchedule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("intervalMonths".equals(fieldName)) { + deserializedRelativeMonthlySchedule.intervalMonths = reader.getInt(); + } else if ("weekIndex".equals(fieldName)) { + deserializedRelativeMonthlySchedule.weekIndex = Type.fromString(reader.getString()); + } else if ("dayOfWeek".equals(fieldName)) { + deserializedRelativeMonthlySchedule.dayOfWeek = WeekDay.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedRelativeMonthlySchedule; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ResolvePrivateLinkServiceIds.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ResolvePrivateLinkServiceIds.java new file mode 100644 index 000000000000..785dd2a26133 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ResolvePrivateLinkServiceIds.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateLinkResourceInner; + +/** + * Resource collection API of ResolvePrivateLinkServiceIds. + */ +public interface ResolvePrivateLinkServiceIds { + /** + * Gets the private link service ID for the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters required in order to resolve a private link service ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link service ID for the specified managed cluster along with {@link Response}. + */ + Response pOSTWithResponse(String resourceGroupName, String resourceName, + PrivateLinkResourceInner parameters, Context context); + + /** + * Gets the private link service ID for the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters required in order to resolve a private link service ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link service ID for the specified managed cluster. + */ + PrivateLinkResource pOST(String resourceGroupName, String resourceName, PrivateLinkResourceInner parameters); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ResourceIdentityType.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ResourceIdentityType.java new file mode 100644 index 000000000000..e94d4b541496 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ResourceIdentityType.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The type of identity used for the managed cluster. For more information see [use managed identities in + * AKS](https://docs.microsoft.com/azure/aks/use-managed-identity). + */ +public final class ResourceIdentityType extends ExpandableStringEnum { + /** + * Use an implicitly created system assigned managed identity to manage cluster resources. Master components in the + * control plane such as kube-controller-manager will use the system assigned managed identity to manipulate Azure + * resources. + */ + public static final ResourceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** + * Use a user-specified identity to manage cluster resources. Master components in the control plane such as + * kube-controller-manager will use the specified user assigned managed identity to manipulate Azure resources. + */ + public static final ResourceIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** + * Do not use a managed identity for the Managed Cluster, service principal will be used instead. + */ + public static final ResourceIdentityType NONE = fromString("None"); + + /** + * Creates a new instance of ResourceIdentityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ResourceIdentityType() { + } + + /** + * Creates or finds a ResourceIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceIdentityType. + */ + public static ResourceIdentityType fromString(String name) { + return fromString(name, ResourceIdentityType.class); + } + + /** + * Gets known ResourceIdentityType values. + * + * @return known ResourceIdentityType values. + */ + public static Collection values() { + return values(ResourceIdentityType.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ResourceQuota.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ResourceQuota.java new file mode 100644 index 000000000000..79d1cca9e413 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ResourceQuota.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Resource quota for the namespace. + */ +@Fluent +public final class ResourceQuota implements JsonSerializable { + /* + * CPU request of the namespace in one-thousandth CPU form. See [CPU resource + * units](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu) for more + * details. + */ + private String cpuRequest; + + /* + * CPU limit of the namespace in one-thousandth CPU form. See [CPU resource + * units](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu) for more + * details. + */ + private String cpuLimit; + + /* + * Memory request of the namespace in the power-of-two equivalents form: Ei, Pi, Ti, Gi, Mi, Ki. See [Memory + * resource units](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-memory) + * for more details. + */ + private String memoryRequest; + + /* + * Memory limit of the namespace in the power-of-two equivalents form: Ei, Pi, Ti, Gi, Mi, Ki. See [Memory resource + * units](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-memory) for more + * details. + */ + private String memoryLimit; + + /** + * Creates an instance of ResourceQuota class. + */ + public ResourceQuota() { + } + + /** + * Get the cpuRequest property: CPU request of the namespace in one-thousandth CPU form. See [CPU resource + * units](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu) for more + * details. + * + * @return the cpuRequest value. + */ + public String cpuRequest() { + return this.cpuRequest; + } + + /** + * Set the cpuRequest property: CPU request of the namespace in one-thousandth CPU form. See [CPU resource + * units](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu) for more + * details. + * + * @param cpuRequest the cpuRequest value to set. + * @return the ResourceQuota object itself. + */ + public ResourceQuota withCpuRequest(String cpuRequest) { + this.cpuRequest = cpuRequest; + return this; + } + + /** + * Get the cpuLimit property: CPU limit of the namespace in one-thousandth CPU form. See [CPU resource + * units](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu) for more + * details. + * + * @return the cpuLimit value. + */ + public String cpuLimit() { + return this.cpuLimit; + } + + /** + * Set the cpuLimit property: CPU limit of the namespace in one-thousandth CPU form. See [CPU resource + * units](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu) for more + * details. + * + * @param cpuLimit the cpuLimit value to set. + * @return the ResourceQuota object itself. + */ + public ResourceQuota withCpuLimit(String cpuLimit) { + this.cpuLimit = cpuLimit; + return this; + } + + /** + * Get the memoryRequest property: Memory request of the namespace in the power-of-two equivalents form: Ei, Pi, Ti, + * Gi, Mi, Ki. See [Memory resource + * units](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-memory) for more + * details. + * + * @return the memoryRequest value. + */ + public String memoryRequest() { + return this.memoryRequest; + } + + /** + * Set the memoryRequest property: Memory request of the namespace in the power-of-two equivalents form: Ei, Pi, Ti, + * Gi, Mi, Ki. See [Memory resource + * units](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-memory) for more + * details. + * + * @param memoryRequest the memoryRequest value to set. + * @return the ResourceQuota object itself. + */ + public ResourceQuota withMemoryRequest(String memoryRequest) { + this.memoryRequest = memoryRequest; + return this; + } + + /** + * Get the memoryLimit property: Memory limit of the namespace in the power-of-two equivalents form: Ei, Pi, Ti, Gi, + * Mi, Ki. See [Memory resource + * units](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-memory) for more + * details. + * + * @return the memoryLimit value. + */ + public String memoryLimit() { + return this.memoryLimit; + } + + /** + * Set the memoryLimit property: Memory limit of the namespace in the power-of-two equivalents form: Ei, Pi, Ti, Gi, + * Mi, Ki. See [Memory resource + * units](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-memory) for more + * details. + * + * @param memoryLimit the memoryLimit value to set. + * @return the ResourceQuota object itself. + */ + public ResourceQuota withMemoryLimit(String memoryLimit) { + this.memoryLimit = memoryLimit; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("cpuRequest", this.cpuRequest); + jsonWriter.writeStringField("cpuLimit", this.cpuLimit); + jsonWriter.writeStringField("memoryRequest", this.memoryRequest); + jsonWriter.writeStringField("memoryLimit", this.memoryLimit); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceQuota from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceQuota if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourceQuota. + */ + public static ResourceQuota fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceQuota deserializedResourceQuota = new ResourceQuota(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("cpuRequest".equals(fieldName)) { + deserializedResourceQuota.cpuRequest = reader.getString(); + } else if ("cpuLimit".equals(fieldName)) { + deserializedResourceQuota.cpuLimit = reader.getString(); + } else if ("memoryRequest".equals(fieldName)) { + deserializedResourceQuota.memoryRequest = reader.getString(); + } else if ("memoryLimit".equals(fieldName)) { + deserializedResourceQuota.memoryLimit = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceQuota; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ResourceReference.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ResourceReference.java new file mode 100644 index 000000000000..01fbba4d1c32 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ResourceReference.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A reference to an Azure resource. + */ +@Fluent +public final class ResourceReference implements JsonSerializable { + /* + * The fully qualified Azure resource id. + */ + private String id; + + /** + * Creates an instance of ResourceReference class. + */ + public ResourceReference() { + } + + /** + * Get the id property: The fully qualified Azure resource id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The fully qualified Azure resource id. + * + * @param id the id value to set. + * @return the ResourceReference object itself. + */ + public ResourceReference withId(String id) { + this.id = id; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceReference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceReference if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourceReference. + */ + public static ResourceReference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceReference deserializedResourceReference = new ResourceReference(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedResourceReference.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceReference; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/RestrictionLevel.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/RestrictionLevel.java new file mode 100644 index 000000000000..c3ea80618caf --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/RestrictionLevel.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The restriction level applied to the cluster's node resource group. If not specified, the default is 'Unrestricted'. + */ +public final class RestrictionLevel extends ExpandableStringEnum { + /** + * All RBAC permissions are allowed on the managed node resource group. + */ + public static final RestrictionLevel UNRESTRICTED = fromString("Unrestricted"); + + /** + * Only \*\/read RBAC permissions allowed on the managed node resource group. + */ + public static final RestrictionLevel READ_ONLY = fromString("ReadOnly"); + + /** + * Creates a new instance of RestrictionLevel value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RestrictionLevel() { + } + + /** + * Creates or finds a RestrictionLevel from its string representation. + * + * @param name a name to look for. + * @return the corresponding RestrictionLevel. + */ + public static RestrictionLevel fromString(String name) { + return fromString(name, RestrictionLevel.class); + } + + /** + * Gets known RestrictionLevel values. + * + * @return known RestrictionLevel values. + */ + public static Collection values() { + return values(RestrictionLevel.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/RunCommandRequest.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/RunCommandRequest.java new file mode 100644 index 000000000000..77291adaa989 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/RunCommandRequest.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A run command request. + */ +@Fluent +public final class RunCommandRequest implements JsonSerializable { + /* + * The command to run. + */ + private String command; + + /* + * A base64 encoded zip file containing the files required by the command. + */ + private String context; + + /* + * AuthToken issued for AKS AAD Server App. + */ + private String clusterToken; + + /** + * Creates an instance of RunCommandRequest class. + */ + public RunCommandRequest() { + } + + /** + * Get the command property: The command to run. + * + * @return the command value. + */ + public String command() { + return this.command; + } + + /** + * Set the command property: The command to run. + * + * @param command the command value to set. + * @return the RunCommandRequest object itself. + */ + public RunCommandRequest withCommand(String command) { + this.command = command; + return this; + } + + /** + * Get the context property: A base64 encoded zip file containing the files required by the command. + * + * @return the context value. + */ + public String context() { + return this.context; + } + + /** + * Set the context property: A base64 encoded zip file containing the files required by the command. + * + * @param context the context value to set. + * @return the RunCommandRequest object itself. + */ + public RunCommandRequest withContext(String context) { + this.context = context; + return this; + } + + /** + * Get the clusterToken property: AuthToken issued for AKS AAD Server App. + * + * @return the clusterToken value. + */ + public String clusterToken() { + return this.clusterToken; + } + + /** + * Set the clusterToken property: AuthToken issued for AKS AAD Server App. + * + * @param clusterToken the clusterToken value to set. + * @return the RunCommandRequest object itself. + */ + public RunCommandRequest withClusterToken(String clusterToken) { + this.clusterToken = clusterToken; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("command", this.command); + jsonWriter.writeStringField("context", this.context); + jsonWriter.writeStringField("clusterToken", this.clusterToken); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RunCommandRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RunCommandRequest if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RunCommandRequest. + */ + public static RunCommandRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RunCommandRequest deserializedRunCommandRequest = new RunCommandRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("command".equals(fieldName)) { + deserializedRunCommandRequest.command = reader.getString(); + } else if ("context".equals(fieldName)) { + deserializedRunCommandRequest.context = reader.getString(); + } else if ("clusterToken".equals(fieldName)) { + deserializedRunCommandRequest.clusterToken = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRunCommandRequest; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/RunCommandResult.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/RunCommandResult.java new file mode 100644 index 000000000000..9044b315f11d --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/RunCommandResult.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.RunCommandResultInner; +import java.time.OffsetDateTime; + +/** + * An immutable client-side representation of RunCommandResult. + */ +public interface RunCommandResult { + /** + * Gets the id property: The command id. + * + * @return the id value. + */ + String id(); + + /** + * Gets the provisioningState property: provisioning State. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the exitCode property: The exit code of the command. + * + * @return the exitCode value. + */ + Integer exitCode(); + + /** + * Gets the startedAt property: The time when the command started. + * + * @return the startedAt value. + */ + OffsetDateTime startedAt(); + + /** + * Gets the finishedAt property: The time when the command finished. + * + * @return the finishedAt value. + */ + OffsetDateTime finishedAt(); + + /** + * Gets the logs property: The command output. + * + * @return the logs value. + */ + String logs(); + + /** + * Gets the reason property: An explanation of why provisioningState is set to failed (if so). + * + * @return the reason value. + */ + String reason(); + + /** + * Gets the inner com.azure.resourcemanager.containerservice.generated.fluent.models.RunCommandResultInner object. + * + * @return the inner object. + */ + RunCommandResultInner innerModel(); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ScaleDownMode.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ScaleDownMode.java new file mode 100644 index 000000000000..26482dfe8f37 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ScaleDownMode.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Describes how VMs are added to or removed from Agent Pools. See [billing + * states](https://docs.microsoft.com/azure/virtual-machines/states-billing). + */ +public final class ScaleDownMode extends ExpandableStringEnum { + /** + * Create new instances during scale up and remove instances during scale down. + */ + public static final ScaleDownMode DELETE = fromString("Delete"); + + /** + * Attempt to start deallocated instances (if they exist) during scale up and deallocate instances during scale + * down. + */ + public static final ScaleDownMode DEALLOCATE = fromString("Deallocate"); + + /** + * Creates a new instance of ScaleDownMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ScaleDownMode() { + } + + /** + * Creates or finds a ScaleDownMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding ScaleDownMode. + */ + public static ScaleDownMode fromString(String name) { + return fromString(name, ScaleDownMode.class); + } + + /** + * Gets known ScaleDownMode values. + * + * @return known ScaleDownMode values. + */ + public static Collection values() { + return values(ScaleDownMode.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ScaleProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ScaleProfile.java new file mode 100644 index 000000000000..a5c92d99b321 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ScaleProfile.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Specifications on how to scale a VirtualMachines agent pool. + */ +@Fluent +public final class ScaleProfile implements JsonSerializable { + /* + * Specifications on how to scale the VirtualMachines agent pool to a fixed size. + */ + private List manual; + + /** + * Creates an instance of ScaleProfile class. + */ + public ScaleProfile() { + } + + /** + * Get the manual property: Specifications on how to scale the VirtualMachines agent pool to a fixed size. + * + * @return the manual value. + */ + public List manual() { + return this.manual; + } + + /** + * Set the manual property: Specifications on how to scale the VirtualMachines agent pool to a fixed size. + * + * @param manual the manual value to set. + * @return the ScaleProfile object itself. + */ + public ScaleProfile withManual(List manual) { + this.manual = manual; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("manual", this.manual, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScaleProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScaleProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ScaleProfile. + */ + public static ScaleProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScaleProfile deserializedScaleProfile = new ScaleProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("manual".equals(fieldName)) { + List manual = reader.readArray(reader1 -> ManualScaleProfile.fromJson(reader1)); + deserializedScaleProfile.manual = manual; + } else { + reader.skipChildren(); + } + } + + return deserializedScaleProfile; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ScaleSetEvictionPolicy.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ScaleSetEvictionPolicy.java new file mode 100644 index 000000000000..d4d0015b8b52 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ScaleSetEvictionPolicy.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The Virtual Machine Scale Set eviction policy. 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 final class ScaleSetEvictionPolicy extends ExpandableStringEnum { + /** + * Nodes in the underlying Scale Set of the node pool are deleted when they're evicted. + */ + public static final ScaleSetEvictionPolicy DELETE = fromString("Delete"); + + /** + * 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 final ScaleSetEvictionPolicy DEALLOCATE = fromString("Deallocate"); + + /** + * Creates a new instance of ScaleSetEvictionPolicy value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ScaleSetEvictionPolicy() { + } + + /** + * Creates or finds a ScaleSetEvictionPolicy from its string representation. + * + * @param name a name to look for. + * @return the corresponding ScaleSetEvictionPolicy. + */ + public static ScaleSetEvictionPolicy fromString(String name) { + return fromString(name, ScaleSetEvictionPolicy.class); + } + + /** + * Gets known ScaleSetEvictionPolicy values. + * + * @return known ScaleSetEvictionPolicy values. + */ + public static Collection values() { + return values(ScaleSetEvictionPolicy.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ScaleSetPriority.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ScaleSetPriority.java new file mode 100644 index 000000000000..08bd2e766a95 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ScaleSetPriority.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The Virtual Machine Scale Set priority. + */ +public final class ScaleSetPriority extends ExpandableStringEnum { + /** + * 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 final ScaleSetPriority SPOT = fromString("Spot"); + + /** + * Regular VMs will be used. + */ + public static final ScaleSetPriority REGULAR = fromString("Regular"); + + /** + * Creates a new instance of ScaleSetPriority value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ScaleSetPriority() { + } + + /** + * Creates or finds a ScaleSetPriority from its string representation. + * + * @param name a name to look for. + * @return the corresponding ScaleSetPriority. + */ + public static ScaleSetPriority fromString(String name) { + return fromString(name, ScaleSetPriority.class); + } + + /** + * Gets known ScaleSetPriority values. + * + * @return known ScaleSetPriority values. + */ + public static Collection values() { + return values(ScaleSetPriority.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Schedule.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Schedule.java new file mode 100644 index 000000000000..ac6708aa687a --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Schedule.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * One and only one of the schedule types should be specified. Choose either 'daily', 'weekly', 'absoluteMonthly' or + * 'relativeMonthly' for your maintenance schedule. + */ +@Fluent +public final class Schedule implements JsonSerializable { + /* + * For schedules like: 'recur every day' or 'recur every 3 days'. + */ + private DailySchedule daily; + + /* + * For schedules like: 'recur every Monday' or 'recur every 3 weeks on Wednesday'. + */ + private WeeklySchedule weekly; + + /* + * For schedules like: 'recur every month on the 15th' or 'recur every 3 months on the 20th'. + */ + private AbsoluteMonthlySchedule absoluteMonthly; + + /* + * For schedules like: 'recur every month on the first Monday' or 'recur every 3 months on last Friday'. + */ + private RelativeMonthlySchedule relativeMonthly; + + /** + * Creates an instance of Schedule class. + */ + public Schedule() { + } + + /** + * Get the daily property: For schedules like: 'recur every day' or 'recur every 3 days'. + * + * @return the daily value. + */ + public DailySchedule daily() { + return this.daily; + } + + /** + * Set the daily property: For schedules like: 'recur every day' or 'recur every 3 days'. + * + * @param daily the daily value to set. + * @return the Schedule object itself. + */ + public Schedule withDaily(DailySchedule daily) { + this.daily = daily; + return this; + } + + /** + * Get the weekly property: For schedules like: 'recur every Monday' or 'recur every 3 weeks on Wednesday'. + * + * @return the weekly value. + */ + public WeeklySchedule weekly() { + return this.weekly; + } + + /** + * Set the weekly property: For schedules like: 'recur every Monday' or 'recur every 3 weeks on Wednesday'. + * + * @param weekly the weekly value to set. + * @return the Schedule object itself. + */ + public Schedule withWeekly(WeeklySchedule weekly) { + this.weekly = weekly; + return this; + } + + /** + * Get the absoluteMonthly property: For schedules like: 'recur every month on the 15th' or 'recur every 3 months on + * the 20th'. + * + * @return the absoluteMonthly value. + */ + public AbsoluteMonthlySchedule absoluteMonthly() { + return this.absoluteMonthly; + } + + /** + * Set the absoluteMonthly property: For schedules like: 'recur every month on the 15th' or 'recur every 3 months on + * the 20th'. + * + * @param absoluteMonthly the absoluteMonthly value to set. + * @return the Schedule object itself. + */ + public Schedule withAbsoluteMonthly(AbsoluteMonthlySchedule absoluteMonthly) { + this.absoluteMonthly = absoluteMonthly; + return this; + } + + /** + * Get the relativeMonthly property: For schedules like: 'recur every month on the first Monday' or 'recur every 3 + * months on last Friday'. + * + * @return the relativeMonthly value. + */ + public RelativeMonthlySchedule relativeMonthly() { + return this.relativeMonthly; + } + + /** + * Set the relativeMonthly property: For schedules like: 'recur every month on the first Monday' or 'recur every 3 + * months on last Friday'. + * + * @param relativeMonthly the relativeMonthly value to set. + * @return the Schedule object itself. + */ + public Schedule withRelativeMonthly(RelativeMonthlySchedule relativeMonthly) { + this.relativeMonthly = relativeMonthly; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("daily", this.daily); + jsonWriter.writeJsonField("weekly", this.weekly); + jsonWriter.writeJsonField("absoluteMonthly", this.absoluteMonthly); + jsonWriter.writeJsonField("relativeMonthly", this.relativeMonthly); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Schedule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Schedule if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the Schedule. + */ + public static Schedule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Schedule deserializedSchedule = new Schedule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("daily".equals(fieldName)) { + deserializedSchedule.daily = DailySchedule.fromJson(reader); + } else if ("weekly".equals(fieldName)) { + deserializedSchedule.weekly = WeeklySchedule.fromJson(reader); + } else if ("absoluteMonthly".equals(fieldName)) { + deserializedSchedule.absoluteMonthly = AbsoluteMonthlySchedule.fromJson(reader); + } else if ("relativeMonthly".equals(fieldName)) { + deserializedSchedule.relativeMonthly = RelativeMonthlySchedule.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSchedule; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ServiceMeshMode.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ServiceMeshMode.java new file mode 100644 index 000000000000..06004d91d602 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ServiceMeshMode.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Mode of the service mesh. + */ +public final class ServiceMeshMode extends ExpandableStringEnum { + /** + * Istio deployed as an AKS addon. + */ + public static final ServiceMeshMode ISTIO = fromString("Istio"); + + /** + * Mesh is disabled. + */ + public static final ServiceMeshMode DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of ServiceMeshMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ServiceMeshMode() { + } + + /** + * Creates or finds a ServiceMeshMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding ServiceMeshMode. + */ + public static ServiceMeshMode fromString(String name) { + return fromString(name, ServiceMeshMode.class); + } + + /** + * Gets known ServiceMeshMode values. + * + * @return known ServiceMeshMode values. + */ + public static Collection values() { + return values(ServiceMeshMode.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ServiceMeshProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ServiceMeshProfile.java new file mode 100644 index 000000000000..83866c25de2f --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ServiceMeshProfile.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Service mesh profile for a managed cluster. + */ +@Fluent +public final class ServiceMeshProfile implements JsonSerializable { + /* + * Mode of the service mesh. + */ + private ServiceMeshMode mode; + + /* + * Istio service mesh configuration. + */ + private IstioServiceMesh istio; + + /** + * Creates an instance of ServiceMeshProfile class. + */ + public ServiceMeshProfile() { + } + + /** + * Get the mode property: Mode of the service mesh. + * + * @return the mode value. + */ + public ServiceMeshMode mode() { + return this.mode; + } + + /** + * Set the mode property: Mode of the service mesh. + * + * @param mode the mode value to set. + * @return the ServiceMeshProfile object itself. + */ + public ServiceMeshProfile withMode(ServiceMeshMode mode) { + this.mode = mode; + return this; + } + + /** + * Get the istio property: Istio service mesh configuration. + * + * @return the istio value. + */ + public IstioServiceMesh istio() { + return this.istio; + } + + /** + * Set the istio property: Istio service mesh configuration. + * + * @param istio the istio value to set. + * @return the ServiceMeshProfile object itself. + */ + public ServiceMeshProfile withIstio(IstioServiceMesh istio) { + this.istio = istio; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + jsonWriter.writeJsonField("istio", this.istio); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceMeshProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceMeshProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ServiceMeshProfile. + */ + public static ServiceMeshProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceMeshProfile deserializedServiceMeshProfile = new ServiceMeshProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("mode".equals(fieldName)) { + deserializedServiceMeshProfile.mode = ServiceMeshMode.fromString(reader.getString()); + } else if ("istio".equals(fieldName)) { + deserializedServiceMeshProfile.istio = IstioServiceMesh.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedServiceMeshProfile; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Snapshot.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Snapshot.java new file mode 100644 index 000000000000..2ba3006c2fcd --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Snapshot.java @@ -0,0 +1,320 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.fluent.models.SnapshotInner; +import java.util.Map; + +/** + * An immutable client-side representation of Snapshot. + */ +public interface Snapshot { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the creationData property: CreationData to be used to specify the source agent pool resource ID to create + * this snapshot. + * + * @return the creationData value. + */ + CreationData creationData(); + + /** + * Gets the snapshotType property: The type of a snapshot. The default is NodePool. + * + * @return the snapshotType value. + */ + SnapshotType snapshotType(); + + /** + * Gets the kubernetesVersion property: The version of Kubernetes. + * + * @return the kubernetesVersion value. + */ + String kubernetesVersion(); + + /** + * Gets the nodeImageVersion property: The version of node image. + * + * @return the nodeImageVersion value. + */ + String nodeImageVersion(); + + /** + * Gets the osType property: The operating system type. The default is Linux. + * + * @return the osType value. + */ + OSType osType(); + + /** + * Gets the osSku property: 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. + * + * @return the osSku value. + */ + OSSKU osSku(); + + /** + * Gets the vmSize property: The size of the VM. + * + * @return the vmSize value. + */ + String vmSize(); + + /** + * Gets the enableFIPS property: Whether to use a FIPS-enabled OS. + * + * @return the enableFIPS value. + */ + Boolean enableFIPS(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.containerservice.generated.fluent.models.SnapshotInner object. + * + * @return the inner object. + */ + SnapshotInner innerModel(); + + /** + * The entirety of the Snapshot definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The Snapshot definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Snapshot definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the Snapshot definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the Snapshot definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the Snapshot definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, DefinitionStages.WithCreationData, DefinitionStages.WithSnapshotType { + /** + * Executes the create request. + * + * @return the created resource. + */ + Snapshot create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Snapshot create(Context context); + } + + /** + * The stage of the Snapshot definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the Snapshot definition allowing to specify creationData. + */ + interface WithCreationData { + /** + * Specifies the creationData property: CreationData to be used to specify the source agent pool resource ID + * to create this snapshot.. + * + * @param creationData CreationData to be used to specify the source agent pool resource ID to create this + * snapshot. + * @return the next definition stage. + */ + WithCreate withCreationData(CreationData creationData); + } + + /** + * The stage of the Snapshot definition allowing to specify snapshotType. + */ + interface WithSnapshotType { + /** + * Specifies the snapshotType property: The type of a snapshot. The default is NodePool.. + * + * @param snapshotType The type of a snapshot. The default is NodePool. + * @return the next definition stage. + */ + WithCreate withSnapshotType(SnapshotType snapshotType); + } + } + + /** + * Begins update for the Snapshot resource. + * + * @return the stage of resource update. + */ + Snapshot.Update update(); + + /** + * The template for Snapshot update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Snapshot apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Snapshot apply(Context context); + } + + /** + * The Snapshot update stages. + */ + interface UpdateStages { + /** + * The stage of the Snapshot update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Snapshot refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Snapshot refresh(Context context); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/SnapshotType.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/SnapshotType.java new file mode 100644 index 000000000000..70cf4854f879 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/SnapshotType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The type of a snapshot. The default is NodePool. + */ +public final class SnapshotType extends ExpandableStringEnum { + /** + * The snapshot is a snapshot of a node pool. + */ + public static final SnapshotType NODE_POOL = fromString("NodePool"); + + /** + * Creates a new instance of SnapshotType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SnapshotType() { + } + + /** + * Creates or finds a SnapshotType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SnapshotType. + */ + public static SnapshotType fromString(String name) { + return fromString(name, SnapshotType.class); + } + + /** + * Gets known SnapshotType values. + * + * @return known SnapshotType values. + */ + public static Collection values() { + return values(SnapshotType.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Snapshots.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Snapshots.java new file mode 100644 index 000000000000..aac51eb9d326 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Snapshots.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Snapshots. + */ +public interface Snapshots { + /** + * Gets a snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a snapshot along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String resourceName, Context context); + + /** + * Gets a snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a snapshot. + */ + Snapshot getByResourceGroup(String resourceGroupName, String resourceName); + + /** + * Deletes a snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByResourceGroupWithResponse(String resourceGroupName, String resourceName, Context context); + + /** + * Deletes a snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String resourceName); + + /** + * Lists snapshots in the specified subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Snapshot list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists snapshots in the specified subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Snapshot list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets a list of snapshots in the specified subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of snapshots in the specified subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Gets a list of snapshots in the specified subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of snapshots in the specified subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Gets a snapshot. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a snapshot along with {@link Response}. + */ + Snapshot getById(String id); + + /** + * Gets a snapshot. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a snapshot along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a snapshot. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a snapshot. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Snapshot resource. + * + * @param name resource name. + * @return the first stage of the new Snapshot definition. + */ + Snapshot.DefinitionStages.Blank define(String name); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/SysctlConfig.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/SysctlConfig.java new file mode 100644 index 000000000000..c276a5ae9ca5 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/SysctlConfig.java @@ -0,0 +1,841 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Sysctl settings for Linux agent nodes. + */ +@Fluent +public final class SysctlConfig implements JsonSerializable { + /* + * Sysctl setting net.core.somaxconn. + */ + private Integer netCoreSomaxconn; + + /* + * Sysctl setting net.core.netdev_max_backlog. + */ + private Integer netCoreNetdevMaxBacklog; + + /* + * Sysctl setting net.core.rmem_default. + */ + private Integer netCoreRmemDefault; + + /* + * Sysctl setting net.core.rmem_max. + */ + private Integer netCoreRmemMax; + + /* + * Sysctl setting net.core.wmem_default. + */ + private Integer netCoreWmemDefault; + + /* + * Sysctl setting net.core.wmem_max. + */ + private Integer netCoreWmemMax; + + /* + * Sysctl setting net.core.optmem_max. + */ + private Integer netCoreOptmemMax; + + /* + * Sysctl setting net.ipv4.tcp_max_syn_backlog. + */ + private Integer netIpv4TcpMaxSynBacklog; + + /* + * Sysctl setting net.ipv4.tcp_max_tw_buckets. + */ + private Integer netIpv4TcpMaxTwBuckets; + + /* + * Sysctl setting net.ipv4.tcp_fin_timeout. + */ + private Integer netIpv4TcpFinTimeout; + + /* + * Sysctl setting net.ipv4.tcp_keepalive_time. + */ + private Integer netIpv4TcpKeepaliveTime; + + /* + * Sysctl setting net.ipv4.tcp_keepalive_probes. + */ + private Integer netIpv4TcpKeepaliveProbes; + + /* + * Sysctl setting net.ipv4.tcp_keepalive_intvl. + */ + private Integer netIpv4TcpkeepaliveIntvl; + + /* + * Sysctl setting net.ipv4.tcp_tw_reuse. + */ + private Boolean netIpv4TcpTwReuse; + + /* + * Sysctl setting net.ipv4.ip_local_port_range. + */ + private String netIpv4IpLocalPortRange; + + /* + * Sysctl setting net.ipv4.neigh.default.gc_thresh1. + */ + private Integer netIpv4NeighDefaultGcThresh1; + + /* + * Sysctl setting net.ipv4.neigh.default.gc_thresh2. + */ + private Integer netIpv4NeighDefaultGcThresh2; + + /* + * Sysctl setting net.ipv4.neigh.default.gc_thresh3. + */ + private Integer netIpv4NeighDefaultGcThresh3; + + /* + * Sysctl setting net.netfilter.nf_conntrack_max. + */ + private Integer netNetfilterNfConntrackMax; + + /* + * Sysctl setting net.netfilter.nf_conntrack_buckets. + */ + private Integer netNetfilterNfConntrackBuckets; + + /* + * Sysctl setting fs.inotify.max_user_watches. + */ + private Integer fsInotifyMaxUserWatches; + + /* + * Sysctl setting fs.file-max. + */ + private Integer fsFileMax; + + /* + * Sysctl setting fs.aio-max-nr. + */ + private Integer fsAioMaxNr; + + /* + * Sysctl setting fs.nr_open. + */ + private Integer fsNrOpen; + + /* + * Sysctl setting kernel.threads-max. + */ + private Integer kernelThreadsMax; + + /* + * Sysctl setting vm.max_map_count. + */ + private Integer vmMaxMapCount; + + /* + * Sysctl setting vm.swappiness. + */ + private Integer vmSwappiness; + + /* + * Sysctl setting vm.vfs_cache_pressure. + */ + private Integer vmVfsCachePressure; + + /** + * Creates an instance of SysctlConfig class. + */ + public SysctlConfig() { + } + + /** + * Get the netCoreSomaxconn property: Sysctl setting net.core.somaxconn. + * + * @return the netCoreSomaxconn value. + */ + public Integer netCoreSomaxconn() { + return this.netCoreSomaxconn; + } + + /** + * Set the netCoreSomaxconn property: Sysctl setting net.core.somaxconn. + * + * @param netCoreSomaxconn the netCoreSomaxconn value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withNetCoreSomaxconn(Integer netCoreSomaxconn) { + this.netCoreSomaxconn = netCoreSomaxconn; + return this; + } + + /** + * Get the netCoreNetdevMaxBacklog property: Sysctl setting net.core.netdev_max_backlog. + * + * @return the netCoreNetdevMaxBacklog value. + */ + public Integer netCoreNetdevMaxBacklog() { + return this.netCoreNetdevMaxBacklog; + } + + /** + * Set the netCoreNetdevMaxBacklog property: Sysctl setting net.core.netdev_max_backlog. + * + * @param netCoreNetdevMaxBacklog the netCoreNetdevMaxBacklog value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withNetCoreNetdevMaxBacklog(Integer netCoreNetdevMaxBacklog) { + this.netCoreNetdevMaxBacklog = netCoreNetdevMaxBacklog; + return this; + } + + /** + * Get the netCoreRmemDefault property: Sysctl setting net.core.rmem_default. + * + * @return the netCoreRmemDefault value. + */ + public Integer netCoreRmemDefault() { + return this.netCoreRmemDefault; + } + + /** + * Set the netCoreRmemDefault property: Sysctl setting net.core.rmem_default. + * + * @param netCoreRmemDefault the netCoreRmemDefault value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withNetCoreRmemDefault(Integer netCoreRmemDefault) { + this.netCoreRmemDefault = netCoreRmemDefault; + return this; + } + + /** + * Get the netCoreRmemMax property: Sysctl setting net.core.rmem_max. + * + * @return the netCoreRmemMax value. + */ + public Integer netCoreRmemMax() { + return this.netCoreRmemMax; + } + + /** + * Set the netCoreRmemMax property: Sysctl setting net.core.rmem_max. + * + * @param netCoreRmemMax the netCoreRmemMax value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withNetCoreRmemMax(Integer netCoreRmemMax) { + this.netCoreRmemMax = netCoreRmemMax; + return this; + } + + /** + * Get the netCoreWmemDefault property: Sysctl setting net.core.wmem_default. + * + * @return the netCoreWmemDefault value. + */ + public Integer netCoreWmemDefault() { + return this.netCoreWmemDefault; + } + + /** + * Set the netCoreWmemDefault property: Sysctl setting net.core.wmem_default. + * + * @param netCoreWmemDefault the netCoreWmemDefault value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withNetCoreWmemDefault(Integer netCoreWmemDefault) { + this.netCoreWmemDefault = netCoreWmemDefault; + return this; + } + + /** + * Get the netCoreWmemMax property: Sysctl setting net.core.wmem_max. + * + * @return the netCoreWmemMax value. + */ + public Integer netCoreWmemMax() { + return this.netCoreWmemMax; + } + + /** + * Set the netCoreWmemMax property: Sysctl setting net.core.wmem_max. + * + * @param netCoreWmemMax the netCoreWmemMax value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withNetCoreWmemMax(Integer netCoreWmemMax) { + this.netCoreWmemMax = netCoreWmemMax; + return this; + } + + /** + * Get the netCoreOptmemMax property: Sysctl setting net.core.optmem_max. + * + * @return the netCoreOptmemMax value. + */ + public Integer netCoreOptmemMax() { + return this.netCoreOptmemMax; + } + + /** + * Set the netCoreOptmemMax property: Sysctl setting net.core.optmem_max. + * + * @param netCoreOptmemMax the netCoreOptmemMax value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withNetCoreOptmemMax(Integer netCoreOptmemMax) { + this.netCoreOptmemMax = netCoreOptmemMax; + return this; + } + + /** + * Get the netIpv4TcpMaxSynBacklog property: Sysctl setting net.ipv4.tcp_max_syn_backlog. + * + * @return the netIpv4TcpMaxSynBacklog value. + */ + public Integer netIpv4TcpMaxSynBacklog() { + return this.netIpv4TcpMaxSynBacklog; + } + + /** + * Set the netIpv4TcpMaxSynBacklog property: Sysctl setting net.ipv4.tcp_max_syn_backlog. + * + * @param netIpv4TcpMaxSynBacklog the netIpv4TcpMaxSynBacklog value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withNetIpv4TcpMaxSynBacklog(Integer netIpv4TcpMaxSynBacklog) { + this.netIpv4TcpMaxSynBacklog = netIpv4TcpMaxSynBacklog; + return this; + } + + /** + * Get the netIpv4TcpMaxTwBuckets property: Sysctl setting net.ipv4.tcp_max_tw_buckets. + * + * @return the netIpv4TcpMaxTwBuckets value. + */ + public Integer netIpv4TcpMaxTwBuckets() { + return this.netIpv4TcpMaxTwBuckets; + } + + /** + * Set the netIpv4TcpMaxTwBuckets property: Sysctl setting net.ipv4.tcp_max_tw_buckets. + * + * @param netIpv4TcpMaxTwBuckets the netIpv4TcpMaxTwBuckets value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withNetIpv4TcpMaxTwBuckets(Integer netIpv4TcpMaxTwBuckets) { + this.netIpv4TcpMaxTwBuckets = netIpv4TcpMaxTwBuckets; + return this; + } + + /** + * Get the netIpv4TcpFinTimeout property: Sysctl setting net.ipv4.tcp_fin_timeout. + * + * @return the netIpv4TcpFinTimeout value. + */ + public Integer netIpv4TcpFinTimeout() { + return this.netIpv4TcpFinTimeout; + } + + /** + * Set the netIpv4TcpFinTimeout property: Sysctl setting net.ipv4.tcp_fin_timeout. + * + * @param netIpv4TcpFinTimeout the netIpv4TcpFinTimeout value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withNetIpv4TcpFinTimeout(Integer netIpv4TcpFinTimeout) { + this.netIpv4TcpFinTimeout = netIpv4TcpFinTimeout; + return this; + } + + /** + * Get the netIpv4TcpKeepaliveTime property: Sysctl setting net.ipv4.tcp_keepalive_time. + * + * @return the netIpv4TcpKeepaliveTime value. + */ + public Integer netIpv4TcpKeepaliveTime() { + return this.netIpv4TcpKeepaliveTime; + } + + /** + * Set the netIpv4TcpKeepaliveTime property: Sysctl setting net.ipv4.tcp_keepalive_time. + * + * @param netIpv4TcpKeepaliveTime the netIpv4TcpKeepaliveTime value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withNetIpv4TcpKeepaliveTime(Integer netIpv4TcpKeepaliveTime) { + this.netIpv4TcpKeepaliveTime = netIpv4TcpKeepaliveTime; + return this; + } + + /** + * Get the netIpv4TcpKeepaliveProbes property: Sysctl setting net.ipv4.tcp_keepalive_probes. + * + * @return the netIpv4TcpKeepaliveProbes value. + */ + public Integer netIpv4TcpKeepaliveProbes() { + return this.netIpv4TcpKeepaliveProbes; + } + + /** + * Set the netIpv4TcpKeepaliveProbes property: Sysctl setting net.ipv4.tcp_keepalive_probes. + * + * @param netIpv4TcpKeepaliveProbes the netIpv4TcpKeepaliveProbes value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withNetIpv4TcpKeepaliveProbes(Integer netIpv4TcpKeepaliveProbes) { + this.netIpv4TcpKeepaliveProbes = netIpv4TcpKeepaliveProbes; + return this; + } + + /** + * Get the netIpv4TcpkeepaliveIntvl property: Sysctl setting net.ipv4.tcp_keepalive_intvl. + * + * @return the netIpv4TcpkeepaliveIntvl value. + */ + public Integer netIpv4TcpkeepaliveIntvl() { + return this.netIpv4TcpkeepaliveIntvl; + } + + /** + * Set the netIpv4TcpkeepaliveIntvl property: Sysctl setting net.ipv4.tcp_keepalive_intvl. + * + * @param netIpv4TcpkeepaliveIntvl the netIpv4TcpkeepaliveIntvl value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withNetIpv4TcpkeepaliveIntvl(Integer netIpv4TcpkeepaliveIntvl) { + this.netIpv4TcpkeepaliveIntvl = netIpv4TcpkeepaliveIntvl; + return this; + } + + /** + * Get the netIpv4TcpTwReuse property: Sysctl setting net.ipv4.tcp_tw_reuse. + * + * @return the netIpv4TcpTwReuse value. + */ + public Boolean netIpv4TcpTwReuse() { + return this.netIpv4TcpTwReuse; + } + + /** + * Set the netIpv4TcpTwReuse property: Sysctl setting net.ipv4.tcp_tw_reuse. + * + * @param netIpv4TcpTwReuse the netIpv4TcpTwReuse value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withNetIpv4TcpTwReuse(Boolean netIpv4TcpTwReuse) { + this.netIpv4TcpTwReuse = netIpv4TcpTwReuse; + return this; + } + + /** + * Get the netIpv4IpLocalPortRange property: Sysctl setting net.ipv4.ip_local_port_range. + * + * @return the netIpv4IpLocalPortRange value. + */ + public String netIpv4IpLocalPortRange() { + return this.netIpv4IpLocalPortRange; + } + + /** + * Set the netIpv4IpLocalPortRange property: Sysctl setting net.ipv4.ip_local_port_range. + * + * @param netIpv4IpLocalPortRange the netIpv4IpLocalPortRange value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withNetIpv4IpLocalPortRange(String netIpv4IpLocalPortRange) { + this.netIpv4IpLocalPortRange = netIpv4IpLocalPortRange; + return this; + } + + /** + * Get the netIpv4NeighDefaultGcThresh1 property: Sysctl setting net.ipv4.neigh.default.gc_thresh1. + * + * @return the netIpv4NeighDefaultGcThresh1 value. + */ + public Integer netIpv4NeighDefaultGcThresh1() { + return this.netIpv4NeighDefaultGcThresh1; + } + + /** + * Set the netIpv4NeighDefaultGcThresh1 property: Sysctl setting net.ipv4.neigh.default.gc_thresh1. + * + * @param netIpv4NeighDefaultGcThresh1 the netIpv4NeighDefaultGcThresh1 value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withNetIpv4NeighDefaultGcThresh1(Integer netIpv4NeighDefaultGcThresh1) { + this.netIpv4NeighDefaultGcThresh1 = netIpv4NeighDefaultGcThresh1; + return this; + } + + /** + * Get the netIpv4NeighDefaultGcThresh2 property: Sysctl setting net.ipv4.neigh.default.gc_thresh2. + * + * @return the netIpv4NeighDefaultGcThresh2 value. + */ + public Integer netIpv4NeighDefaultGcThresh2() { + return this.netIpv4NeighDefaultGcThresh2; + } + + /** + * Set the netIpv4NeighDefaultGcThresh2 property: Sysctl setting net.ipv4.neigh.default.gc_thresh2. + * + * @param netIpv4NeighDefaultGcThresh2 the netIpv4NeighDefaultGcThresh2 value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withNetIpv4NeighDefaultGcThresh2(Integer netIpv4NeighDefaultGcThresh2) { + this.netIpv4NeighDefaultGcThresh2 = netIpv4NeighDefaultGcThresh2; + return this; + } + + /** + * Get the netIpv4NeighDefaultGcThresh3 property: Sysctl setting net.ipv4.neigh.default.gc_thresh3. + * + * @return the netIpv4NeighDefaultGcThresh3 value. + */ + public Integer netIpv4NeighDefaultGcThresh3() { + return this.netIpv4NeighDefaultGcThresh3; + } + + /** + * Set the netIpv4NeighDefaultGcThresh3 property: Sysctl setting net.ipv4.neigh.default.gc_thresh3. + * + * @param netIpv4NeighDefaultGcThresh3 the netIpv4NeighDefaultGcThresh3 value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withNetIpv4NeighDefaultGcThresh3(Integer netIpv4NeighDefaultGcThresh3) { + this.netIpv4NeighDefaultGcThresh3 = netIpv4NeighDefaultGcThresh3; + return this; + } + + /** + * Get the netNetfilterNfConntrackMax property: Sysctl setting net.netfilter.nf_conntrack_max. + * + * @return the netNetfilterNfConntrackMax value. + */ + public Integer netNetfilterNfConntrackMax() { + return this.netNetfilterNfConntrackMax; + } + + /** + * Set the netNetfilterNfConntrackMax property: Sysctl setting net.netfilter.nf_conntrack_max. + * + * @param netNetfilterNfConntrackMax the netNetfilterNfConntrackMax value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withNetNetfilterNfConntrackMax(Integer netNetfilterNfConntrackMax) { + this.netNetfilterNfConntrackMax = netNetfilterNfConntrackMax; + return this; + } + + /** + * Get the netNetfilterNfConntrackBuckets property: Sysctl setting net.netfilter.nf_conntrack_buckets. + * + * @return the netNetfilterNfConntrackBuckets value. + */ + public Integer netNetfilterNfConntrackBuckets() { + return this.netNetfilterNfConntrackBuckets; + } + + /** + * Set the netNetfilterNfConntrackBuckets property: Sysctl setting net.netfilter.nf_conntrack_buckets. + * + * @param netNetfilterNfConntrackBuckets the netNetfilterNfConntrackBuckets value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withNetNetfilterNfConntrackBuckets(Integer netNetfilterNfConntrackBuckets) { + this.netNetfilterNfConntrackBuckets = netNetfilterNfConntrackBuckets; + return this; + } + + /** + * Get the fsInotifyMaxUserWatches property: Sysctl setting fs.inotify.max_user_watches. + * + * @return the fsInotifyMaxUserWatches value. + */ + public Integer fsInotifyMaxUserWatches() { + return this.fsInotifyMaxUserWatches; + } + + /** + * Set the fsInotifyMaxUserWatches property: Sysctl setting fs.inotify.max_user_watches. + * + * @param fsInotifyMaxUserWatches the fsInotifyMaxUserWatches value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withFsInotifyMaxUserWatches(Integer fsInotifyMaxUserWatches) { + this.fsInotifyMaxUserWatches = fsInotifyMaxUserWatches; + return this; + } + + /** + * Get the fsFileMax property: Sysctl setting fs.file-max. + * + * @return the fsFileMax value. + */ + public Integer fsFileMax() { + return this.fsFileMax; + } + + /** + * Set the fsFileMax property: Sysctl setting fs.file-max. + * + * @param fsFileMax the fsFileMax value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withFsFileMax(Integer fsFileMax) { + this.fsFileMax = fsFileMax; + return this; + } + + /** + * Get the fsAioMaxNr property: Sysctl setting fs.aio-max-nr. + * + * @return the fsAioMaxNr value. + */ + public Integer fsAioMaxNr() { + return this.fsAioMaxNr; + } + + /** + * Set the fsAioMaxNr property: Sysctl setting fs.aio-max-nr. + * + * @param fsAioMaxNr the fsAioMaxNr value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withFsAioMaxNr(Integer fsAioMaxNr) { + this.fsAioMaxNr = fsAioMaxNr; + return this; + } + + /** + * Get the fsNrOpen property: Sysctl setting fs.nr_open. + * + * @return the fsNrOpen value. + */ + public Integer fsNrOpen() { + return this.fsNrOpen; + } + + /** + * Set the fsNrOpen property: Sysctl setting fs.nr_open. + * + * @param fsNrOpen the fsNrOpen value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withFsNrOpen(Integer fsNrOpen) { + this.fsNrOpen = fsNrOpen; + return this; + } + + /** + * Get the kernelThreadsMax property: Sysctl setting kernel.threads-max. + * + * @return the kernelThreadsMax value. + */ + public Integer kernelThreadsMax() { + return this.kernelThreadsMax; + } + + /** + * Set the kernelThreadsMax property: Sysctl setting kernel.threads-max. + * + * @param kernelThreadsMax the kernelThreadsMax value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withKernelThreadsMax(Integer kernelThreadsMax) { + this.kernelThreadsMax = kernelThreadsMax; + return this; + } + + /** + * Get the vmMaxMapCount property: Sysctl setting vm.max_map_count. + * + * @return the vmMaxMapCount value. + */ + public Integer vmMaxMapCount() { + return this.vmMaxMapCount; + } + + /** + * Set the vmMaxMapCount property: Sysctl setting vm.max_map_count. + * + * @param vmMaxMapCount the vmMaxMapCount value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withVmMaxMapCount(Integer vmMaxMapCount) { + this.vmMaxMapCount = vmMaxMapCount; + return this; + } + + /** + * Get the vmSwappiness property: Sysctl setting vm.swappiness. + * + * @return the vmSwappiness value. + */ + public Integer vmSwappiness() { + return this.vmSwappiness; + } + + /** + * Set the vmSwappiness property: Sysctl setting vm.swappiness. + * + * @param vmSwappiness the vmSwappiness value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withVmSwappiness(Integer vmSwappiness) { + this.vmSwappiness = vmSwappiness; + return this; + } + + /** + * Get the vmVfsCachePressure property: Sysctl setting vm.vfs_cache_pressure. + * + * @return the vmVfsCachePressure value. + */ + public Integer vmVfsCachePressure() { + return this.vmVfsCachePressure; + } + + /** + * Set the vmVfsCachePressure property: Sysctl setting vm.vfs_cache_pressure. + * + * @param vmVfsCachePressure the vmVfsCachePressure value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withVmVfsCachePressure(Integer vmVfsCachePressure) { + this.vmVfsCachePressure = vmVfsCachePressure; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("netCoreSomaxconn", this.netCoreSomaxconn); + jsonWriter.writeNumberField("netCoreNetdevMaxBacklog", this.netCoreNetdevMaxBacklog); + jsonWriter.writeNumberField("netCoreRmemDefault", this.netCoreRmemDefault); + jsonWriter.writeNumberField("netCoreRmemMax", this.netCoreRmemMax); + jsonWriter.writeNumberField("netCoreWmemDefault", this.netCoreWmemDefault); + jsonWriter.writeNumberField("netCoreWmemMax", this.netCoreWmemMax); + jsonWriter.writeNumberField("netCoreOptmemMax", this.netCoreOptmemMax); + jsonWriter.writeNumberField("netIpv4TcpMaxSynBacklog", this.netIpv4TcpMaxSynBacklog); + jsonWriter.writeNumberField("netIpv4TcpMaxTwBuckets", this.netIpv4TcpMaxTwBuckets); + jsonWriter.writeNumberField("netIpv4TcpFinTimeout", this.netIpv4TcpFinTimeout); + jsonWriter.writeNumberField("netIpv4TcpKeepaliveTime", this.netIpv4TcpKeepaliveTime); + jsonWriter.writeNumberField("netIpv4TcpKeepaliveProbes", this.netIpv4TcpKeepaliveProbes); + jsonWriter.writeNumberField("netIpv4TcpkeepaliveIntvl", this.netIpv4TcpkeepaliveIntvl); + jsonWriter.writeBooleanField("netIpv4TcpTwReuse", this.netIpv4TcpTwReuse); + jsonWriter.writeStringField("netIpv4IpLocalPortRange", this.netIpv4IpLocalPortRange); + jsonWriter.writeNumberField("netIpv4NeighDefaultGcThresh1", this.netIpv4NeighDefaultGcThresh1); + jsonWriter.writeNumberField("netIpv4NeighDefaultGcThresh2", this.netIpv4NeighDefaultGcThresh2); + jsonWriter.writeNumberField("netIpv4NeighDefaultGcThresh3", this.netIpv4NeighDefaultGcThresh3); + jsonWriter.writeNumberField("netNetfilterNfConntrackMax", this.netNetfilterNfConntrackMax); + jsonWriter.writeNumberField("netNetfilterNfConntrackBuckets", this.netNetfilterNfConntrackBuckets); + jsonWriter.writeNumberField("fsInotifyMaxUserWatches", this.fsInotifyMaxUserWatches); + jsonWriter.writeNumberField("fsFileMax", this.fsFileMax); + jsonWriter.writeNumberField("fsAioMaxNr", this.fsAioMaxNr); + jsonWriter.writeNumberField("fsNrOpen", this.fsNrOpen); + jsonWriter.writeNumberField("kernelThreadsMax", this.kernelThreadsMax); + jsonWriter.writeNumberField("vmMaxMapCount", this.vmMaxMapCount); + jsonWriter.writeNumberField("vmSwappiness", this.vmSwappiness); + jsonWriter.writeNumberField("vmVfsCachePressure", this.vmVfsCachePressure); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SysctlConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SysctlConfig if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SysctlConfig. + */ + public static SysctlConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SysctlConfig deserializedSysctlConfig = new SysctlConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("netCoreSomaxconn".equals(fieldName)) { + deserializedSysctlConfig.netCoreSomaxconn = reader.getNullable(JsonReader::getInt); + } else if ("netCoreNetdevMaxBacklog".equals(fieldName)) { + deserializedSysctlConfig.netCoreNetdevMaxBacklog = reader.getNullable(JsonReader::getInt); + } else if ("netCoreRmemDefault".equals(fieldName)) { + deserializedSysctlConfig.netCoreRmemDefault = reader.getNullable(JsonReader::getInt); + } else if ("netCoreRmemMax".equals(fieldName)) { + deserializedSysctlConfig.netCoreRmemMax = reader.getNullable(JsonReader::getInt); + } else if ("netCoreWmemDefault".equals(fieldName)) { + deserializedSysctlConfig.netCoreWmemDefault = reader.getNullable(JsonReader::getInt); + } else if ("netCoreWmemMax".equals(fieldName)) { + deserializedSysctlConfig.netCoreWmemMax = reader.getNullable(JsonReader::getInt); + } else if ("netCoreOptmemMax".equals(fieldName)) { + deserializedSysctlConfig.netCoreOptmemMax = reader.getNullable(JsonReader::getInt); + } else if ("netIpv4TcpMaxSynBacklog".equals(fieldName)) { + deserializedSysctlConfig.netIpv4TcpMaxSynBacklog = reader.getNullable(JsonReader::getInt); + } else if ("netIpv4TcpMaxTwBuckets".equals(fieldName)) { + deserializedSysctlConfig.netIpv4TcpMaxTwBuckets = reader.getNullable(JsonReader::getInt); + } else if ("netIpv4TcpFinTimeout".equals(fieldName)) { + deserializedSysctlConfig.netIpv4TcpFinTimeout = reader.getNullable(JsonReader::getInt); + } else if ("netIpv4TcpKeepaliveTime".equals(fieldName)) { + deserializedSysctlConfig.netIpv4TcpKeepaliveTime = reader.getNullable(JsonReader::getInt); + } else if ("netIpv4TcpKeepaliveProbes".equals(fieldName)) { + deserializedSysctlConfig.netIpv4TcpKeepaliveProbes = reader.getNullable(JsonReader::getInt); + } else if ("netIpv4TcpkeepaliveIntvl".equals(fieldName)) { + deserializedSysctlConfig.netIpv4TcpkeepaliveIntvl = reader.getNullable(JsonReader::getInt); + } else if ("netIpv4TcpTwReuse".equals(fieldName)) { + deserializedSysctlConfig.netIpv4TcpTwReuse = reader.getNullable(JsonReader::getBoolean); + } else if ("netIpv4IpLocalPortRange".equals(fieldName)) { + deserializedSysctlConfig.netIpv4IpLocalPortRange = reader.getString(); + } else if ("netIpv4NeighDefaultGcThresh1".equals(fieldName)) { + deserializedSysctlConfig.netIpv4NeighDefaultGcThresh1 = reader.getNullable(JsonReader::getInt); + } else if ("netIpv4NeighDefaultGcThresh2".equals(fieldName)) { + deserializedSysctlConfig.netIpv4NeighDefaultGcThresh2 = reader.getNullable(JsonReader::getInt); + } else if ("netIpv4NeighDefaultGcThresh3".equals(fieldName)) { + deserializedSysctlConfig.netIpv4NeighDefaultGcThresh3 = reader.getNullable(JsonReader::getInt); + } else if ("netNetfilterNfConntrackMax".equals(fieldName)) { + deserializedSysctlConfig.netNetfilterNfConntrackMax = reader.getNullable(JsonReader::getInt); + } else if ("netNetfilterNfConntrackBuckets".equals(fieldName)) { + deserializedSysctlConfig.netNetfilterNfConntrackBuckets = reader.getNullable(JsonReader::getInt); + } else if ("fsInotifyMaxUserWatches".equals(fieldName)) { + deserializedSysctlConfig.fsInotifyMaxUserWatches = reader.getNullable(JsonReader::getInt); + } else if ("fsFileMax".equals(fieldName)) { + deserializedSysctlConfig.fsFileMax = reader.getNullable(JsonReader::getInt); + } else if ("fsAioMaxNr".equals(fieldName)) { + deserializedSysctlConfig.fsAioMaxNr = reader.getNullable(JsonReader::getInt); + } else if ("fsNrOpen".equals(fieldName)) { + deserializedSysctlConfig.fsNrOpen = reader.getNullable(JsonReader::getInt); + } else if ("kernelThreadsMax".equals(fieldName)) { + deserializedSysctlConfig.kernelThreadsMax = reader.getNullable(JsonReader::getInt); + } else if ("vmMaxMapCount".equals(fieldName)) { + deserializedSysctlConfig.vmMaxMapCount = reader.getNullable(JsonReader::getInt); + } else if ("vmSwappiness".equals(fieldName)) { + deserializedSysctlConfig.vmSwappiness = reader.getNullable(JsonReader::getInt); + } else if ("vmVfsCachePressure".equals(fieldName)) { + deserializedSysctlConfig.vmVfsCachePressure = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedSysctlConfig; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TagsObject.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TagsObject.java new file mode 100644 index 000000000000..a97cbd358049 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TagsObject.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Tags object for patch operations. + */ +@Fluent +public final class TagsObject implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of TagsObject class. + */ + public TagsObject() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the TagsObject object itself. + */ + public TagsObject withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagsObject from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagsObject if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the TagsObject. + */ + public static TagsObject fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagsObject deserializedTagsObject = new TagsObject(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedTagsObject.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedTagsObject; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TimeInWeek.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TimeInWeek.java new file mode 100644 index 000000000000..860197ad2b95 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TimeInWeek.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Time in a week. + */ +@Fluent +public final class TimeInWeek implements JsonSerializable { + /* + * The day of the week. + */ + private WeekDay day; + + /* + * A list of hours in the day used to identify a time range. 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. + */ + private List hourSlots; + + /** + * Creates an instance of TimeInWeek class. + */ + public TimeInWeek() { + } + + /** + * Get the day property: The day of the week. + * + * @return the day value. + */ + public WeekDay day() { + return this.day; + } + + /** + * Set the day property: The day of the week. + * + * @param day the day value to set. + * @return the TimeInWeek object itself. + */ + public TimeInWeek withDay(WeekDay day) { + this.day = day; + return this; + } + + /** + * Get the hourSlots property: A list of hours in the day used to identify a time range. 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. + * + * @return the hourSlots value. + */ + public List hourSlots() { + return this.hourSlots; + } + + /** + * Set the hourSlots property: A list of hours in the day used to identify a time range. 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. + * + * @param hourSlots the hourSlots value to set. + * @return the TimeInWeek object itself. + */ + public TimeInWeek withHourSlots(List hourSlots) { + this.hourSlots = hourSlots; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("day", this.day == null ? null : this.day.toString()); + jsonWriter.writeArrayField("hourSlots", this.hourSlots, (writer, element) -> writer.writeInt(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TimeInWeek from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TimeInWeek if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the TimeInWeek. + */ + public static TimeInWeek fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TimeInWeek deserializedTimeInWeek = new TimeInWeek(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("day".equals(fieldName)) { + deserializedTimeInWeek.day = WeekDay.fromString(reader.getString()); + } else if ("hourSlots".equals(fieldName)) { + List hourSlots = reader.readArray(reader1 -> reader1.getInt()); + deserializedTimeInWeek.hourSlots = hourSlots; + } else { + reader.skipChildren(); + } + } + + return deserializedTimeInWeek; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TimeSpan.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TimeSpan.java new file mode 100644 index 000000000000..5f570d7894ce --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TimeSpan.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * A time range. For example, between 2021-05-25T13:00:00Z and 2021-05-25T14:00:00Z. + */ +@Fluent +public final class TimeSpan implements JsonSerializable { + /* + * The start of a time span + */ + private OffsetDateTime start; + + /* + * The end of a time span + */ + private OffsetDateTime end; + + /** + * Creates an instance of TimeSpan class. + */ + public TimeSpan() { + } + + /** + * Get the start property: The start of a time span. + * + * @return the start value. + */ + public OffsetDateTime start() { + return this.start; + } + + /** + * Set the start property: The start of a time span. + * + * @param start the start value to set. + * @return the TimeSpan object itself. + */ + public TimeSpan withStart(OffsetDateTime start) { + this.start = start; + return this; + } + + /** + * Get the end property: The end of a time span. + * + * @return the end value. + */ + public OffsetDateTime end() { + return this.end; + } + + /** + * Set the end property: The end of a time span. + * + * @param end the end value to set. + * @return the TimeSpan object itself. + */ + public TimeSpan withEnd(OffsetDateTime end) { + this.end = end; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("start", + this.start == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.start)); + jsonWriter.writeStringField("end", + this.end == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.end)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TimeSpan from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TimeSpan if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the TimeSpan. + */ + public static TimeSpan fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TimeSpan deserializedTimeSpan = new TimeSpan(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("start".equals(fieldName)) { + deserializedTimeSpan.start = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("end".equals(fieldName)) { + deserializedTimeSpan.end = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedTimeSpan; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TransitEncryptionType.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TransitEncryptionType.java new file mode 100644 index 000000000000..8d434c9ccfbd --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TransitEncryptionType.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Configures pod-to-pod encryption. This can be enabled only on Cilium-based clusters. If not specified, the default + * value is None. + */ +public final class TransitEncryptionType extends ExpandableStringEnum { + /** + * Enable WireGuard encryption. Refer to https://docs.cilium.io/en/latest/security/network/encryption-wireguard/ on + * use cases and implementation details. + */ + public static final TransitEncryptionType WIRE_GUARD = fromString("WireGuard"); + + /** + * Disable Transit encryption. + */ + public static final TransitEncryptionType NONE = fromString("None"); + + /** + * Creates a new instance of TransitEncryptionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TransitEncryptionType() { + } + + /** + * Creates or finds a TransitEncryptionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding TransitEncryptionType. + */ + public static TransitEncryptionType fromString(String name) { + return fromString(name, TransitEncryptionType.class); + } + + /** + * Gets known TransitEncryptionType values. + * + * @return known TransitEncryptionType values. + */ + public static Collection values() { + return values(TransitEncryptionType.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TrustedAccessRole.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TrustedAccessRole.java new file mode 100644 index 000000000000..46d4e1798345 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TrustedAccessRole.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.TrustedAccessRoleInner; +import java.util.List; + +/** + * An immutable client-side representation of TrustedAccessRole. + */ +public interface TrustedAccessRole { + /** + * Gets the sourceResourceType property: Resource type of Azure resource. + * + * @return the sourceResourceType value. + */ + String sourceResourceType(); + + /** + * Gets the name property: Name of role, name is unique under a source resource type. + * + * @return the name value. + */ + String name(); + + /** + * Gets the rules property: 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). + * + * @return the rules value. + */ + List rules(); + + /** + * Gets the inner com.azure.resourcemanager.containerservice.generated.fluent.models.TrustedAccessRoleInner object. + * + * @return the inner object. + */ + TrustedAccessRoleInner innerModel(); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TrustedAccessRoleBinding.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TrustedAccessRoleBinding.java new file mode 100644 index 000000000000..6da9a6ded6bf --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TrustedAccessRoleBinding.java @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.fluent.models.TrustedAccessRoleBindingInner; +import java.util.List; + +/** + * An immutable client-side representation of TrustedAccessRoleBinding. + */ +public interface TrustedAccessRoleBinding { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: The current provisioning state of trusted access role binding. + * + * @return the provisioningState value. + */ + TrustedAccessRoleBindingProvisioningState provisioningState(); + + /** + * Gets the sourceResourceId property: The ARM resource ID of source resource that trusted access is configured for. + * + * @return the sourceResourceId value. + */ + String sourceResourceId(); + + /** + * Gets the roles property: A list of roles to bind, each item is a resource type qualified role name. For example: + * 'Microsoft.MachineLearningServices/workspaces/reader'. + * + * @return the roles value. + */ + List roles(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.containerservice.generated.fluent.models.TrustedAccessRoleBindingInner + * object. + * + * @return the inner object. + */ + TrustedAccessRoleBindingInner innerModel(); + + /** + * The entirety of the TrustedAccessRoleBinding definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, + DefinitionStages.WithSourceResourceId, DefinitionStages.WithRoles, DefinitionStages.WithCreate { + } + + /** + * The TrustedAccessRoleBinding definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the TrustedAccessRoleBinding definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the TrustedAccessRoleBinding definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, resourceName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @return the next definition stage. + */ + WithSourceResourceId withExistingManagedCluster(String resourceGroupName, String resourceName); + } + + /** + * The stage of the TrustedAccessRoleBinding definition allowing to specify sourceResourceId. + */ + interface WithSourceResourceId { + /** + * Specifies the sourceResourceId property: The ARM resource ID of source resource that trusted access is + * configured for.. + * + * @param sourceResourceId The ARM resource ID of source resource that trusted access is configured for. + * @return the next definition stage. + */ + WithRoles withSourceResourceId(String sourceResourceId); + } + + /** + * The stage of the TrustedAccessRoleBinding definition allowing to specify roles. + */ + interface WithRoles { + /** + * Specifies the roles property: A list of roles to bind, each item is a resource type qualified role name. + * For example: 'Microsoft.MachineLearningServices/workspaces/reader'.. + * + * @param roles A list of roles to bind, each item is a resource type qualified role name. For example: + * 'Microsoft.MachineLearningServices/workspaces/reader'. + * @return the next definition stage. + */ + WithCreate withRoles(List roles); + } + + /** + * The stage of the TrustedAccessRoleBinding definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate { + /** + * Executes the create request. + * + * @return the created resource. + */ + TrustedAccessRoleBinding create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + TrustedAccessRoleBinding create(Context context); + } + } + + /** + * Begins update for the TrustedAccessRoleBinding resource. + * + * @return the stage of resource update. + */ + TrustedAccessRoleBinding.Update update(); + + /** + * The template for TrustedAccessRoleBinding update. + */ + interface Update extends UpdateStages.WithSourceResourceId, UpdateStages.WithRoles { + /** + * Executes the update request. + * + * @return the updated resource. + */ + TrustedAccessRoleBinding apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + TrustedAccessRoleBinding apply(Context context); + } + + /** + * The TrustedAccessRoleBinding update stages. + */ + interface UpdateStages { + /** + * The stage of the TrustedAccessRoleBinding update allowing to specify sourceResourceId. + */ + interface WithSourceResourceId { + /** + * Specifies the sourceResourceId property: The ARM resource ID of source resource that trusted access is + * configured for.. + * + * @param sourceResourceId The ARM resource ID of source resource that trusted access is configured for. + * @return the next definition stage. + */ + Update withSourceResourceId(String sourceResourceId); + } + + /** + * The stage of the TrustedAccessRoleBinding update allowing to specify roles. + */ + interface WithRoles { + /** + * Specifies the roles property: A list of roles to bind, each item is a resource type qualified role name. + * For example: 'Microsoft.MachineLearningServices/workspaces/reader'.. + * + * @param roles A list of roles to bind, each item is a resource type qualified role name. For example: + * 'Microsoft.MachineLearningServices/workspaces/reader'. + * @return the next definition stage. + */ + Update withRoles(List roles); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + TrustedAccessRoleBinding refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + TrustedAccessRoleBinding refresh(Context context); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TrustedAccessRoleBindingProvisioningState.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TrustedAccessRoleBindingProvisioningState.java new file mode 100644 index 000000000000..cd94244dcdfd --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TrustedAccessRoleBindingProvisioningState.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The current provisioning state of trusted access role binding. + */ +public final class TrustedAccessRoleBindingProvisioningState + extends ExpandableStringEnum { + /** + * Trusted access role binding provisioning was canceled. + */ + public static final TrustedAccessRoleBindingProvisioningState CANCELED = fromString("Canceled"); + + /** + * Trusted access role binding is being deleted. + */ + public static final TrustedAccessRoleBindingProvisioningState DELETING = fromString("Deleting"); + + /** + * Trusted access role binding provisioning failed. + */ + public static final TrustedAccessRoleBindingProvisioningState FAILED = fromString("Failed"); + + /** + * Trusted access role binding provisioning succeeded. + */ + public static final TrustedAccessRoleBindingProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Trusted access role binding is being updated. + */ + public static final TrustedAccessRoleBindingProvisioningState UPDATING = fromString("Updating"); + + /** + * Creates a new instance of TrustedAccessRoleBindingProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TrustedAccessRoleBindingProvisioningState() { + } + + /** + * Creates or finds a TrustedAccessRoleBindingProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding TrustedAccessRoleBindingProvisioningState. + */ + public static TrustedAccessRoleBindingProvisioningState fromString(String name) { + return fromString(name, TrustedAccessRoleBindingProvisioningState.class); + } + + /** + * Gets known TrustedAccessRoleBindingProvisioningState values. + * + * @return known TrustedAccessRoleBindingProvisioningState values. + */ + public static Collection values() { + return values(TrustedAccessRoleBindingProvisioningState.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TrustedAccessRoleBindings.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TrustedAccessRoleBindings.java new file mode 100644 index 000000000000..8cb4b453d337 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TrustedAccessRoleBindings.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of TrustedAccessRoleBindings. + */ +public interface TrustedAccessRoleBindings { + /** + * Get a trusted access role binding. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param trustedAccessRoleBindingName The name of trusted access role binding. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a trusted access role binding along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String resourceName, + String trustedAccessRoleBindingName, Context context); + + /** + * Get a trusted access role binding. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param trustedAccessRoleBindingName The name of trusted access role binding. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a trusted access role binding. + */ + TrustedAccessRoleBinding get(String resourceGroupName, String resourceName, String trustedAccessRoleBindingName); + + /** + * Delete a trusted access role binding. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param trustedAccessRoleBindingName The name of trusted access role binding. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String resourceName, String trustedAccessRoleBindingName); + + /** + * Delete a trusted access role binding. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param trustedAccessRoleBindingName The name of trusted access role binding. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String resourceName, String trustedAccessRoleBindingName, Context context); + + /** + * List trusted access role bindings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TrustedAccessRoleBinding list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String resourceName); + + /** + * List trusted access role bindings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TrustedAccessRoleBinding list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String resourceName, Context context); + + /** + * Get a trusted access role binding. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a trusted access role binding along with {@link Response}. + */ + TrustedAccessRoleBinding getById(String id); + + /** + * Get a trusted access role binding. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a trusted access role binding along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a trusted access role binding. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a trusted access role binding. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new TrustedAccessRoleBinding resource. + * + * @param name resource name. + * @return the first stage of the new TrustedAccessRoleBinding definition. + */ + TrustedAccessRoleBinding.DefinitionStages.Blank define(String name); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TrustedAccessRoleRule.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TrustedAccessRoleRule.java new file mode 100644 index 000000000000..865cbebdee75 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TrustedAccessRoleRule.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Rule for trusted access role. + */ +@Immutable +public final class TrustedAccessRoleRule implements JsonSerializable { + /* + * List of allowed verbs + */ + private List verbs; + + /* + * List of allowed apiGroups + */ + private List apiGroups; + + /* + * List of allowed resources + */ + private List resources; + + /* + * List of allowed names + */ + private List resourceNames; + + /* + * List of allowed nonResourceURLs + */ + private List nonResourceUrls; + + /** + * Creates an instance of TrustedAccessRoleRule class. + */ + private TrustedAccessRoleRule() { + } + + /** + * Get the verbs property: List of allowed verbs. + * + * @return the verbs value. + */ + public List verbs() { + return this.verbs; + } + + /** + * Get the apiGroups property: List of allowed apiGroups. + * + * @return the apiGroups value. + */ + public List apiGroups() { + return this.apiGroups; + } + + /** + * Get the resources property: List of allowed resources. + * + * @return the resources value. + */ + public List resources() { + return this.resources; + } + + /** + * Get the resourceNames property: List of allowed names. + * + * @return the resourceNames value. + */ + public List resourceNames() { + return this.resourceNames; + } + + /** + * Get the nonResourceUrls property: List of allowed nonResourceURLs. + * + * @return the nonResourceUrls value. + */ + public List nonResourceUrls() { + return this.nonResourceUrls; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TrustedAccessRoleRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TrustedAccessRoleRule if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the TrustedAccessRoleRule. + */ + public static TrustedAccessRoleRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TrustedAccessRoleRule deserializedTrustedAccessRoleRule = new TrustedAccessRoleRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("verbs".equals(fieldName)) { + List verbs = reader.readArray(reader1 -> reader1.getString()); + deserializedTrustedAccessRoleRule.verbs = verbs; + } else if ("apiGroups".equals(fieldName)) { + List apiGroups = reader.readArray(reader1 -> reader1.getString()); + deserializedTrustedAccessRoleRule.apiGroups = apiGroups; + } else if ("resources".equals(fieldName)) { + List resources = reader.readArray(reader1 -> reader1.getString()); + deserializedTrustedAccessRoleRule.resources = resources; + } else if ("resourceNames".equals(fieldName)) { + List resourceNames = reader.readArray(reader1 -> reader1.getString()); + deserializedTrustedAccessRoleRule.resourceNames = resourceNames; + } else if ("nonResourceURLs".equals(fieldName)) { + List nonResourceUrls = reader.readArray(reader1 -> reader1.getString()); + deserializedTrustedAccessRoleRule.nonResourceUrls = nonResourceUrls; + } else { + reader.skipChildren(); + } + } + + return deserializedTrustedAccessRoleRule; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TrustedAccessRoles.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TrustedAccessRoles.java new file mode 100644 index 000000000000..75c2d8b9a5ea --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TrustedAccessRoles.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of TrustedAccessRoles. + */ +public interface TrustedAccessRoles { + /** + * List supported trusted access roles. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of trusted access roles as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String location); + + /** + * List supported trusted access roles. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of trusted access roles as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String location, Context context); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Type.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Type.java new file mode 100644 index 000000000000..376821aab2ac --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Type.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The week index. Specifies on which week of the month the dayOfWeek applies. + */ +public final class Type extends ExpandableStringEnum { + /** + * First week of the month. + */ + public static final Type FIRST = fromString("First"); + + /** + * Second week of the month. + */ + public static final Type SECOND = fromString("Second"); + + /** + * Third week of the month. + */ + public static final Type THIRD = fromString("Third"); + + /** + * Fourth week of the month. + */ + public static final Type FOURTH = fromString("Fourth"); + + /** + * Last week of the month. + */ + public static final Type LAST = fromString("Last"); + + /** + * Creates a new instance of Type value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Type() { + } + + /** + * Creates or finds a Type from its string representation. + * + * @param name a name to look for. + * @return the corresponding Type. + */ + public static Type fromString(String name) { + return fromString(name, Type.class); + } + + /** + * Gets known Type values. + * + * @return known Type values. + */ + public static Collection values() { + return values(Type.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/UndrainableNodeBehavior.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/UndrainableNodeBehavior.java new file mode 100644 index 000000000000..9f0830fb88f0 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/UndrainableNodeBehavior.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines the behavior for undrainable nodes during upgrade. The most common cause of undrainable nodes is Pod + * Disruption Budgets (PDBs), but other issues, such as pod termination grace period is exceeding the remaining per-node + * drain timeout or pod is still being in a running state, can also cause undrainable nodes. + */ +public final class UndrainableNodeBehavior extends ExpandableStringEnum { + /** + * AKS will cordon the blocked nodes and replace them with surge nodes during upgrade. The blocked nodes will be + * cordoned and replaced by surge nodes. The blocked nodes will have label + * 'kubernetes.azure.com/upgrade-status:Quarantined'. A surge node will be retained for each blocked node. A + * best-effort attempt will be made to delete all other surge nodes. If there are enough surge nodes to replace + * blocked nodes, then the upgrade operation and the managed cluster will be in failed state. Otherwise, the upgrade + * operation and the managed cluster will be in canceled state. + */ + public static final UndrainableNodeBehavior CORDON = fromString("Cordon"); + + /** + * AKS will mark the blocked nodes schedulable, but the blocked nodes are not upgraded. A best-effort attempt will + * be made to delete all surge nodes. The upgrade operation and the managed cluster will be in failed state if there + * are any blocked nodes. + */ + public static final UndrainableNodeBehavior SCHEDULE = fromString("Schedule"); + + /** + * Creates a new instance of UndrainableNodeBehavior value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public UndrainableNodeBehavior() { + } + + /** + * Creates or finds a UndrainableNodeBehavior from its string representation. + * + * @param name a name to look for. + * @return the corresponding UndrainableNodeBehavior. + */ + public static UndrainableNodeBehavior fromString(String name) { + return fromString(name, UndrainableNodeBehavior.class); + } + + /** + * Gets known UndrainableNodeBehavior values. + * + * @return known UndrainableNodeBehavior values. + */ + public static Collection values() { + return values(UndrainableNodeBehavior.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/UpgradeChannel.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/UpgradeChannel.java new file mode 100644 index 000000000000..51072b0ceb22 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/UpgradeChannel.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The upgrade channel for auto upgrade. The default is 'none'. For more information see [setting the AKS cluster + * auto-upgrade channel](https://docs.microsoft.com/azure/aks/upgrade-cluster#set-auto-upgrade-channel). + */ +public final class UpgradeChannel extends ExpandableStringEnum { + /** + * 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 final UpgradeChannel RAPID = fromString("rapid"); + + /** + * 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 final UpgradeChannel STABLE = fromString("stable"); + + /** + * 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 final UpgradeChannel PATCH = fromString("patch"); + + /** + * 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 final UpgradeChannel NODE_IMAGE = fromString("node-image"); + + /** + * Disables auto-upgrades and keeps the cluster at its current version of Kubernetes. + */ + public static final UpgradeChannel NONE = fromString("none"); + + /** + * Creates a new instance of UpgradeChannel value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public UpgradeChannel() { + } + + /** + * Creates or finds a UpgradeChannel from its string representation. + * + * @param name a name to look for. + * @return the corresponding UpgradeChannel. + */ + public static UpgradeChannel fromString(String name) { + return fromString(name, UpgradeChannel.class); + } + + /** + * Gets known UpgradeChannel values. + * + * @return known UpgradeChannel values. + */ + public static Collection values() { + return values(UpgradeChannel.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/UpgradeOverrideSettings.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/UpgradeOverrideSettings.java new file mode 100644 index 000000000000..1e5586c292de --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/UpgradeOverrideSettings.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Settings for overrides when upgrading a cluster. + */ +@Fluent +public final class UpgradeOverrideSettings implements JsonSerializable { + /* + * 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. + */ + private Boolean forceUpgrade; + + /* + * 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. + */ + private OffsetDateTime until; + + /** + * Creates an instance of UpgradeOverrideSettings class. + */ + public UpgradeOverrideSettings() { + } + + /** + * Get the forceUpgrade property: 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. + * + * @return the forceUpgrade value. + */ + public Boolean forceUpgrade() { + return this.forceUpgrade; + } + + /** + * Set the forceUpgrade property: 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. + * + * @param forceUpgrade the forceUpgrade value to set. + * @return the UpgradeOverrideSettings object itself. + */ + public UpgradeOverrideSettings withForceUpgrade(Boolean forceUpgrade) { + this.forceUpgrade = forceUpgrade; + return this; + } + + /** + * Get the until property: 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. + * + * @return the until value. + */ + public OffsetDateTime until() { + return this.until; + } + + /** + * Set the until property: 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. + * + * @param until the until value to set. + * @return the UpgradeOverrideSettings object itself. + */ + public UpgradeOverrideSettings withUntil(OffsetDateTime until) { + this.until = until; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("forceUpgrade", this.forceUpgrade); + jsonWriter.writeStringField("until", + this.until == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.until)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpgradeOverrideSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpgradeOverrideSettings if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the UpgradeOverrideSettings. + */ + public static UpgradeOverrideSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpgradeOverrideSettings deserializedUpgradeOverrideSettings = new UpgradeOverrideSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("forceUpgrade".equals(fieldName)) { + deserializedUpgradeOverrideSettings.forceUpgrade = reader.getNullable(JsonReader::getBoolean); + } else if ("until".equals(fieldName)) { + deserializedUpgradeOverrideSettings.until = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedUpgradeOverrideSettings; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/UserAssignedIdentity.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/UserAssignedIdentity.java new file mode 100644 index 000000000000..8bcbe46e64de --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/UserAssignedIdentity.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Details about a user assigned identity. + */ +@Fluent +public class UserAssignedIdentity implements JsonSerializable { + /* + * The resource ID of the user assigned identity. + */ + private String resourceId; + + /* + * The client ID of the user assigned identity. + */ + private String clientId; + + /* + * The object ID of the user assigned identity. + */ + private String objectId; + + /** + * Creates an instance of UserAssignedIdentity class. + */ + public UserAssignedIdentity() { + } + + /** + * Get the resourceId property: The resource ID of the user assigned identity. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: The resource ID of the user assigned identity. + * + * @param resourceId the resourceId value to set. + * @return the UserAssignedIdentity object itself. + */ + public UserAssignedIdentity withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the clientId property: The client ID of the user assigned identity. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: The client ID of the user assigned identity. + * + * @param clientId the clientId value to set. + * @return the UserAssignedIdentity object itself. + */ + public UserAssignedIdentity withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the objectId property: The object ID of the user assigned identity. + * + * @return the objectId value. + */ + public String objectId() { + return this.objectId; + } + + /** + * Set the objectId property: The object ID of the user assigned identity. + * + * @param objectId the objectId value to set. + * @return the UserAssignedIdentity object itself. + */ + public UserAssignedIdentity withObjectId(String objectId) { + this.objectId = objectId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeStringField("clientId", this.clientId); + jsonWriter.writeStringField("objectId", this.objectId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserAssignedIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserAssignedIdentity if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the UserAssignedIdentity. + */ + public static UserAssignedIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserAssignedIdentity deserializedUserAssignedIdentity = new UserAssignedIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceId".equals(fieldName)) { + deserializedUserAssignedIdentity.resourceId = reader.getString(); + } else if ("clientId".equals(fieldName)) { + deserializedUserAssignedIdentity.clientId = reader.getString(); + } else if ("objectId".equals(fieldName)) { + deserializedUserAssignedIdentity.objectId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUserAssignedIdentity; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/VirtualMachineNodes.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/VirtualMachineNodes.java new file mode 100644 index 000000000000..c18b102d838b --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/VirtualMachineNodes.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Current status on a group of nodes of the same vm size. + */ +@Fluent +public final class VirtualMachineNodes implements JsonSerializable { + /* + * The VM size of the agents used to host this group of nodes. + */ + private String size; + + /* + * Number of nodes. + */ + private Integer count; + + /** + * Creates an instance of VirtualMachineNodes class. + */ + public VirtualMachineNodes() { + } + + /** + * Get the size property: The VM size of the agents used to host this group of nodes. + * + * @return the size value. + */ + public String size() { + return this.size; + } + + /** + * Set the size property: The VM size of the agents used to host this group of nodes. + * + * @param size the size value to set. + * @return the VirtualMachineNodes object itself. + */ + public VirtualMachineNodes withSize(String size) { + this.size = size; + return this; + } + + /** + * Get the count property: Number of nodes. + * + * @return the count value. + */ + public Integer count() { + return this.count; + } + + /** + * Set the count property: Number of nodes. + * + * @param count the count value to set. + * @return the VirtualMachineNodes object itself. + */ + public VirtualMachineNodes withCount(Integer count) { + this.count = count; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("size", this.size); + jsonWriter.writeNumberField("count", this.count); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachineNodes from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineNodes if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualMachineNodes. + */ + public static VirtualMachineNodes fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineNodes deserializedVirtualMachineNodes = new VirtualMachineNodes(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("size".equals(fieldName)) { + deserializedVirtualMachineNodes.size = reader.getString(); + } else if ("count".equals(fieldName)) { + deserializedVirtualMachineNodes.count = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineNodes; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/VirtualMachinesProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/VirtualMachinesProfile.java new file mode 100644 index 000000000000..734307498f10 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/VirtualMachinesProfile.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Specifications on VirtualMachines agent pool. + */ +@Fluent +public final class VirtualMachinesProfile implements JsonSerializable { + /* + * Specifications on how to scale a VirtualMachines agent pool. + */ + private ScaleProfile scale; + + /** + * Creates an instance of VirtualMachinesProfile class. + */ + public VirtualMachinesProfile() { + } + + /** + * Get the scale property: Specifications on how to scale a VirtualMachines agent pool. + * + * @return the scale value. + */ + public ScaleProfile scale() { + return this.scale; + } + + /** + * Set the scale property: Specifications on how to scale a VirtualMachines agent pool. + * + * @param scale the scale value to set. + * @return the VirtualMachinesProfile object itself. + */ + public VirtualMachinesProfile withScale(ScaleProfile scale) { + this.scale = scale; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("scale", this.scale); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachinesProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachinesProfile if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualMachinesProfile. + */ + public static VirtualMachinesProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachinesProfile deserializedVirtualMachinesProfile = new VirtualMachinesProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("scale".equals(fieldName)) { + deserializedVirtualMachinesProfile.scale = ScaleProfile.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachinesProfile; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/WeekDay.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/WeekDay.java new file mode 100644 index 000000000000..f9ceaa5dc8b8 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/WeekDay.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The weekday enum. + */ +public final class WeekDay extends ExpandableStringEnum { + /** + * Represents Sunday. + */ + public static final WeekDay SUNDAY = fromString("Sunday"); + + /** + * Represents Monday. + */ + public static final WeekDay MONDAY = fromString("Monday"); + + /** + * Represents Tuesday. + */ + public static final WeekDay TUESDAY = fromString("Tuesday"); + + /** + * Represents Wednesday. + */ + public static final WeekDay WEDNESDAY = fromString("Wednesday"); + + /** + * Represents Thursday. + */ + public static final WeekDay THURSDAY = fromString("Thursday"); + + /** + * Represents Friday. + */ + public static final WeekDay FRIDAY = fromString("Friday"); + + /** + * Represents Saturday. + */ + public static final WeekDay SATURDAY = fromString("Saturday"); + + /** + * Creates a new instance of WeekDay value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WeekDay() { + } + + /** + * Creates or finds a WeekDay from its string representation. + * + * @param name a name to look for. + * @return the corresponding WeekDay. + */ + public static WeekDay fromString(String name) { + return fromString(name, WeekDay.class); + } + + /** + * Gets known WeekDay values. + * + * @return known WeekDay values. + */ + public static Collection values() { + return values(WeekDay.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/WeeklySchedule.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/WeeklySchedule.java new file mode 100644 index 000000000000..badb4aecc97c --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/WeeklySchedule.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * For schedules like: 'recur every Monday' or 'recur every 3 weeks on Wednesday'. + */ +@Fluent +public final class WeeklySchedule implements JsonSerializable { + /* + * Specifies the number of weeks between each set of occurrences. + */ + private int intervalWeeks; + + /* + * Specifies on which day of the week the maintenance occurs. + */ + private WeekDay dayOfWeek; + + /** + * Creates an instance of WeeklySchedule class. + */ + public WeeklySchedule() { + } + + /** + * Get the intervalWeeks property: Specifies the number of weeks between each set of occurrences. + * + * @return the intervalWeeks value. + */ + public int intervalWeeks() { + return this.intervalWeeks; + } + + /** + * Set the intervalWeeks property: Specifies the number of weeks between each set of occurrences. + * + * @param intervalWeeks the intervalWeeks value to set. + * @return the WeeklySchedule object itself. + */ + public WeeklySchedule withIntervalWeeks(int intervalWeeks) { + this.intervalWeeks = intervalWeeks; + return this; + } + + /** + * Get the dayOfWeek property: Specifies on which day of the week the maintenance occurs. + * + * @return the dayOfWeek value. + */ + public WeekDay dayOfWeek() { + return this.dayOfWeek; + } + + /** + * Set the dayOfWeek property: Specifies on which day of the week the maintenance occurs. + * + * @param dayOfWeek the dayOfWeek value to set. + * @return the WeeklySchedule object itself. + */ + public WeeklySchedule withDayOfWeek(WeekDay dayOfWeek) { + this.dayOfWeek = dayOfWeek; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("intervalWeeks", this.intervalWeeks); + jsonWriter.writeStringField("dayOfWeek", this.dayOfWeek == null ? null : this.dayOfWeek.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WeeklySchedule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WeeklySchedule if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the WeeklySchedule. + */ + public static WeeklySchedule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WeeklySchedule deserializedWeeklySchedule = new WeeklySchedule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("intervalWeeks".equals(fieldName)) { + deserializedWeeklySchedule.intervalWeeks = reader.getInt(); + } else if ("dayOfWeek".equals(fieldName)) { + deserializedWeeklySchedule.dayOfWeek = WeekDay.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedWeeklySchedule; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/WindowsGmsaProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/WindowsGmsaProfile.java new file mode 100644 index 000000000000..131808dd8270 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/WindowsGmsaProfile.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Windows gMSA Profile in the managed cluster. + */ +@Fluent +public final class WindowsGmsaProfile implements JsonSerializable { + /* + * Whether to enable Windows gMSA. Specifies whether to enable Windows gMSA in the managed cluster. + */ + private Boolean enabled; + + /* + * Specifies the DNS server for Windows gMSA.

Set it to empty if you have configured the DNS server in the + * vnet which is used to create the managed cluster. + */ + private String dnsServer; + + /* + * Specifies the root domain name for Windows gMSA.

Set it to empty if you have configured the DNS server + * in the vnet which is used to create the managed cluster. + */ + private String rootDomainName; + + /** + * Creates an instance of WindowsGmsaProfile class. + */ + public WindowsGmsaProfile() { + } + + /** + * Get the enabled property: Whether to enable Windows gMSA. Specifies whether to enable Windows gMSA in the managed + * cluster. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Whether to enable Windows gMSA. Specifies whether to enable Windows gMSA in the managed + * cluster. + * + * @param enabled the enabled value to set. + * @return the WindowsGmsaProfile object itself. + */ + public WindowsGmsaProfile withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the dnsServer property: 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. + * + * @return the dnsServer value. + */ + public String dnsServer() { + return this.dnsServer; + } + + /** + * Set the dnsServer property: 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. + * + * @param dnsServer the dnsServer value to set. + * @return the WindowsGmsaProfile object itself. + */ + public WindowsGmsaProfile withDnsServer(String dnsServer) { + this.dnsServer = dnsServer; + return this; + } + + /** + * Get the rootDomainName property: 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. + * + * @return the rootDomainName value. + */ + public String rootDomainName() { + return this.rootDomainName; + } + + /** + * Set the rootDomainName property: 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. + * + * @param rootDomainName the rootDomainName value to set. + * @return the WindowsGmsaProfile object itself. + */ + public WindowsGmsaProfile withRootDomainName(String rootDomainName) { + this.rootDomainName = rootDomainName; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeStringField("dnsServer", this.dnsServer); + jsonWriter.writeStringField("rootDomainName", this.rootDomainName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WindowsGmsaProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WindowsGmsaProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the WindowsGmsaProfile. + */ + public static WindowsGmsaProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WindowsGmsaProfile deserializedWindowsGmsaProfile = new WindowsGmsaProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedWindowsGmsaProfile.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("dnsServer".equals(fieldName)) { + deserializedWindowsGmsaProfile.dnsServer = reader.getString(); + } else if ("rootDomainName".equals(fieldName)) { + deserializedWindowsGmsaProfile.rootDomainName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedWindowsGmsaProfile; + }); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/WorkloadRuntime.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/WorkloadRuntime.java new file mode 100644 index 000000000000..4dd8480876aa --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/WorkloadRuntime.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Determines the type of workload a node can run. + */ +public final class WorkloadRuntime extends ExpandableStringEnum { + /** + * Nodes will use Kubelet to run standard OCI container workloads. + */ + public static final WorkloadRuntime OCICONTAINER = fromString("OCIContainer"); + + /** + * Nodes will use Krustlet to run WASM workloads using the WASI provider (Preview). + */ + public static final WorkloadRuntime WASM_WASI = fromString("WasmWasi"); + + /** + * Nodes can use (Kata + Cloud Hypervisor + Hyper-V) to enable Nested VM-based pods. Due to the use Hyper-V, AKS + * node OS itself is a nested VM (the root OS) of Hyper-V. Thus it can only be used with VM series that support + * Nested Virtualization such as Dv3 series. + */ + public static final WorkloadRuntime KATA_VM_ISOLATION = fromString("KataVmIsolation"); + + /** + * Creates a new instance of WorkloadRuntime value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WorkloadRuntime() { + } + + /** + * Creates or finds a WorkloadRuntime from its string representation. + * + * @param name a name to look for. + * @return the corresponding WorkloadRuntime. + */ + public static WorkloadRuntime fromString(String name) { + return fromString(name, WorkloadRuntime.class); + } + + /** + * Gets known WorkloadRuntime values. + * + * @return known WorkloadRuntime values. + */ + public static Collection values() { + return values(WorkloadRuntime.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/package-info.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/package-info.java new file mode 100644 index 000000000000..5cb288a50c29 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the data models for ContainerService. + * The Container Service Client. + */ +package com.azure.resourcemanager.containerservice.generated.models; diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/package-info.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/package-info.java new file mode 100644 index 000000000000..3ae854c49939 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the classes for ContainerService. + * The Container Service Client. + */ +package com.azure.resourcemanager.containerservice.generated; diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/module-info.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/module-info.java new file mode 100644 index 000000000000..830d6e19e925 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/module-info.java @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +module com.azure.resourcemanager.containerservice.generated { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.containerservice.generated; + exports com.azure.resourcemanager.containerservice.generated.fluent; + exports com.azure.resourcemanager.containerservice.generated.fluent.models; + exports com.azure.resourcemanager.containerservice.generated.models; + + opens com.azure.resourcemanager.containerservice.generated.fluent.models to com.azure.core; + opens com.azure.resourcemanager.containerservice.generated.models to com.azure.core; + opens com.azure.resourcemanager.containerservice.generated.implementation.models to com.azure.core; +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/resources/META-INF/azure-resourcemanager-containerservice-generated_metadata.json b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/resources/META-INF/azure-resourcemanager-containerservice-generated_metadata.json new file mode 100644 index 000000000000..8d737f765149 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/resources/META-INF/azure-resourcemanager-containerservice-generated_metadata.json @@ -0,0 +1 @@ +{"flavor":"azure","apiVersions":{"Microsoft.ContainerService":"2026-01-01"},"crossLanguageDefinitions":{"com.azure.resourcemanager.containerservice.generated.fluent.AgentPoolsClient":"Microsoft.ContainerService.AgentPools","com.azure.resourcemanager.containerservice.generated.fluent.AgentPoolsClient.abortLatestOperation":"Microsoft.ContainerService.AgentPools.abortLatestOperation","com.azure.resourcemanager.containerservice.generated.fluent.AgentPoolsClient.beginAbortLatestOperation":"Microsoft.ContainerService.AgentPools.abortLatestOperation","com.azure.resourcemanager.containerservice.generated.fluent.AgentPoolsClient.beginCreateOrUpdate":"Microsoft.ContainerService.AgentPools.createOrUpdate","com.azure.resourcemanager.containerservice.generated.fluent.AgentPoolsClient.beginDelete":"Microsoft.ContainerService.AgentPools.delete","com.azure.resourcemanager.containerservice.generated.fluent.AgentPoolsClient.beginDeleteMachines":"Microsoft.ContainerService.AgentPools.deleteMachines","com.azure.resourcemanager.containerservice.generated.fluent.AgentPoolsClient.beginUpgradeNodeImageVersion":"Microsoft.ContainerService.AgentPools.upgradeNodeImageVersion","com.azure.resourcemanager.containerservice.generated.fluent.AgentPoolsClient.createOrUpdate":"Microsoft.ContainerService.AgentPools.createOrUpdate","com.azure.resourcemanager.containerservice.generated.fluent.AgentPoolsClient.delete":"Microsoft.ContainerService.AgentPools.delete","com.azure.resourcemanager.containerservice.generated.fluent.AgentPoolsClient.deleteMachines":"Microsoft.ContainerService.AgentPools.deleteMachines","com.azure.resourcemanager.containerservice.generated.fluent.AgentPoolsClient.get":"Microsoft.ContainerService.AgentPools.get","com.azure.resourcemanager.containerservice.generated.fluent.AgentPoolsClient.getAvailableAgentPoolVersions":"Microsoft.ContainerService.ManagedClusters.getAvailableAgentPoolVersions","com.azure.resourcemanager.containerservice.generated.fluent.AgentPoolsClient.getAvailableAgentPoolVersionsWithResponse":"Microsoft.ContainerService.ManagedClusters.getAvailableAgentPoolVersions","com.azure.resourcemanager.containerservice.generated.fluent.AgentPoolsClient.getUpgradeProfile":"Microsoft.ContainerService.AgentPoolUpgradeProfiles.getUpgradeProfile","com.azure.resourcemanager.containerservice.generated.fluent.AgentPoolsClient.getUpgradeProfileWithResponse":"Microsoft.ContainerService.AgentPoolUpgradeProfiles.getUpgradeProfile","com.azure.resourcemanager.containerservice.generated.fluent.AgentPoolsClient.getWithResponse":"Microsoft.ContainerService.AgentPools.get","com.azure.resourcemanager.containerservice.generated.fluent.AgentPoolsClient.list":"Microsoft.ContainerService.AgentPools.list","com.azure.resourcemanager.containerservice.generated.fluent.AgentPoolsClient.upgradeNodeImageVersion":"Microsoft.ContainerService.AgentPools.upgradeNodeImageVersion","com.azure.resourcemanager.containerservice.generated.fluent.ContainerServiceManagementClient":"Microsoft.ContainerService","com.azure.resourcemanager.containerservice.generated.fluent.MachinesClient":"Microsoft.ContainerService.Machines","com.azure.resourcemanager.containerservice.generated.fluent.MachinesClient.get":"Microsoft.ContainerService.Machines.get","com.azure.resourcemanager.containerservice.generated.fluent.MachinesClient.getWithResponse":"Microsoft.ContainerService.Machines.get","com.azure.resourcemanager.containerservice.generated.fluent.MachinesClient.list":"Microsoft.ContainerService.Machines.list","com.azure.resourcemanager.containerservice.generated.fluent.MaintenanceConfigurationsClient":"Microsoft.ContainerService.MaintenanceConfigurations","com.azure.resourcemanager.containerservice.generated.fluent.MaintenanceConfigurationsClient.createOrUpdate":"Microsoft.ContainerService.MaintenanceConfigurations.createOrUpdate","com.azure.resourcemanager.containerservice.generated.fluent.MaintenanceConfigurationsClient.createOrUpdateWithResponse":"Microsoft.ContainerService.MaintenanceConfigurations.createOrUpdate","com.azure.resourcemanager.containerservice.generated.fluent.MaintenanceConfigurationsClient.delete":"Microsoft.ContainerService.MaintenanceConfigurations.delete","com.azure.resourcemanager.containerservice.generated.fluent.MaintenanceConfigurationsClient.deleteWithResponse":"Microsoft.ContainerService.MaintenanceConfigurations.delete","com.azure.resourcemanager.containerservice.generated.fluent.MaintenanceConfigurationsClient.get":"Microsoft.ContainerService.MaintenanceConfigurations.get","com.azure.resourcemanager.containerservice.generated.fluent.MaintenanceConfigurationsClient.getWithResponse":"Microsoft.ContainerService.MaintenanceConfigurations.get","com.azure.resourcemanager.containerservice.generated.fluent.MaintenanceConfigurationsClient.listByManagedCluster":"Microsoft.ContainerService.MaintenanceConfigurations.listByManagedCluster","com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient":"Microsoft.ContainerService.ManagedClusters","com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient.abortLatestOperation":"Microsoft.ContainerService.ManagedClusters.abortLatestOperation","com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient.beginAbortLatestOperation":"Microsoft.ContainerService.ManagedClusters.abortLatestOperation","com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient.beginCreateOrUpdate":"Microsoft.ContainerService.ManagedClusters.createOrUpdate","com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient.beginDelete":"Microsoft.ContainerService.ManagedClusters.delete","com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient.beginResetAADProfile":"Microsoft.ContainerService.ManagedClusters.resetAADProfile","com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient.beginResetServicePrincipalProfile":"Microsoft.ContainerService.ManagedClusters.resetServicePrincipalProfile","com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient.beginRotateClusterCertificates":"Microsoft.ContainerService.ManagedClusters.rotateClusterCertificates","com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient.beginRotateServiceAccountSigningKeys":"Microsoft.ContainerService.ManagedClusters.rotateServiceAccountSigningKeys","com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient.beginRunCommand":"Microsoft.ContainerService.ManagedClusters.runCommand","com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient.beginStart":"Microsoft.ContainerService.ManagedClusters.start","com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient.beginStop":"Microsoft.ContainerService.ManagedClusters.stop","com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient.beginUpdateTags":"Microsoft.ContainerService.ManagedClusters.updateTags","com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient.createOrUpdate":"Microsoft.ContainerService.ManagedClusters.createOrUpdate","com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient.delete":"Microsoft.ContainerService.ManagedClusters.delete","com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient.getAccessProfile":"Microsoft.ContainerService.ManagedClusters.getAccessProfile","com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient.getAccessProfileWithResponse":"Microsoft.ContainerService.ManagedClusters.getAccessProfile","com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient.getByResourceGroup":"Microsoft.ContainerService.ManagedClusters.get","com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient.getByResourceGroupWithResponse":"Microsoft.ContainerService.ManagedClusters.get","com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient.getCommandResult":"Microsoft.ContainerService.ManagedClusters.getCommandResult","com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient.getCommandResultWithResponse":"Microsoft.ContainerService.ManagedClusters.getCommandResult","com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient.getMeshRevisionProfile":"Microsoft.ContainerService.MeshRevisionProfiles.getMeshRevisionProfile","com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient.getMeshRevisionProfileWithResponse":"Microsoft.ContainerService.MeshRevisionProfiles.getMeshRevisionProfile","com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient.getMeshUpgradeProfile":"Microsoft.ContainerService.MeshUpgradeProfiles.getMeshUpgradeProfile","com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient.getMeshUpgradeProfileWithResponse":"Microsoft.ContainerService.MeshUpgradeProfiles.getMeshUpgradeProfile","com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient.getUpgradeProfile":"Microsoft.ContainerService.ManagedClusterUpgradeProfiles.getUpgradeProfile","com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient.getUpgradeProfileWithResponse":"Microsoft.ContainerService.ManagedClusterUpgradeProfiles.getUpgradeProfile","com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient.list":"Microsoft.ContainerService.ManagedClusters.list","com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient.listByResourceGroup":"Microsoft.ContainerService.ManagedClusters.listByResourceGroup","com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient.listClusterAdminCredentials":"Microsoft.ContainerService.ManagedClusters.listClusterAdminCredentials","com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient.listClusterAdminCredentialsWithResponse":"Microsoft.ContainerService.ManagedClusters.listClusterAdminCredentials","com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient.listClusterMonitoringUserCredentials":"Microsoft.ContainerService.ManagedClusters.listClusterMonitoringUserCredentials","com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient.listClusterMonitoringUserCredentialsWithResponse":"Microsoft.ContainerService.ManagedClusters.listClusterMonitoringUserCredentials","com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient.listClusterUserCredentials":"Microsoft.ContainerService.ManagedClusters.listClusterUserCredentials","com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient.listClusterUserCredentialsWithResponse":"Microsoft.ContainerService.ManagedClusters.listClusterUserCredentials","com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient.listKubernetesVersions":"Microsoft.ContainerService.ManagedClustersOperationGroup.listKubernetesVersions","com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient.listKubernetesVersionsWithResponse":"Microsoft.ContainerService.ManagedClustersOperationGroup.listKubernetesVersions","com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient.listMeshRevisionProfiles":"Microsoft.ContainerService.MeshRevisionProfiles.listMeshRevisionProfiles","com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient.listMeshUpgradeProfiles":"Microsoft.ContainerService.MeshUpgradeProfiles.listMeshUpgradeProfiles","com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient.listOutboundNetworkDependenciesEndpoints":"Microsoft.ContainerService.ManagedClusters.listOutboundNetworkDependenciesEndpoints","com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient.resetAADProfile":"Microsoft.ContainerService.ManagedClusters.resetAADProfile","com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient.resetServicePrincipalProfile":"Microsoft.ContainerService.ManagedClusters.resetServicePrincipalProfile","com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient.rotateClusterCertificates":"Microsoft.ContainerService.ManagedClusters.rotateClusterCertificates","com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient.rotateServiceAccountSigningKeys":"Microsoft.ContainerService.ManagedClusters.rotateServiceAccountSigningKeys","com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient.runCommand":"Microsoft.ContainerService.ManagedClusters.runCommand","com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient.start":"Microsoft.ContainerService.ManagedClusters.start","com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient.stop":"Microsoft.ContainerService.ManagedClusters.stop","com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient.updateTags":"Microsoft.ContainerService.ManagedClusters.updateTags","com.azure.resourcemanager.containerservice.generated.fluent.ManagedNamespacesClient":"Microsoft.ContainerService.ManagedNamespaces","com.azure.resourcemanager.containerservice.generated.fluent.ManagedNamespacesClient.beginCreateOrUpdate":"Microsoft.ContainerService.ManagedNamespaces.createOrUpdate","com.azure.resourcemanager.containerservice.generated.fluent.ManagedNamespacesClient.beginDelete":"Microsoft.ContainerService.ManagedNamespaces.delete","com.azure.resourcemanager.containerservice.generated.fluent.ManagedNamespacesClient.createOrUpdate":"Microsoft.ContainerService.ManagedNamespaces.createOrUpdate","com.azure.resourcemanager.containerservice.generated.fluent.ManagedNamespacesClient.delete":"Microsoft.ContainerService.ManagedNamespaces.delete","com.azure.resourcemanager.containerservice.generated.fluent.ManagedNamespacesClient.get":"Microsoft.ContainerService.ManagedNamespaces.get","com.azure.resourcemanager.containerservice.generated.fluent.ManagedNamespacesClient.getWithResponse":"Microsoft.ContainerService.ManagedNamespaces.get","com.azure.resourcemanager.containerservice.generated.fluent.ManagedNamespacesClient.listByManagedCluster":"Microsoft.ContainerService.ManagedNamespaces.listByManagedCluster","com.azure.resourcemanager.containerservice.generated.fluent.ManagedNamespacesClient.listCredential":"Microsoft.ContainerService.ManagedNamespaces.listCredential","com.azure.resourcemanager.containerservice.generated.fluent.ManagedNamespacesClient.listCredentialWithResponse":"Microsoft.ContainerService.ManagedNamespaces.listCredential","com.azure.resourcemanager.containerservice.generated.fluent.ManagedNamespacesClient.update":"Microsoft.ContainerService.ManagedNamespaces.update","com.azure.resourcemanager.containerservice.generated.fluent.ManagedNamespacesClient.updateWithResponse":"Microsoft.ContainerService.ManagedNamespaces.update","com.azure.resourcemanager.containerservice.generated.fluent.OperationsClient":"Microsoft.ContainerService.Operations","com.azure.resourcemanager.containerservice.generated.fluent.OperationsClient.list":"Microsoft.ContainerService.Operations.list","com.azure.resourcemanager.containerservice.generated.fluent.PrivateEndpointConnectionsClient":"Microsoft.ContainerService.PrivateEndpointConnections","com.azure.resourcemanager.containerservice.generated.fluent.PrivateEndpointConnectionsClient.beginDelete":"Microsoft.ContainerService.PrivateEndpointConnections.delete","com.azure.resourcemanager.containerservice.generated.fluent.PrivateEndpointConnectionsClient.delete":"Microsoft.ContainerService.PrivateEndpointConnections.delete","com.azure.resourcemanager.containerservice.generated.fluent.PrivateEndpointConnectionsClient.get":"Microsoft.ContainerService.PrivateEndpointConnections.get","com.azure.resourcemanager.containerservice.generated.fluent.PrivateEndpointConnectionsClient.getWithResponse":"Microsoft.ContainerService.PrivateEndpointConnections.get","com.azure.resourcemanager.containerservice.generated.fluent.PrivateEndpointConnectionsClient.list":"Microsoft.ContainerService.PrivateEndpointConnections.list","com.azure.resourcemanager.containerservice.generated.fluent.PrivateEndpointConnectionsClient.listWithResponse":"Microsoft.ContainerService.PrivateEndpointConnections.list","com.azure.resourcemanager.containerservice.generated.fluent.PrivateEndpointConnectionsClient.update":"Microsoft.ContainerService.PrivateEndpointConnections.update","com.azure.resourcemanager.containerservice.generated.fluent.PrivateEndpointConnectionsClient.updateWithResponse":"Microsoft.ContainerService.PrivateEndpointConnections.update","com.azure.resourcemanager.containerservice.generated.fluent.PrivateLinkResourcesClient":"Microsoft.ContainerService","com.azure.resourcemanager.containerservice.generated.fluent.PrivateLinkResourcesClient.list":"Microsoft.ContainerService.ManagedClusters.privateLinkResourcesList","com.azure.resourcemanager.containerservice.generated.fluent.PrivateLinkResourcesClient.listWithResponse":"Microsoft.ContainerService.ManagedClusters.privateLinkResourcesList","com.azure.resourcemanager.containerservice.generated.fluent.ResolvePrivateLinkServiceIdsClient":"Microsoft.ContainerService","com.azure.resourcemanager.containerservice.generated.fluent.ResolvePrivateLinkServiceIdsClient.pOST":"Microsoft.ContainerService.ManagedClusters.post","com.azure.resourcemanager.containerservice.generated.fluent.ResolvePrivateLinkServiceIdsClient.pOSTWithResponse":"Microsoft.ContainerService.ManagedClusters.post","com.azure.resourcemanager.containerservice.generated.fluent.SnapshotsClient":"Microsoft.ContainerService.Snapshots","com.azure.resourcemanager.containerservice.generated.fluent.SnapshotsClient.createOrUpdate":"Microsoft.ContainerService.Snapshots.createOrUpdate","com.azure.resourcemanager.containerservice.generated.fluent.SnapshotsClient.createOrUpdateWithResponse":"Microsoft.ContainerService.Snapshots.createOrUpdate","com.azure.resourcemanager.containerservice.generated.fluent.SnapshotsClient.delete":"Microsoft.ContainerService.Snapshots.delete","com.azure.resourcemanager.containerservice.generated.fluent.SnapshotsClient.deleteWithResponse":"Microsoft.ContainerService.Snapshots.delete","com.azure.resourcemanager.containerservice.generated.fluent.SnapshotsClient.getByResourceGroup":"Microsoft.ContainerService.Snapshots.get","com.azure.resourcemanager.containerservice.generated.fluent.SnapshotsClient.getByResourceGroupWithResponse":"Microsoft.ContainerService.Snapshots.get","com.azure.resourcemanager.containerservice.generated.fluent.SnapshotsClient.list":"Microsoft.ContainerService.Snapshots.list","com.azure.resourcemanager.containerservice.generated.fluent.SnapshotsClient.listByResourceGroup":"Microsoft.ContainerService.Snapshots.listByResourceGroup","com.azure.resourcemanager.containerservice.generated.fluent.SnapshotsClient.updateTags":"Microsoft.ContainerService.Snapshots.updateTags","com.azure.resourcemanager.containerservice.generated.fluent.SnapshotsClient.updateTagsWithResponse":"Microsoft.ContainerService.Snapshots.updateTags","com.azure.resourcemanager.containerservice.generated.fluent.TrustedAccessRoleBindingsClient":"Microsoft.ContainerService.TrustedAccessRoleBindings","com.azure.resourcemanager.containerservice.generated.fluent.TrustedAccessRoleBindingsClient.beginCreateOrUpdate":"Microsoft.ContainerService.TrustedAccessRoleBindings.createOrUpdate","com.azure.resourcemanager.containerservice.generated.fluent.TrustedAccessRoleBindingsClient.beginDelete":"Microsoft.ContainerService.TrustedAccessRoleBindings.delete","com.azure.resourcemanager.containerservice.generated.fluent.TrustedAccessRoleBindingsClient.createOrUpdate":"Microsoft.ContainerService.TrustedAccessRoleBindings.createOrUpdate","com.azure.resourcemanager.containerservice.generated.fluent.TrustedAccessRoleBindingsClient.delete":"Microsoft.ContainerService.TrustedAccessRoleBindings.delete","com.azure.resourcemanager.containerservice.generated.fluent.TrustedAccessRoleBindingsClient.get":"Microsoft.ContainerService.TrustedAccessRoleBindings.get","com.azure.resourcemanager.containerservice.generated.fluent.TrustedAccessRoleBindingsClient.getWithResponse":"Microsoft.ContainerService.TrustedAccessRoleBindings.get","com.azure.resourcemanager.containerservice.generated.fluent.TrustedAccessRoleBindingsClient.list":"Microsoft.ContainerService.TrustedAccessRoleBindings.list","com.azure.resourcemanager.containerservice.generated.fluent.TrustedAccessRolesClient":"Microsoft.ContainerService","com.azure.resourcemanager.containerservice.generated.fluent.TrustedAccessRolesClient.list":"Microsoft.ContainerService.TrustedAccessRolesOperationGroup.list","com.azure.resourcemanager.containerservice.generated.fluent.models.AccessProfile":"Microsoft.ContainerService.AccessProfile","com.azure.resourcemanager.containerservice.generated.fluent.models.AgentPoolAvailableVersionsInner":"Microsoft.ContainerService.AgentPoolAvailableVersions","com.azure.resourcemanager.containerservice.generated.fluent.models.AgentPoolAvailableVersionsProperties":"Microsoft.ContainerService.AgentPoolAvailableVersionsProperties","com.azure.resourcemanager.containerservice.generated.fluent.models.AgentPoolInner":"Microsoft.ContainerService.AgentPool","com.azure.resourcemanager.containerservice.generated.fluent.models.AgentPoolUpgradeProfileInner":"Microsoft.ContainerService.AgentPoolUpgradeProfile","com.azure.resourcemanager.containerservice.generated.fluent.models.AgentPoolUpgradeProfileProperties":"Microsoft.ContainerService.AgentPoolUpgradeProfileProperties","com.azure.resourcemanager.containerservice.generated.fluent.models.CommandResultProperties":"Microsoft.ContainerService.CommandResultProperties","com.azure.resourcemanager.containerservice.generated.fluent.models.CredentialResultsInner":"Microsoft.ContainerService.CredentialResults","com.azure.resourcemanager.containerservice.generated.fluent.models.KubernetesVersionListResultInner":"Microsoft.ContainerService.KubernetesVersionListResult","com.azure.resourcemanager.containerservice.generated.fluent.models.MachineInner":"Microsoft.ContainerService.Machine","com.azure.resourcemanager.containerservice.generated.fluent.models.MaintenanceConfigurationInner":"Microsoft.ContainerService.MaintenanceConfiguration","com.azure.resourcemanager.containerservice.generated.fluent.models.MaintenanceConfigurationProperties":"Microsoft.ContainerService.MaintenanceConfigurationProperties","com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterAccessProfileInner":"Microsoft.ContainerService.ManagedClusterAccessProfile","com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterAgentPoolProfileProperties":"Microsoft.ContainerService.ManagedClusterAgentPoolProfileProperties","com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterInner":"Microsoft.ContainerService.ManagedCluster","com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterProperties":"Microsoft.ContainerService.ManagedClusterProperties","com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterUpgradeProfileInner":"Microsoft.ContainerService.ManagedClusterUpgradeProfile","com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterUpgradeProfileProperties":"Microsoft.ContainerService.ManagedClusterUpgradeProfileProperties","com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedNamespaceInner":"Microsoft.ContainerService.ManagedNamespace","com.azure.resourcemanager.containerservice.generated.fluent.models.MeshRevisionProfileInner":"Microsoft.ContainerService.MeshRevisionProfile","com.azure.resourcemanager.containerservice.generated.fluent.models.MeshUpgradeProfileInner":"Microsoft.ContainerService.MeshUpgradeProfile","com.azure.resourcemanager.containerservice.generated.fluent.models.OperationValueDisplay":"Microsoft.ContainerService.OperationValueDisplay","com.azure.resourcemanager.containerservice.generated.fluent.models.OperationValueInner":"Microsoft.ContainerService.OperationValue","com.azure.resourcemanager.containerservice.generated.fluent.models.OutboundEnvironmentEndpointInner":"Microsoft.ContainerService.OutboundEnvironmentEndpoint","com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateEndpointConnectionInner":"Microsoft.ContainerService.PrivateEndpointConnection","com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateEndpointConnectionListResultInner":"Microsoft.ContainerService.PrivateEndpointConnectionListResult","com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateEndpointConnectionProperties":"Microsoft.ContainerService.PrivateEndpointConnectionProperties","com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateLinkResourceInner":"Microsoft.ContainerService.PrivateLinkResource","com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateLinkResourcesListResultInner":"Microsoft.ContainerService.PrivateLinkResourcesListResult","com.azure.resourcemanager.containerservice.generated.fluent.models.RunCommandResultInner":"Microsoft.ContainerService.RunCommandResult","com.azure.resourcemanager.containerservice.generated.fluent.models.SnapshotInner":"Microsoft.ContainerService.Snapshot","com.azure.resourcemanager.containerservice.generated.fluent.models.SnapshotProperties":"Microsoft.ContainerService.SnapshotProperties","com.azure.resourcemanager.containerservice.generated.fluent.models.TrustedAccessRoleBindingInner":"Microsoft.ContainerService.TrustedAccessRoleBinding","com.azure.resourcemanager.containerservice.generated.fluent.models.TrustedAccessRoleBindingProperties":"Microsoft.ContainerService.TrustedAccessRoleBindingProperties","com.azure.resourcemanager.containerservice.generated.fluent.models.TrustedAccessRoleInner":"Microsoft.ContainerService.TrustedAccessRole","com.azure.resourcemanager.containerservice.generated.implementation.ContainerServiceManagementClientBuilder":"Microsoft.ContainerService","com.azure.resourcemanager.containerservice.generated.implementation.models.AgentPoolListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.containerservice.generated.implementation.models.MachineListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.containerservice.generated.implementation.models.MaintenanceConfigurationListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.containerservice.generated.implementation.models.ManagedClusterListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.containerservice.generated.implementation.models.ManagedNamespaceListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.containerservice.generated.implementation.models.MeshRevisionProfileList":"Microsoft.ContainerService.MeshRevisionProfileList","com.azure.resourcemanager.containerservice.generated.implementation.models.MeshUpgradeProfileList":"Microsoft.ContainerService.MeshUpgradeProfileList","com.azure.resourcemanager.containerservice.generated.implementation.models.OperationListResult":"Microsoft.ContainerService.OperationListResult","com.azure.resourcemanager.containerservice.generated.implementation.models.OutboundEnvironmentEndpointCollection":"Microsoft.ContainerService.OutboundEnvironmentEndpointCollection","com.azure.resourcemanager.containerservice.generated.implementation.models.SnapshotListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.containerservice.generated.implementation.models.TrustedAccessRoleBindingListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.containerservice.generated.implementation.models.TrustedAccessRoleListResult":"Microsoft.ContainerService.TrustedAccessRoleListResult","com.azure.resourcemanager.containerservice.generated.models.AbsoluteMonthlySchedule":"Microsoft.ContainerService.AbsoluteMonthlySchedule","com.azure.resourcemanager.containerservice.generated.models.AccelerationMode":"Microsoft.ContainerService.AccelerationMode","com.azure.resourcemanager.containerservice.generated.models.AdoptionPolicy":"Microsoft.ContainerService.AdoptionPolicy","com.azure.resourcemanager.containerservice.generated.models.AdvancedNetworkPolicies":"Microsoft.ContainerService.AdvancedNetworkPolicies","com.azure.resourcemanager.containerservice.generated.models.AdvancedNetworking":"Microsoft.ContainerService.AdvancedNetworking","com.azure.resourcemanager.containerservice.generated.models.AdvancedNetworkingObservability":"Microsoft.ContainerService.AdvancedNetworkingObservability","com.azure.resourcemanager.containerservice.generated.models.AdvancedNetworkingPerformance":"Microsoft.ContainerService.AdvancedNetworkingPerformance","com.azure.resourcemanager.containerservice.generated.models.AdvancedNetworkingSecurity":"Microsoft.ContainerService.AdvancedNetworkingSecurity","com.azure.resourcemanager.containerservice.generated.models.AdvancedNetworkingSecurityTransitEncryption":"Microsoft.ContainerService.AdvancedNetworkingSecurityTransitEncryption","com.azure.resourcemanager.containerservice.generated.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem":"Microsoft.ContainerService.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem","com.azure.resourcemanager.containerservice.generated.models.AgentPoolDeleteMachinesParameter":"Microsoft.ContainerService.AgentPoolDeleteMachinesParameter","com.azure.resourcemanager.containerservice.generated.models.AgentPoolGatewayProfile":"Microsoft.ContainerService.AgentPoolGatewayProfile","com.azure.resourcemanager.containerservice.generated.models.AgentPoolMode":"Microsoft.ContainerService.AgentPoolMode","com.azure.resourcemanager.containerservice.generated.models.AgentPoolNetworkProfile":"Microsoft.ContainerService.AgentPoolNetworkProfile","com.azure.resourcemanager.containerservice.generated.models.AgentPoolSSHAccess":"Microsoft.ContainerService.AgentPoolSSHAccess","com.azure.resourcemanager.containerservice.generated.models.AgentPoolSecurityProfile":"Microsoft.ContainerService.AgentPoolSecurityProfile","com.azure.resourcemanager.containerservice.generated.models.AgentPoolStatus":"Microsoft.ContainerService.AgentPoolStatus","com.azure.resourcemanager.containerservice.generated.models.AgentPoolType":"Microsoft.ContainerService.AgentPoolType","com.azure.resourcemanager.containerservice.generated.models.AgentPoolUpgradeProfilePropertiesUpgradesItem":"Microsoft.ContainerService.AgentPoolUpgradeProfilePropertiesUpgradesItem","com.azure.resourcemanager.containerservice.generated.models.AgentPoolUpgradeSettings":"Microsoft.ContainerService.AgentPoolUpgradeSettings","com.azure.resourcemanager.containerservice.generated.models.AgentPoolWindowsProfile":"Microsoft.ContainerService.AgentPoolWindowsProfile","com.azure.resourcemanager.containerservice.generated.models.ArtifactSource":"Microsoft.ContainerService.ArtifactSource","com.azure.resourcemanager.containerservice.generated.models.AzureKeyVaultKms":"Microsoft.ContainerService.AzureKeyVaultKms","com.azure.resourcemanager.containerservice.generated.models.BackendPoolType":"Microsoft.ContainerService.BackendPoolType","com.azure.resourcemanager.containerservice.generated.models.ClusterUpgradeSettings":"Microsoft.ContainerService.ClusterUpgradeSettings","com.azure.resourcemanager.containerservice.generated.models.Code":"Microsoft.ContainerService.Code","com.azure.resourcemanager.containerservice.generated.models.CompatibleVersions":"Microsoft.ContainerService.CompatibleVersions","com.azure.resourcemanager.containerservice.generated.models.ConnectionStatus":"Microsoft.ContainerService.ConnectionStatus","com.azure.resourcemanager.containerservice.generated.models.ContainerServiceLinuxProfile":"Microsoft.ContainerService.ContainerServiceLinuxProfile","com.azure.resourcemanager.containerservice.generated.models.ContainerServiceNetworkProfile":"Microsoft.ContainerService.ContainerServiceNetworkProfile","com.azure.resourcemanager.containerservice.generated.models.ContainerServiceSshConfiguration":"Microsoft.ContainerService.ContainerServiceSshConfiguration","com.azure.resourcemanager.containerservice.generated.models.ContainerServiceSshPublicKey":"Microsoft.ContainerService.ContainerServiceSshPublicKey","com.azure.resourcemanager.containerservice.generated.models.CreationData":"Microsoft.ContainerService.CreationData","com.azure.resourcemanager.containerservice.generated.models.CredentialResult":"Microsoft.ContainerService.CredentialResult","com.azure.resourcemanager.containerservice.generated.models.DailySchedule":"Microsoft.ContainerService.DailySchedule","com.azure.resourcemanager.containerservice.generated.models.DateSpan":"Microsoft.ContainerService.DateSpan","com.azure.resourcemanager.containerservice.generated.models.DelegatedResource":"Azure.ResourceManager.CommonTypes.DelegatedResource","com.azure.resourcemanager.containerservice.generated.models.DeletePolicy":"Microsoft.ContainerService.DeletePolicy","com.azure.resourcemanager.containerservice.generated.models.EndpointDependency":"Microsoft.ContainerService.EndpointDependency","com.azure.resourcemanager.containerservice.generated.models.EndpointDetail":"Microsoft.ContainerService.EndpointDetail","com.azure.resourcemanager.containerservice.generated.models.Expander":"Microsoft.ContainerService.Expander","com.azure.resourcemanager.containerservice.generated.models.ExtendedLocation":"Microsoft.ContainerService.ExtendedLocation","com.azure.resourcemanager.containerservice.generated.models.ExtendedLocationTypes":"Microsoft.ContainerService.ExtendedLocationTypes","com.azure.resourcemanager.containerservice.generated.models.Format":"Microsoft.ContainerService.Format","com.azure.resourcemanager.containerservice.generated.models.GPUDriver":"Microsoft.ContainerService.GPUDriver","com.azure.resourcemanager.containerservice.generated.models.GPUInstanceProfile":"Microsoft.ContainerService.GPUInstanceProfile","com.azure.resourcemanager.containerservice.generated.models.GPUProfile":"Microsoft.ContainerService.GPUProfile","com.azure.resourcemanager.containerservice.generated.models.IPFamily":"Microsoft.ContainerService.IPFamily","com.azure.resourcemanager.containerservice.generated.models.IPTag":"Microsoft.ContainerService.IPTag","com.azure.resourcemanager.containerservice.generated.models.IstioCertificateAuthority":"Microsoft.ContainerService.IstioCertificateAuthority","com.azure.resourcemanager.containerservice.generated.models.IstioComponents":"Microsoft.ContainerService.IstioComponents","com.azure.resourcemanager.containerservice.generated.models.IstioEgressGateway":"Microsoft.ContainerService.IstioEgressGateway","com.azure.resourcemanager.containerservice.generated.models.IstioIngressGateway":"Microsoft.ContainerService.IstioIngressGateway","com.azure.resourcemanager.containerservice.generated.models.IstioIngressGatewayMode":"Microsoft.ContainerService.IstioIngressGatewayMode","com.azure.resourcemanager.containerservice.generated.models.IstioPluginCertificateAuthority":"Microsoft.ContainerService.IstioPluginCertificateAuthority","com.azure.resourcemanager.containerservice.generated.models.IstioServiceMesh":"Microsoft.ContainerService.IstioServiceMesh","com.azure.resourcemanager.containerservice.generated.models.KeyVaultNetworkAccessTypes":"Microsoft.ContainerService.KeyVaultNetworkAccessTypes","com.azure.resourcemanager.containerservice.generated.models.KubeletConfig":"Microsoft.ContainerService.KubeletConfig","com.azure.resourcemanager.containerservice.generated.models.KubeletDiskType":"Microsoft.ContainerService.KubeletDiskType","com.azure.resourcemanager.containerservice.generated.models.KubernetesPatchVersion":"Microsoft.ContainerService.KubernetesPatchVersion","com.azure.resourcemanager.containerservice.generated.models.KubernetesSupportPlan":"Microsoft.ContainerService.KubernetesSupportPlan","com.azure.resourcemanager.containerservice.generated.models.KubernetesVersion":"Microsoft.ContainerService.KubernetesVersion","com.azure.resourcemanager.containerservice.generated.models.KubernetesVersionCapabilities":"Microsoft.ContainerService.KubernetesVersionCapabilities","com.azure.resourcemanager.containerservice.generated.models.LicenseType":"Microsoft.ContainerService.LicenseType","com.azure.resourcemanager.containerservice.generated.models.LinuxOSConfig":"Microsoft.ContainerService.LinuxOSConfig","com.azure.resourcemanager.containerservice.generated.models.LoadBalancerSku":"Microsoft.ContainerService.LoadBalancerSku","com.azure.resourcemanager.containerservice.generated.models.LocalDNSForwardDestination":"Microsoft.ContainerService.LocalDNSForwardDestination","com.azure.resourcemanager.containerservice.generated.models.LocalDNSForwardPolicy":"Microsoft.ContainerService.LocalDNSForwardPolicy","com.azure.resourcemanager.containerservice.generated.models.LocalDNSMode":"Microsoft.ContainerService.LocalDNSMode","com.azure.resourcemanager.containerservice.generated.models.LocalDNSOverride":"Microsoft.ContainerService.LocalDNSOverride","com.azure.resourcemanager.containerservice.generated.models.LocalDNSProfile":"Microsoft.ContainerService.LocalDNSProfile","com.azure.resourcemanager.containerservice.generated.models.LocalDNSProtocol":"Microsoft.ContainerService.LocalDNSProtocol","com.azure.resourcemanager.containerservice.generated.models.LocalDNSQueryLogging":"Microsoft.ContainerService.LocalDNSQueryLogging","com.azure.resourcemanager.containerservice.generated.models.LocalDNSServeStale":"Microsoft.ContainerService.LocalDNSServeStale","com.azure.resourcemanager.containerservice.generated.models.LocalDNSState":"Microsoft.ContainerService.LocalDNSState","com.azure.resourcemanager.containerservice.generated.models.MachineIpAddress":"Microsoft.ContainerService.MachineIpAddress","com.azure.resourcemanager.containerservice.generated.models.MachineNetworkProperties":"Microsoft.ContainerService.MachineNetworkProperties","com.azure.resourcemanager.containerservice.generated.models.MachineProperties":"Microsoft.ContainerService.MachineProperties","com.azure.resourcemanager.containerservice.generated.models.MaintenanceWindow":"Microsoft.ContainerService.MaintenanceWindow","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAADProfile":"Microsoft.ContainerService.ManagedClusterAADProfile","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAIToolchainOperatorProfile":"Microsoft.ContainerService.ManagedClusterAIToolchainOperatorProfile","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAddonProfile":"Microsoft.ContainerService.ManagedClusterAddonProfile","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAddonProfileIdentity":"Microsoft.ContainerService.ManagedClusterAddonProfileIdentity","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAgentPoolProfile":"Microsoft.ContainerService.ManagedClusterAgentPoolProfile","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterApiServerAccessProfile":"Microsoft.ContainerService.ManagedClusterAPIServerAccessProfile","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAutoUpgradeProfile":"Microsoft.ContainerService.ManagedClusterAutoUpgradeProfile","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAzureMonitorProfile":"Microsoft.ContainerService.ManagedClusterAzureMonitorProfile","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAzureMonitorProfileKubeStateMetrics":"Microsoft.ContainerService.ManagedClusterAzureMonitorProfileKubeStateMetrics","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAzureMonitorProfileMetrics":"Microsoft.ContainerService.ManagedClusterAzureMonitorProfileMetrics","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterBootstrapProfile":"Microsoft.ContainerService.ManagedClusterBootstrapProfile","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterCostAnalysis":"Microsoft.ContainerService.ManagedClusterCostAnalysis","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterHttpProxyConfig":"Microsoft.ContainerService.ManagedClusterHTTPProxyConfig","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterIdentity":"Microsoft.ContainerService.ManagedClusterIdentity","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterIngressProfile":"Microsoft.ContainerService.ManagedClusterIngressProfile","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterIngressProfileNginx":"Microsoft.ContainerService.ManagedClusterIngressProfileNginx","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterIngressProfileWebAppRouting":"Microsoft.ContainerService.ManagedClusterIngressProfileWebAppRouting","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterLoadBalancerProfile":"Microsoft.ContainerService.ManagedClusterLoadBalancerProfile","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs":"Microsoft.ContainerService.ManagedClusterLoadBalancerProfileManagedOutboundIPs","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes":"Microsoft.ContainerService.ManagedClusterLoadBalancerProfileOutboundIPPrefixes","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterLoadBalancerProfileOutboundIPs":"Microsoft.ContainerService.ManagedClusterLoadBalancerProfileOutboundIPs","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterManagedOutboundIPProfile":"Microsoft.ContainerService.ManagedClusterManagedOutboundIPProfile","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterMetricsProfile":"Microsoft.ContainerService.ManagedClusterMetricsProfile","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterNATGatewayProfile":"Microsoft.ContainerService.ManagedClusterNATGatewayProfile","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterNodeProvisioningProfile":"Microsoft.ContainerService.ManagedClusterNodeProvisioningProfile","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterNodeResourceGroupProfile":"Microsoft.ContainerService.ManagedClusterNodeResourceGroupProfile","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterOIDCIssuerProfile":"Microsoft.ContainerService.ManagedClusterOIDCIssuerProfile","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterPodIdentity":"Microsoft.ContainerService.ManagedClusterPodIdentity","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterPodIdentityException":"Microsoft.ContainerService.ManagedClusterPodIdentityException","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterPodIdentityProfile":"Microsoft.ContainerService.ManagedClusterPodIdentityProfile","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterPodIdentityProvisioningError":"Microsoft.ContainerService.ManagedClusterPodIdentityProvisioningError","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterPodIdentityProvisioningErrorBody":"Microsoft.ContainerService.ManagedClusterPodIdentityProvisioningErrorBody","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterPodIdentityProvisioningInfo":"Microsoft.ContainerService.ManagedClusterPodIdentityProvisioningInfo","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterPodIdentityProvisioningState":"Microsoft.ContainerService.ManagedClusterPodIdentityProvisioningState","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterPoolUpgradeProfile":"Microsoft.ContainerService.ManagedClusterPoolUpgradeProfile","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterPoolUpgradeProfileUpgradesItem":"Microsoft.ContainerService.ManagedClusterPoolUpgradeProfileUpgradesItem","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterPropertiesAutoScalerProfile":"Microsoft.ContainerService.ManagedClusterPropertiesAutoScalerProfile","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSKU":"Microsoft.ContainerService.ManagedClusterSKU","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSKUName":"Microsoft.ContainerService.ManagedClusterSKUName","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSKUTier":"Microsoft.ContainerService.ManagedClusterSKUTier","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSecurityProfile":"Microsoft.ContainerService.ManagedClusterSecurityProfile","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSecurityProfileDefender":"Microsoft.ContainerService.ManagedClusterSecurityProfileDefender","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSecurityProfileDefenderSecurityMonitoring":"Microsoft.ContainerService.ManagedClusterSecurityProfileDefenderSecurityMonitoring","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSecurityProfileImageCleaner":"Microsoft.ContainerService.ManagedClusterSecurityProfileImageCleaner","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSecurityProfileWorkloadIdentity":"Microsoft.ContainerService.ManagedClusterSecurityProfileWorkloadIdentity","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterServicePrincipalProfile":"Microsoft.ContainerService.ManagedClusterServicePrincipalProfile","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterStaticEgressGatewayProfile":"Microsoft.ContainerService.ManagedClusterStaticEgressGatewayProfile","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterStatus":"Microsoft.ContainerService.ManagedClusterStatus","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterStorageProfile":"Microsoft.ContainerService.ManagedClusterStorageProfile","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterStorageProfileBlobCSIDriver":"Microsoft.ContainerService.ManagedClusterStorageProfileBlobCSIDriver","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterStorageProfileDiskCSIDriver":"Microsoft.ContainerService.ManagedClusterStorageProfileDiskCSIDriver","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterStorageProfileFileCSIDriver":"Microsoft.ContainerService.ManagedClusterStorageProfileFileCSIDriver","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterStorageProfileSnapshotController":"Microsoft.ContainerService.ManagedClusterStorageProfileSnapshotController","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterWindowsProfile":"Microsoft.ContainerService.ManagedClusterWindowsProfile","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterWorkloadAutoScalerProfile":"Microsoft.ContainerService.ManagedClusterWorkloadAutoScalerProfile","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterWorkloadAutoScalerProfileKeda":"Microsoft.ContainerService.ManagedClusterWorkloadAutoScalerProfileKeda","com.azure.resourcemanager.containerservice.generated.models.ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler":"Microsoft.ContainerService.ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler","com.azure.resourcemanager.containerservice.generated.models.ManagedClustersGetCommandResultHeaders":null,"com.azure.resourcemanager.containerservice.generated.models.ManagedServiceIdentityUserAssignedIdentitiesValue":"Microsoft.ContainerService.ManagedServiceIdentityUserAssignedIdentitiesValue","com.azure.resourcemanager.containerservice.generated.models.ManualScaleProfile":"Microsoft.ContainerService.ManualScaleProfile","com.azure.resourcemanager.containerservice.generated.models.MeshRevision":"Microsoft.ContainerService.MeshRevision","com.azure.resourcemanager.containerservice.generated.models.MeshRevisionProfileProperties":"Microsoft.ContainerService.MeshRevisionProfileProperties","com.azure.resourcemanager.containerservice.generated.models.MeshUpgradeProfileProperties":"Microsoft.ContainerService.MeshUpgradeProfileProperties","com.azure.resourcemanager.containerservice.generated.models.NamespaceProperties":"Microsoft.ContainerService.NamespaceProperties","com.azure.resourcemanager.containerservice.generated.models.NamespaceProvisioningState":"Microsoft.ContainerService.NamespaceProvisioningState","com.azure.resourcemanager.containerservice.generated.models.NetworkDataplane":"Microsoft.ContainerService.NetworkDataplane","com.azure.resourcemanager.containerservice.generated.models.NetworkMode":"Microsoft.ContainerService.NetworkMode","com.azure.resourcemanager.containerservice.generated.models.NetworkPlugin":"Microsoft.ContainerService.NetworkPlugin","com.azure.resourcemanager.containerservice.generated.models.NetworkPluginMode":"Microsoft.ContainerService.NetworkPluginMode","com.azure.resourcemanager.containerservice.generated.models.NetworkPolicies":"Microsoft.ContainerService.NetworkPolicies","com.azure.resourcemanager.containerservice.generated.models.NetworkPolicy":"Microsoft.ContainerService.NetworkPolicy","com.azure.resourcemanager.containerservice.generated.models.NginxIngressControllerType":"Microsoft.ContainerService.NginxIngressControllerType","com.azure.resourcemanager.containerservice.generated.models.NodeOSUpgradeChannel":"Microsoft.ContainerService.NodeOSUpgradeChannel","com.azure.resourcemanager.containerservice.generated.models.NodeProvisioningDefaultNodePools":"Microsoft.ContainerService.NodeProvisioningDefaultNodePools","com.azure.resourcemanager.containerservice.generated.models.NodeProvisioningMode":"Microsoft.ContainerService.NodeProvisioningMode","com.azure.resourcemanager.containerservice.generated.models.OSDiskType":"Microsoft.ContainerService.OSDiskType","com.azure.resourcemanager.containerservice.generated.models.OSSKU":"Microsoft.ContainerService.OSSKU","com.azure.resourcemanager.containerservice.generated.models.OSType":"Microsoft.ContainerService.OSType","com.azure.resourcemanager.containerservice.generated.models.OutboundType":"Microsoft.ContainerService.OutboundType","com.azure.resourcemanager.containerservice.generated.models.PodIPAllocationMode":"Microsoft.ContainerService.PodIPAllocationMode","com.azure.resourcemanager.containerservice.generated.models.PolicyRule":"Microsoft.ContainerService.PolicyRule","com.azure.resourcemanager.containerservice.generated.models.PortRange":"Microsoft.ContainerService.PortRange","com.azure.resourcemanager.containerservice.generated.models.PowerState":"Microsoft.ContainerService.PowerState","com.azure.resourcemanager.containerservice.generated.models.PrivateEndpoint":"Microsoft.ContainerService.PrivateEndpoint","com.azure.resourcemanager.containerservice.generated.models.PrivateEndpointConnectionProvisioningState":"Microsoft.ContainerService.PrivateEndpointConnectionProvisioningState","com.azure.resourcemanager.containerservice.generated.models.PrivateLinkServiceConnectionState":"Microsoft.ContainerService.PrivateLinkServiceConnectionState","com.azure.resourcemanager.containerservice.generated.models.Protocol":"Microsoft.ContainerService.Protocol","com.azure.resourcemanager.containerservice.generated.models.ProxyRedirectionMechanism":"Microsoft.ContainerService.ProxyRedirectionMechanism","com.azure.resourcemanager.containerservice.generated.models.PublicNetworkAccess":"Microsoft.ContainerService.PublicNetworkAccess","com.azure.resourcemanager.containerservice.generated.models.RelativeMonthlySchedule":"Microsoft.ContainerService.RelativeMonthlySchedule","com.azure.resourcemanager.containerservice.generated.models.ResourceIdentityType":"Microsoft.ContainerService.ResourceIdentityType","com.azure.resourcemanager.containerservice.generated.models.ResourceQuota":"Microsoft.ContainerService.ResourceQuota","com.azure.resourcemanager.containerservice.generated.models.ResourceReference":"Microsoft.ContainerService.ResourceReference","com.azure.resourcemanager.containerservice.generated.models.RestrictionLevel":"Microsoft.ContainerService.RestrictionLevel","com.azure.resourcemanager.containerservice.generated.models.RunCommandRequest":"Microsoft.ContainerService.RunCommandRequest","com.azure.resourcemanager.containerservice.generated.models.ScaleDownMode":"Microsoft.ContainerService.ScaleDownMode","com.azure.resourcemanager.containerservice.generated.models.ScaleProfile":"Microsoft.ContainerService.ScaleProfile","com.azure.resourcemanager.containerservice.generated.models.ScaleSetEvictionPolicy":"Microsoft.ContainerService.ScaleSetEvictionPolicy","com.azure.resourcemanager.containerservice.generated.models.ScaleSetPriority":"Microsoft.ContainerService.ScaleSetPriority","com.azure.resourcemanager.containerservice.generated.models.Schedule":"Microsoft.ContainerService.Schedule","com.azure.resourcemanager.containerservice.generated.models.ServiceMeshMode":"Microsoft.ContainerService.ServiceMeshMode","com.azure.resourcemanager.containerservice.generated.models.ServiceMeshProfile":"Microsoft.ContainerService.ServiceMeshProfile","com.azure.resourcemanager.containerservice.generated.models.SnapshotType":"Microsoft.ContainerService.SnapshotType","com.azure.resourcemanager.containerservice.generated.models.SysctlConfig":"Microsoft.ContainerService.SysctlConfig","com.azure.resourcemanager.containerservice.generated.models.TagsObject":"Microsoft.ContainerService.TagsObject","com.azure.resourcemanager.containerservice.generated.models.TimeInWeek":"Microsoft.ContainerService.TimeInWeek","com.azure.resourcemanager.containerservice.generated.models.TimeSpan":"Microsoft.ContainerService.TimeSpan","com.azure.resourcemanager.containerservice.generated.models.TransitEncryptionType":"Microsoft.ContainerService.TransitEncryptionType","com.azure.resourcemanager.containerservice.generated.models.TrustedAccessRoleBindingProvisioningState":"Microsoft.ContainerService.TrustedAccessRoleBindingProvisioningState","com.azure.resourcemanager.containerservice.generated.models.TrustedAccessRoleRule":"Microsoft.ContainerService.TrustedAccessRoleRule","com.azure.resourcemanager.containerservice.generated.models.Type":"Microsoft.ContainerService.Type","com.azure.resourcemanager.containerservice.generated.models.UndrainableNodeBehavior":"Microsoft.ContainerService.UndrainableNodeBehavior","com.azure.resourcemanager.containerservice.generated.models.UpgradeChannel":"Microsoft.ContainerService.UpgradeChannel","com.azure.resourcemanager.containerservice.generated.models.UpgradeOverrideSettings":"Microsoft.ContainerService.UpgradeOverrideSettings","com.azure.resourcemanager.containerservice.generated.models.UserAssignedIdentity":"Microsoft.ContainerService.UserAssignedIdentity","com.azure.resourcemanager.containerservice.generated.models.VirtualMachineNodes":"Microsoft.ContainerService.VirtualMachineNodes","com.azure.resourcemanager.containerservice.generated.models.VirtualMachinesProfile":"Microsoft.ContainerService.VirtualMachinesProfile","com.azure.resourcemanager.containerservice.generated.models.WeekDay":"Microsoft.ContainerService.WeekDay","com.azure.resourcemanager.containerservice.generated.models.WeeklySchedule":"Microsoft.ContainerService.WeeklySchedule","com.azure.resourcemanager.containerservice.generated.models.WindowsGmsaProfile":"Microsoft.ContainerService.WindowsGmsaProfile","com.azure.resourcemanager.containerservice.generated.models.WorkloadRuntime":"Microsoft.ContainerService.WorkloadRuntime"},"generatedFiles":["src/main/java/com/azure/resourcemanager/containerservice/generated/ContainerServiceManager.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/AgentPoolsClient.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/ContainerServiceManagementClient.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/MachinesClient.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/MaintenanceConfigurationsClient.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/ManagedClustersClient.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/ManagedNamespacesClient.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/OperationsClient.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/PrivateEndpointConnectionsClient.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/PrivateLinkResourcesClient.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/ResolvePrivateLinkServiceIdsClient.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/SnapshotsClient.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/TrustedAccessRoleBindingsClient.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/TrustedAccessRolesClient.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AccessProfile.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AgentPoolAvailableVersionsInner.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AgentPoolAvailableVersionsProperties.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AgentPoolInner.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AgentPoolUpgradeProfileInner.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AgentPoolUpgradeProfileProperties.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/CommandResultProperties.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/CredentialResultsInner.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/KubernetesVersionListResultInner.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/MachineInner.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/MaintenanceConfigurationInner.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/MaintenanceConfigurationProperties.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterAccessProfileInner.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterAgentPoolProfileProperties.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterInner.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterProperties.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterUpgradeProfileInner.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterUpgradeProfileProperties.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedNamespaceInner.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/MeshRevisionProfileInner.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/MeshUpgradeProfileInner.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/OperationValueDisplay.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/OperationValueInner.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/OutboundEnvironmentEndpointInner.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/PrivateEndpointConnectionInner.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/PrivateEndpointConnectionListResultInner.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/PrivateEndpointConnectionProperties.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/PrivateLinkResourceInner.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/PrivateLinkResourcesListResultInner.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/RunCommandResultInner.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/SnapshotInner.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/SnapshotProperties.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/TrustedAccessRoleBindingInner.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/TrustedAccessRoleBindingProperties.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/TrustedAccessRoleInner.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/package-info.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/AgentPoolAvailableVersionsImpl.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/AgentPoolImpl.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/AgentPoolUpgradeProfileImpl.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/AgentPoolsClientImpl.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/AgentPoolsImpl.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ContainerServiceManagementClientBuilder.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ContainerServiceManagementClientImpl.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/CredentialResultsImpl.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/KubernetesVersionListResultImpl.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MachineImpl.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MachinesClientImpl.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MachinesImpl.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MaintenanceConfigurationImpl.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MaintenanceConfigurationsClientImpl.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MaintenanceConfigurationsImpl.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClusterAccessProfileImpl.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClusterImpl.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClusterUpgradeProfileImpl.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClustersClientImpl.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClustersImpl.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedNamespaceImpl.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedNamespacesClientImpl.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedNamespacesImpl.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MeshRevisionProfileImpl.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MeshUpgradeProfileImpl.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OperationValueImpl.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OperationsClientImpl.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OperationsImpl.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OutboundEnvironmentEndpointImpl.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateEndpointConnectionImpl.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateEndpointConnectionListResultImpl.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateEndpointConnectionsClientImpl.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateEndpointConnectionsImpl.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateLinkResourceImpl.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateLinkResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateLinkResourcesImpl.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateLinkResourcesListResultImpl.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ResolvePrivateLinkServiceIdsClientImpl.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ResolvePrivateLinkServiceIdsImpl.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ResourceManagerUtils.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/RunCommandResultImpl.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/SnapshotImpl.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/SnapshotsClientImpl.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/SnapshotsImpl.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/TrustedAccessRoleBindingImpl.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/TrustedAccessRoleBindingsClientImpl.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/TrustedAccessRoleBindingsImpl.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/TrustedAccessRoleImpl.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/TrustedAccessRolesClientImpl.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/TrustedAccessRolesImpl.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/AgentPoolListResult.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/MachineListResult.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/MaintenanceConfigurationListResult.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/ManagedClusterListResult.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/ManagedNamespaceListResult.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/MeshRevisionProfileList.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/MeshUpgradeProfileList.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/OperationListResult.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/OutboundEnvironmentEndpointCollection.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/SnapshotListResult.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/TrustedAccessRoleBindingListResult.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/models/TrustedAccessRoleListResult.java","src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/package-info.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/AbsoluteMonthlySchedule.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/AccelerationMode.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/AdoptionPolicy.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/AdvancedNetworkPolicies.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/AdvancedNetworking.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/AdvancedNetworkingObservability.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/AdvancedNetworkingPerformance.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/AdvancedNetworkingSecurity.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/AdvancedNetworkingSecurityTransitEncryption.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPool.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolAvailableVersions.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolDeleteMachinesParameter.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolGatewayProfile.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolMode.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolNetworkProfile.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolSSHAccess.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolSecurityProfile.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolStatus.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolType.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolUpgradeProfile.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolUpgradeProfilePropertiesUpgradesItem.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolUpgradeSettings.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolWindowsProfile.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPools.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ArtifactSource.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/AzureKeyVaultKms.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/BackendPoolType.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ClusterUpgradeSettings.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/Code.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/CompatibleVersions.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ConnectionStatus.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceLinuxProfile.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceNetworkProfile.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceSshConfiguration.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceSshPublicKey.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/CreationData.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/CredentialResult.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/CredentialResults.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/DailySchedule.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/DateSpan.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/DelegatedResource.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/DeletePolicy.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/EndpointDependency.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/EndpointDetail.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/Expander.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ExtendedLocation.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ExtendedLocationTypes.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/Format.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/GPUDriver.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/GPUInstanceProfile.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/GPUProfile.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/IPFamily.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/IPTag.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/IstioCertificateAuthority.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/IstioComponents.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/IstioEgressGateway.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/IstioIngressGateway.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/IstioIngressGatewayMode.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/IstioPluginCertificateAuthority.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/IstioServiceMesh.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/KeyVaultNetworkAccessTypes.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/KubeletConfig.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/KubeletDiskType.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/KubernetesPatchVersion.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/KubernetesSupportPlan.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/KubernetesVersion.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/KubernetesVersionCapabilities.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/KubernetesVersionListResult.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/LicenseType.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/LinuxOSConfig.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/LoadBalancerSku.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/LocalDNSForwardDestination.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/LocalDNSForwardPolicy.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/LocalDNSMode.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/LocalDNSOverride.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/LocalDNSProfile.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/LocalDNSProtocol.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/LocalDNSQueryLogging.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/LocalDNSServeStale.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/LocalDNSState.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/Machine.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/MachineIpAddress.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/MachineNetworkProperties.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/MachineProperties.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/Machines.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/MaintenanceConfiguration.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/MaintenanceConfigurations.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/MaintenanceWindow.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedCluster.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAADProfile.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAIToolchainOperatorProfile.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAccessProfile.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAddonProfile.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAddonProfileIdentity.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAgentPoolProfile.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterApiServerAccessProfile.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAutoUpgradeProfile.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAzureMonitorProfile.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAzureMonitorProfileKubeStateMetrics.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAzureMonitorProfileMetrics.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterBootstrapProfile.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterCostAnalysis.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterHttpProxyConfig.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterIdentity.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterIngressProfile.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterIngressProfileNginx.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterIngressProfileWebAppRouting.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterLoadBalancerProfile.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterLoadBalancerProfileManagedOutboundIPs.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterLoadBalancerProfileOutboundIPPrefixes.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterLoadBalancerProfileOutboundIPs.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterManagedOutboundIPProfile.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterMetricsProfile.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterNATGatewayProfile.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterNodeProvisioningProfile.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterNodeResourceGroupProfile.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterOIDCIssuerProfile.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentity.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityException.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityProfile.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityProvisioningError.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityProvisioningErrorBody.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityProvisioningInfo.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityProvisioningState.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPoolUpgradeProfile.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPoolUpgradeProfileUpgradesItem.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPropertiesAutoScalerProfile.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSKU.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSKUName.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSKUTier.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSecurityProfile.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSecurityProfileDefender.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSecurityProfileDefenderSecurityMonitoring.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSecurityProfileImageCleaner.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSecurityProfileWorkloadIdentity.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterServicePrincipalProfile.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterStaticEgressGatewayProfile.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterStatus.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterStorageProfile.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterStorageProfileBlobCSIDriver.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterStorageProfileDiskCSIDriver.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterStorageProfileFileCSIDriver.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterStorageProfileSnapshotController.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterUpgradeProfile.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterWindowsProfile.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterWorkloadAutoScalerProfile.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterWorkloadAutoScalerProfileKeda.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusters.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClustersGetCommandResultHeaders.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClustersGetCommandResultResponse.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedNamespace.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedNamespaces.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedServiceIdentityUserAssignedIdentitiesValue.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManualScaleProfile.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/MeshRevision.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/MeshRevisionProfile.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/MeshRevisionProfileProperties.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/MeshUpgradeProfile.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/MeshUpgradeProfileProperties.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/NamespaceProperties.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/NamespaceProvisioningState.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/NetworkDataplane.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/NetworkMode.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/NetworkPlugin.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/NetworkPluginMode.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/NetworkPolicies.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/NetworkPolicy.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/NginxIngressControllerType.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/NodeOSUpgradeChannel.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/NodeProvisioningDefaultNodePools.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/NodeProvisioningMode.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/OSDiskType.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/OSSKU.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/OSType.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/OperationValue.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/Operations.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/OutboundEnvironmentEndpoint.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/OutboundType.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/PodIPAllocationMode.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/PolicyRule.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/PortRange.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/PowerState.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateEndpoint.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateEndpointConnection.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateEndpointConnectionListResult.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateEndpointConnectionProvisioningState.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateEndpointConnections.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateLinkResource.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateLinkResources.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateLinkResourcesListResult.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateLinkServiceConnectionState.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/Protocol.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ProxyRedirectionMechanism.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/PublicNetworkAccess.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/RelativeMonthlySchedule.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ResolvePrivateLinkServiceIds.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ResourceIdentityType.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ResourceQuota.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ResourceReference.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/RestrictionLevel.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/RunCommandRequest.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/RunCommandResult.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ScaleDownMode.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ScaleProfile.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ScaleSetEvictionPolicy.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ScaleSetPriority.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/Schedule.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ServiceMeshMode.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/ServiceMeshProfile.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/Snapshot.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/SnapshotType.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/Snapshots.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/SysctlConfig.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/TagsObject.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/TimeInWeek.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/TimeSpan.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/TransitEncryptionType.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/TrustedAccessRole.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/TrustedAccessRoleBinding.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/TrustedAccessRoleBindingProvisioningState.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/TrustedAccessRoleBindings.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/TrustedAccessRoleRule.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/TrustedAccessRoles.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/Type.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/UndrainableNodeBehavior.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/UpgradeChannel.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/UpgradeOverrideSettings.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/UserAssignedIdentity.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/VirtualMachineNodes.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/VirtualMachinesProfile.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/WeekDay.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/WeeklySchedule.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/WindowsGmsaProfile.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/WorkloadRuntime.java","src/main/java/com/azure/resourcemanager/containerservice/generated/models/package-info.java","src/main/java/com/azure/resourcemanager/containerservice/generated/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-containerservice-generated/proxy-config.json b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-containerservice-generated/proxy-config.json new file mode 100644 index 000000000000..b67288936214 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-containerservice-generated/proxy-config.json @@ -0,0 +1 @@ +[["com.azure.resourcemanager.containerservice.generated.implementation.AgentPoolsClientImpl$AgentPoolsService"],["com.azure.resourcemanager.containerservice.generated.implementation.MachinesClientImpl$MachinesService"],["com.azure.resourcemanager.containerservice.generated.implementation.MaintenanceConfigurationsClientImpl$MaintenanceConfigurationsService"],["com.azure.resourcemanager.containerservice.generated.implementation.ManagedClustersClientImpl$ManagedClustersService"],["com.azure.resourcemanager.containerservice.generated.implementation.ManagedNamespacesClientImpl$ManagedNamespacesService"],["com.azure.resourcemanager.containerservice.generated.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.containerservice.generated.implementation.PrivateEndpointConnectionsClientImpl$PrivateEndpointConnectionsService"],["com.azure.resourcemanager.containerservice.generated.implementation.PrivateLinkResourcesClientImpl$PrivateLinkResourcesService"],["com.azure.resourcemanager.containerservice.generated.implementation.ResolvePrivateLinkServiceIdsClientImpl$ResolvePrivateLinkServiceIdsService"],["com.azure.resourcemanager.containerservice.generated.implementation.SnapshotsClientImpl$SnapshotsService"],["com.azure.resourcemanager.containerservice.generated.implementation.TrustedAccessRoleBindingsClientImpl$TrustedAccessRoleBindingsService"],["com.azure.resourcemanager.containerservice.generated.implementation.TrustedAccessRolesClientImpl$TrustedAccessRolesService"]] \ No newline at end of file diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-containerservice-generated/reflect-config.json b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-containerservice-generated/reflect-config.json new file mode 100644 index 000000000000..0637a088a01e --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-containerservice-generated/reflect-config.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/resources/azure-resourcemanager-containerservice-generated.properties b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/resources/azure-resourcemanager-containerservice-generated.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/resources/azure-resourcemanager-containerservice-generated.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsAbortLatestOperationSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsAbortLatestOperationSamples.java new file mode 100644 index 000000000000..e5d3415945f7 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsAbortLatestOperationSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for AgentPools AbortLatestOperation. + */ +public final class AgentPoolsAbortLatestOperationSamples { + /* + * x-ms-original-file: 2026-01-01/AgentPoolsAbortOperation.json + */ + /** + * Sample code: Abort operation on agent pool. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void abortOperationOnAgentPool( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .abortLatestOperation("rg1", "clustername1", "agentpool1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsCreateOrUpdateSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..5cab9ab9e654 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsCreateOrUpdateSamples.java @@ -0,0 +1,556 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.resourcemanager.containerservice.generated.models.AgentPool; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolMode; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolType; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolWindowsProfile; +import com.azure.resourcemanager.containerservice.generated.models.Code; +import com.azure.resourcemanager.containerservice.generated.models.CreationData; +import com.azure.resourcemanager.containerservice.generated.models.GPUInstanceProfile; +import com.azure.resourcemanager.containerservice.generated.models.KubeletConfig; +import com.azure.resourcemanager.containerservice.generated.models.LinuxOSConfig; +import com.azure.resourcemanager.containerservice.generated.models.ManualScaleProfile; +import com.azure.resourcemanager.containerservice.generated.models.OSDiskType; +import com.azure.resourcemanager.containerservice.generated.models.OSSKU; +import com.azure.resourcemanager.containerservice.generated.models.OSType; +import com.azure.resourcemanager.containerservice.generated.models.PowerState; +import com.azure.resourcemanager.containerservice.generated.models.ScaleProfile; +import com.azure.resourcemanager.containerservice.generated.models.ScaleSetEvictionPolicy; +import com.azure.resourcemanager.containerservice.generated.models.ScaleSetPriority; +import com.azure.resourcemanager.containerservice.generated.models.SysctlConfig; +import com.azure.resourcemanager.containerservice.generated.models.VirtualMachinesProfile; +import com.azure.resourcemanager.containerservice.generated.models.WorkloadRuntime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for AgentPools CreateOrUpdate. + */ +public final class AgentPoolsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-01-01/AgentPoolsCreate_EnableFIPS.json + */ + /** + * Sample code: Create Agent Pool with FIPS enabled OS. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolWithFIPSEnabledOS( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withOrchestratorVersion("") + .withEnableFIPS(true) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/AgentPoolsCreate_GPUMIG.json + */ + /** + * Sample code: Create Agent Pool with GPUMIG. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolWithGPUMIG( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_ND96asr_v4") + .withOsType(OSType.LINUX) + .withOrchestratorVersion("") + .withKubeletConfig(new KubeletConfig().withCpuManagerPolicy("static") + .withCpuCfsQuota(true) + .withCpuCfsQuotaPeriod("200ms") + .withImageGcHighThreshold(90) + .withImageGcLowThreshold(70) + .withTopologyManagerPolicy("best-effort") + .withAllowedUnsafeSysctls(Arrays.asList("kernel.msg*", "net.core.somaxconn")) + .withFailSwapOn(false)) + .withLinuxOSConfig(new LinuxOSConfig() + .withSysctls(new SysctlConfig().withNetCoreWmemDefault(12345) + .withNetIpv4TcpTwReuse(true) + .withNetIpv4IpLocalPortRange("20000 60000") + .withKernelThreadsMax(99999)) + .withTransparentHugePageEnabled("always") + .withTransparentHugePageDefrag("madvise") + .withSwapFileSizeMB(1500)) + .withGpuInstanceProfile(GPUInstanceProfile.MIG2G) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/AgentPoolsCreate_WindowsOSSKU.json + */ + /** + * Sample code: Create Agent Pool with Windows OSSKU. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolWithWindowsOSSKU( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .define("wnp2") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_D4s_v3") + .withOsType(OSType.WINDOWS) + .withOsSKU(OSSKU.WINDOWS2022) + .withOrchestratorVersion("1.23.3") + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/AgentPoolsCreate_DedicatedHostGroup.json + */ + /** + * Sample code: Create Agent Pool with Dedicated Host Group. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolWithDedicatedHostGroup( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withOrchestratorVersion("") + .withHostGroupID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1") + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/AgentPoolsCreate_Update.json + */ + /** + * Sample code: Create/Update Agent Pool. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + createUpdateAgentPool(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withTags(mapOf("name1", "val1")) + .withCount(3) + .withVmSize("Standard_DS1_v2") + .withOsType(OSType.LINUX) + .withMode(AgentPoolMode.USER) + .withOrchestratorVersion("") + .withScaleSetPriority(ScaleSetPriority.SPOT) + .withScaleSetEvictionPolicy(ScaleSetEvictionPolicy.DELETE) + .withNodeLabels(mapOf("key1", "fakeTokenPlaceholder")) + .withNodeTaints(Arrays.asList("Key1=Value1:NoSchedule")) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/AgentPoolsCreate_WindowsDisableOutboundNAT.json + */ + /** + * Sample code: Create Windows Agent Pool with disabling OutboundNAT. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createWindowsAgentPoolWithDisablingOutboundNAT( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .define("wnp2") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_D4s_v3") + .withOsType(OSType.WINDOWS) + .withOsSKU(OSSKU.WINDOWS2022) + .withOrchestratorVersion("1.23.8") + .withWindowsProfile(new AgentPoolWindowsProfile().withDisableOutboundNat(true)) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/AgentPools_Start.json + */ + /** + * Sample code: Start Agent Pool. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + startAgentPool(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withPowerState(new PowerState().withCode(Code.RUNNING)) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/AgentPoolsCreate_Spot.json + */ + /** + * Sample code: Create Spot Agent Pool. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + createSpotAgentPool(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withTags(mapOf("name1", "val1")) + .withCount(3) + .withVmSize("Standard_DS1_v2") + .withOsType(OSType.LINUX) + .withOrchestratorVersion("") + .withScaleSetPriority(ScaleSetPriority.SPOT) + .withScaleSetEvictionPolicy(ScaleSetEvictionPolicy.DELETE) + .withNodeLabels(mapOf("key1", "fakeTokenPlaceholder")) + .withNodeTaints(Arrays.asList("Key1=Value1:NoSchedule")) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/AgentPoolsCreate_Ephemeral.json + */ + /** + * Sample code: Create Agent Pool with Ephemeral OS Disk. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolWithEphemeralOSDisk( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsDiskSizeGB(64) + .withOsDiskType(OSDiskType.EPHEMERAL) + .withOsType(OSType.LINUX) + .withOrchestratorVersion("") + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/AgentPoolsCreate_EnableEncryptionAtHost.json + */ + /** + * Sample code: Create Agent Pool with EncryptionAtHost enabled. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolWithEncryptionAtHostEnabled( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withOrchestratorVersion("") + .withEnableEncryptionAtHost(true) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/AgentPoolsCreate_EnableUltraSSD.json + */ + /** + * Sample code: Create Agent Pool with UltraSSD enabled. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolWithUltraSSDEnabled( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withOrchestratorVersion("") + .withEnableUltraSSD(true) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/AgentPoolsCreate_WasmWasi.json + */ + /** + * Sample code: Create Agent Pool with Krustlet and the WASI runtime. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolWithKrustletAndTheWASIRuntime( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsDiskSizeGB(64) + .withWorkloadRuntime(WorkloadRuntime.WASM_WASI) + .withOsType(OSType.LINUX) + .withMode(AgentPoolMode.USER) + .withOrchestratorVersion("") + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/AgentPoolsCreate_PPG.json + */ + /** + * Sample code: Create Agent Pool with PPG. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + createAgentPoolWithPPG(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withOrchestratorVersion("") + .withProximityPlacementGroupID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1") + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/AgentPoolsCreate_Snapshot.json + */ + /** + * Sample code: Create Agent Pool using an agent pool snapshot. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolUsingAnAgentPoolSnapshot( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withOrchestratorVersion("") + .withEnableFIPS(true) + .withCreationData(new CreationData().withSourceResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1")) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/AgentPoolsCreate_CustomNodeConfig.json + */ + /** + * Sample code: Create Agent Pool with KubeletConfig and LinuxOSConfig. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolWithKubeletConfigAndLinuxOSConfig( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withOrchestratorVersion("") + .withKubeletConfig(new KubeletConfig().withCpuManagerPolicy("static") + .withCpuCfsQuota(true) + .withCpuCfsQuotaPeriod("200ms") + .withImageGcHighThreshold(90) + .withImageGcLowThreshold(70) + .withTopologyManagerPolicy("best-effort") + .withAllowedUnsafeSysctls(Arrays.asList("kernel.msg*", "net.core.somaxconn")) + .withFailSwapOn(false)) + .withLinuxOSConfig(new LinuxOSConfig() + .withSysctls(new SysctlConfig().withNetCoreWmemDefault(12345) + .withNetIpv4TcpTwReuse(true) + .withNetIpv4IpLocalPortRange("20000 60000") + .withKernelThreadsMax(99999)) + .withTransparentHugePageEnabled("always") + .withTransparentHugePageDefrag("madvise") + .withSwapFileSizeMB(1500)) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/AgentPools_Stop.json + */ + /** + * Sample code: Stop Agent Pool. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + stopAgentPool(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withPowerState(new PowerState().withCode(Code.STOPPED)) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/AgentPoolsCreate_MessageOfTheDay.json + */ + /** + * Sample code: Create Agent Pool with Message of the Day. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolWithMessageOfTheDay( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsDiskSizeGB(64) + .withMessageOfTheDay("Zm9vCg==") + .withOsType(OSType.LINUX) + .withMode(AgentPoolMode.USER) + .withOrchestratorVersion("") + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/AgentPoolsCreate_CRG.json + */ + /** + * Sample code: Create Agent Pool with Capacity Reservation Group. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolWithCapacityReservationGroup( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withOrchestratorVersion("") + .withCapacityReservationGroupID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/CapacityReservationGroups/crg1") + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/AgentPoolsCreate_OSSKU.json + */ + /** + * Sample code: Create Agent Pool with OSSKU. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + createAgentPoolWithOSSKU(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withOsSKU(OSSKU.AZURE_LINUX) + .withOrchestratorVersion("") + .withKubeletConfig(new KubeletConfig().withCpuManagerPolicy("static") + .withCpuCfsQuota(true) + .withCpuCfsQuotaPeriod("200ms") + .withImageGcHighThreshold(90) + .withImageGcLowThreshold(70) + .withTopologyManagerPolicy("best-effort") + .withAllowedUnsafeSysctls(Arrays.asList("kernel.msg*", "net.core.somaxconn")) + .withFailSwapOn(false)) + .withLinuxOSConfig(new LinuxOSConfig() + .withSysctls(new SysctlConfig().withNetCoreWmemDefault(12345) + .withNetIpv4TcpTwReuse(true) + .withNetIpv4IpLocalPortRange("20000 60000") + .withKernelThreadsMax(99999)) + .withTransparentHugePageEnabled("always") + .withTransparentHugePageDefrag("madvise") + .withSwapFileSizeMB(1500)) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/AgentPoolsCreate_TypeVirtualMachines.json + */ + /** + * Sample code: Create Agent Pool with VirtualMachines pool type. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolWithVirtualMachinesPoolType( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withTags(mapOf("name1", "val1")) + .withOsType(OSType.LINUX) + .withTypePropertiesType(AgentPoolType.VIRTUAL_MACHINES) + .withOrchestratorVersion("1.9.6") + .withNodeLabels(mapOf("key1", "fakeTokenPlaceholder")) + .withNodeTaints(Arrays.asList("Key1=Value1:NoSchedule")) + .withVirtualMachinesProfile(new VirtualMachinesProfile().withScale(new ScaleProfile() + .withManual(Arrays.asList(new ManualScaleProfile().withSize("Standard_D2_v2").withCount(3), + new ManualScaleProfile().withSize("Standard_D2_v3").withCount(2))))) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/AgentPools_Update.json + */ + /** + * Sample code: Update Agent Pool. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + updateAgentPool(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + AgentPool resource = manager.agentPools() + .getWithResponse("rg1", "clustername1", "agentpool1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withCount(3) + .withVmSize("Standard_DS1_v2") + .withOsType(OSType.LINUX) + .withMaxCount(2) + .withMinCount(2) + .withEnableAutoScaling(true) + .withOrchestratorVersion("") + .withScaleSetPriority(ScaleSetPriority.SPOT) + .withScaleSetEvictionPolicy(ScaleSetEvictionPolicy.DELETE) + .withNodeTaints(Arrays.asList("Key1=Value1:NoSchedule")) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsDeleteMachinesSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsDeleteMachinesSamples.java new file mode 100644 index 000000000000..5b3b4f4dd720 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsDeleteMachinesSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolDeleteMachinesParameter; +import java.util.Arrays; + +/** + * Samples for AgentPools DeleteMachines. + */ +public final class AgentPoolsDeleteMachinesSamples { + /* + * x-ms-original-file: 2026-01-01/AgentPoolsDeleteMachines.json + */ + /** + * Sample code: Delete Specific Machines in an Agent Pool. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void deleteSpecificMachinesInAnAgentPool( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .deleteMachines("rg1", "clustername1", "agentpool1", + new AgentPoolDeleteMachinesParameter().withMachineNames( + Arrays.asList("aks-nodepool1-42263519-vmss00000a", "aks-nodepool1-42263519-vmss00000b")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsDeleteSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsDeleteSamples.java new file mode 100644 index 000000000000..b121aaf90676 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for AgentPools Delete. + */ +public final class AgentPoolsDeleteSamples { + /* + * x-ms-original-file: 2026-01-01/AgentPoolsDelete.json + */ + /** + * Sample code: Delete Agent Pool. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + deleteAgentPool(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools().delete("rg1", "clustername1", "agentpool1", null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsGetAvailableAgentPoolVersionsSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsGetAvailableAgentPoolVersionsSamples.java new file mode 100644 index 000000000000..70482cd26289 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsGetAvailableAgentPoolVersionsSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for AgentPools GetAvailableAgentPoolVersions. + */ +public final class AgentPoolsGetAvailableAgentPoolVersionsSamples { + /* + * x-ms-original-file: 2026-01-01/AgentPoolsGetAgentPoolAvailableVersions.json + */ + /** + * Sample code: Get available versions for agent pool. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getAvailableVersionsForAgentPool( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .getAvailableAgentPoolVersionsWithResponse("rg1", "clustername1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsGetSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsGetSamples.java new file mode 100644 index 000000000000..12f89c589fe1 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for AgentPools Get. + */ +public final class AgentPoolsGetSamples { + /* + * x-ms-original-file: 2026-01-01/AgentPoolsGet.json + */ + /** + * Sample code: Get Agent Pool. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + getAgentPool(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools().getWithResponse("rg1", "clustername1", "agentpool1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsGetUpgradeProfileSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsGetUpgradeProfileSamples.java new file mode 100644 index 000000000000..773731a545fd --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsGetUpgradeProfileSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for AgentPools GetUpgradeProfile. + */ +public final class AgentPoolsGetUpgradeProfileSamples { + /* + * x-ms-original-file: 2026-01-01/AgentPoolsGetUpgradeProfile.json + */ + /** + * Sample code: Get Upgrade Profile for Agent Pool. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getUpgradeProfileForAgentPool( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .getUpgradeProfileWithResponse("rg1", "clustername1", "agentpool1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsListSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsListSamples.java new file mode 100644 index 000000000000..3c56936218e1 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for AgentPools List. + */ +public final class AgentPoolsListSamples { + /* + * x-ms-original-file: 2026-01-01/AgentPoolsList.json + */ + /** + * Sample code: List Agent Pools by Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listAgentPoolsByManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools().list("rg1", "clustername1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsUpgradeNodeImageVersionSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsUpgradeNodeImageVersionSamples.java new file mode 100644 index 000000000000..766017ccd191 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsUpgradeNodeImageVersionSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for AgentPools UpgradeNodeImageVersion. + */ +public final class AgentPoolsUpgradeNodeImageVersionSamples { + /* + * x-ms-original-file: 2026-01-01/AgentPoolsUpgradeNodeImageVersion.json + */ + /** + * Sample code: Upgrade Agent Pool Node Image Version. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void upgradeAgentPoolNodeImageVersion( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools() + .upgradeNodeImageVersion("rg1", "clustername1", "agentpool1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/MachinesGetSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/MachinesGetSamples.java new file mode 100644 index 000000000000..fb5df1f9b125 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/MachinesGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for Machines Get. + */ +public final class MachinesGetSamples { + /* + * x-ms-original-file: 2026-01-01/MachineGet.json + */ + /** + * Sample code: Get a Machine in an Agent Pools by Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getAMachineInAnAgentPoolsByManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.machines() + .getWithResponse("rg1", "clustername1", "agentpool1", "aks-nodepool1-42263519-vmss00000t", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/MachinesListSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/MachinesListSamples.java new file mode 100644 index 000000000000..cf512d419265 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/MachinesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for Machines List. + */ +public final class MachinesListSamples { + /* + * x-ms-original-file: 2026-01-01/MachineList.json + */ + /** + * Sample code: List Machines in an Agentpool by Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listMachinesInAnAgentpoolByManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.machines().list("rg1", "clustername1", "agentpool1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationsCreateOrUpdateSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..80c26d53beb8 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationsCreateOrUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.resourcemanager.containerservice.generated.models.DateSpan; +import com.azure.resourcemanager.containerservice.generated.models.MaintenanceWindow; +import com.azure.resourcemanager.containerservice.generated.models.RelativeMonthlySchedule; +import com.azure.resourcemanager.containerservice.generated.models.Schedule; +import com.azure.resourcemanager.containerservice.generated.models.Type; +import com.azure.resourcemanager.containerservice.generated.models.WeekDay; +import java.time.LocalDate; +import java.util.Arrays; + +/** + * Samples for MaintenanceConfigurations CreateOrUpdate. + */ +public final class MaintenanceConfigurationsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-01-01/MaintenanceConfigurationsCreate_Update_MaintenanceWindow.json + */ + /** + * Sample code: Create/Update Maintenance Configuration with Maintenance Window. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createUpdateMaintenanceConfigurationWithMaintenanceWindow( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.maintenanceConfigurations() + .define("aksManagedAutoUpgradeSchedule") + .withExistingManagedCluster("rg1", "clustername1") + .withMaintenanceWindow(new MaintenanceWindow() + .withSchedule(new Schedule().withRelativeMonthly(new RelativeMonthlySchedule().withIntervalMonths(3) + .withWeekIndex(Type.FIRST) + .withDayOfWeek(WeekDay.MONDAY))) + .withDurationHours(10) + .withUtcOffset("+05:30") + .withStartDate(LocalDate.parse("2023-01-01")) + .withStartTime("08:30") + .withNotAllowedDates(Arrays.asList( + new DateSpan().withStart(LocalDate.parse("2023-02-18")).withEnd(LocalDate.parse("2023-02-25")), + new DateSpan().withStart(LocalDate.parse("2023-12-23")).withEnd(LocalDate.parse("2024-01-05"))))) + .create(); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationsDeleteSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationsDeleteSamples.java new file mode 100644 index 000000000000..582f010dc606 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationsDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for MaintenanceConfigurations Delete. + */ +public final class MaintenanceConfigurationsDeleteSamples { + /* + * x-ms-original-file: 2026-01-01/MaintenanceConfigurationsDelete_MaintenanceWindow.json + */ + /** + * Sample code: Delete Maintenance Configuration For Node OS Upgrade. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void deleteMaintenanceConfigurationForNodeOSUpgrade( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.maintenanceConfigurations() + .deleteWithResponse("rg1", "clustername1", "aksManagedNodeOSUpgradeSchedule", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationsGetSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationsGetSamples.java new file mode 100644 index 000000000000..278160d70b6c --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for MaintenanceConfigurations Get. + */ +public final class MaintenanceConfigurationsGetSamples { + /* + * x-ms-original-file: 2026-01-01/MaintenanceConfigurationsGet_MaintenanceWindow.json + */ + /** + * Sample code: Get Maintenance Configuration Configured With Maintenance Window. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getMaintenanceConfigurationConfiguredWithMaintenanceWindow( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.maintenanceConfigurations() + .getWithResponse("rg1", "clustername1", "aksManagedNodeOSUpgradeSchedule", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationsListByManagedClusterSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationsListByManagedClusterSamples.java new file mode 100644 index 000000000000..143482d818dc --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationsListByManagedClusterSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for MaintenanceConfigurations ListByManagedCluster. + */ +public final class MaintenanceConfigurationsListByManagedClusterSamples { + /* + * x-ms-original-file: 2026-01-01/MaintenanceConfigurationsList_MaintenanceWindow.json + */ + /** + * Sample code: List maintenance configurations configured with maintenance window by Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listMaintenanceConfigurationsConfiguredWithMaintenanceWindowByManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.maintenanceConfigurations() + .listByManagedCluster("rg1", "clustername1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersAbortLatestOperationSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersAbortLatestOperationSamples.java new file mode 100644 index 000000000000..0dade9c84feb --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersAbortLatestOperationSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for ManagedClusters AbortLatestOperation. + */ +public final class ManagedClustersAbortLatestOperationSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedClustersAbortOperation.json + */ + /** + * Sample code: Abort operation on managed cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void abortOperationOnManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters().abortLatestOperation("rg1", "clustername1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersCreateOrUpdateSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersCreateOrUpdateSamples.java new file mode 100644 index 000000000000..f8b2921a0abb --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersCreateOrUpdateSamples.java @@ -0,0 +1,1512 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.resourcemanager.containerservice.generated.models.AdvancedNetworkPolicies; +import com.azure.resourcemanager.containerservice.generated.models.AdvancedNetworking; +import com.azure.resourcemanager.containerservice.generated.models.AdvancedNetworkingObservability; +import com.azure.resourcemanager.containerservice.generated.models.AdvancedNetworkingSecurity; +import com.azure.resourcemanager.containerservice.generated.models.AdvancedNetworkingSecurityTransitEncryption; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolMode; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolType; +import com.azure.resourcemanager.containerservice.generated.models.ClusterUpgradeSettings; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServiceLinuxProfile; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServiceNetworkProfile; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServiceSshConfiguration; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServiceSshPublicKey; +import com.azure.resourcemanager.containerservice.generated.models.CreationData; +import com.azure.resourcemanager.containerservice.generated.models.Expander; +import com.azure.resourcemanager.containerservice.generated.models.GPUInstanceProfile; +import com.azure.resourcemanager.containerservice.generated.models.IPFamily; +import com.azure.resourcemanager.containerservice.generated.models.IstioCertificateAuthority; +import com.azure.resourcemanager.containerservice.generated.models.IstioComponents; +import com.azure.resourcemanager.containerservice.generated.models.IstioEgressGateway; +import com.azure.resourcemanager.containerservice.generated.models.IstioIngressGateway; +import com.azure.resourcemanager.containerservice.generated.models.IstioIngressGatewayMode; +import com.azure.resourcemanager.containerservice.generated.models.IstioPluginCertificateAuthority; +import com.azure.resourcemanager.containerservice.generated.models.IstioServiceMesh; +import com.azure.resourcemanager.containerservice.generated.models.KubernetesSupportPlan; +import com.azure.resourcemanager.containerservice.generated.models.LicenseType; +import com.azure.resourcemanager.containerservice.generated.models.LoadBalancerSku; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAADProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAddonProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAgentPoolProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterApiServerAccessProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterHttpProxyConfig; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterIdentity; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterIngressProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterIngressProfileWebAppRouting; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterLoadBalancerProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterManagedOutboundIPProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterNATGatewayProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterPodIdentityProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterPropertiesAutoScalerProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSKU; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSKUName; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSKUTier; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSecurityProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSecurityProfileDefender; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSecurityProfileDefenderSecurityMonitoring; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSecurityProfileWorkloadIdentity; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterServicePrincipalProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterWindowsProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedServiceIdentityUserAssignedIdentitiesValue; +import com.azure.resourcemanager.containerservice.generated.models.NetworkDataplane; +import com.azure.resourcemanager.containerservice.generated.models.NetworkPlugin; +import com.azure.resourcemanager.containerservice.generated.models.NetworkPluginMode; +import com.azure.resourcemanager.containerservice.generated.models.OSSKU; +import com.azure.resourcemanager.containerservice.generated.models.OSType; +import com.azure.resourcemanager.containerservice.generated.models.OutboundType; +import com.azure.resourcemanager.containerservice.generated.models.ResourceIdentityType; +import com.azure.resourcemanager.containerservice.generated.models.ScaleDownMode; +import com.azure.resourcemanager.containerservice.generated.models.ServiceMeshMode; +import com.azure.resourcemanager.containerservice.generated.models.ServiceMeshProfile; +import com.azure.resourcemanager.containerservice.generated.models.TransitEncryptionType; +import com.azure.resourcemanager.containerservice.generated.models.UpgradeOverrideSettings; +import com.azure.resourcemanager.containerservice.generated.models.WindowsGmsaProfile; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ManagedClusters CreateOrUpdate. + */ +public final class ManagedClustersCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_CRG.json + */ + /** + * Sample code: Create Managed Cluster with Capacity Reservation Group. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithCapacityReservationGroup( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIP(true) + .withCapacityReservationGroupID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/capacityReservationGroups/crg1") + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_CustomCATrustCertificates.json + */ + /** + * Sample code: Create Managed Cluster with Custom CA Trust Certificates. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithCustomCATrustCertificates( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIP(true) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .withSecurityProfile(new ManagedClusterSecurityProfile().withCustomCATrustCertificates( + Arrays.asList("ZHVtbXlFeGFtcGxlVGVzdFZhbHVlRm9yQ2VydGlmaWNhdGVUb0JlQWRkZWQ=".getBytes()))) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_DualStackNetworking.json + */ + /** + * Sample code: Create/Update Managed Cluster with dual-stack networking. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createUpdateManagedClusterWithDualStackNetworking( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withIdentity(new ManagedClusterIdentity().withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1", + new ManagedServiceIdentityUserAssignedIdentitiesValue()))) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS1_v2") + .withOsType(OSType.LINUX) + .withScaleDownMode(ScaleDownMode.DEALLOCATE) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withAvailabilityZones(Arrays.asList("1", "2", "3")) + .withEnableNodePublicIP(true) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2))) + .withIpFamilies(Arrays.asList(IPFamily.IPV4, IPFamily.IPV6))) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withBalanceSimilarNodeGroups("true") + .withExpander(Expander.PRIORITY) + .withMaxNodeProvisionTime("15m") + .withNewPodScaleUpDelay("1m") + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m") + .withSkipNodesWithSystemPods("false")) + .withDiskEncryptionSetID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_PodIdentity.json + */ + /** + * Sample code: Create Managed Cluster with PodIdentity enabled. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithPodIdentityEnabled( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIP(true) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withPodIdentityProfile( + new ManagedClusterPodIdentityProfile().withEnabled(true).withAllowNetworkPluginKubenet(true)) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_UserAssignedNATGateway.json + */ + /** + * Sample code: Create Managed Cluster with user-assigned NAT gateway as outbound type. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithUserAssignedNATGatewayAsOutboundType( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIP(false) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withEnableRBAC(true) + .withNetworkProfile( + new ContainerServiceNetworkProfile().withOutboundType(OutboundType.USER_ASSIGNED_NATGATEWAY) + .withLoadBalancerSku(LoadBalancerSku.STANDARD)) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_Update.json + */ + /** + * Sample code: Create/Update Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createUpdateManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withIdentity(new ManagedClusterIdentity().withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1", + new ManagedServiceIdentityUserAssignedIdentitiesValue()))) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS1_v2") + .withOsType(OSType.LINUX) + .withScaleDownMode(ScaleDownMode.DEALLOCATE) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withAvailabilityZones(Arrays.asList("1", "2", "3")) + .withEnableNodePublicIP(true) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withUpgradeSettings( + new ClusterUpgradeSettings().withOverrideSettings(new UpgradeOverrideSettings().withForceUpgrade(false) + .withUntil(OffsetDateTime.parse("2022-11-01T13:00:00Z")))) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withBalanceSimilarNodeGroups("true") + .withExpander(Expander.PRIORITY) + .withMaxNodeProvisionTime("15m") + .withNewPodScaleUpDelay("1m") + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m") + .withSkipNodesWithSystemPods("false")) + .withDiskEncryptionSetID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_PrivateClusterFQDNSubdomain.json + */ + /** + * Sample code: Create Managed Private Cluster with fqdn subdomain specified. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedPrivateClusterWithFqdnSubdomainSpecified( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withKubernetesVersion("") + .withFqdnSubdomain("domain1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIP(true) + .withEnableEncryptionAtHost(true) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withApiServerAccessProfile(new ManagedClusterApiServerAccessProfile().withEnablePrivateCluster(true) + .withPrivateDNSZone( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateDnsZones/privatelink.location1.azmk8s.io")) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_ManagedNATGateway.json + */ + /** + * Sample code: Create Managed Cluster with AKS-managed NAT gateway as outbound type. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithAKSManagedNATGatewayAsOutboundType( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIP(false) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.MANAGED_NATGATEWAY) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withNatGatewayProfile(new ManagedClusterNATGatewayProfile() + .withManagedOutboundIPProfile(new ManagedClusterManagedOutboundIPProfile().withCount(2)))) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_Premium.json + */ + /** + * Sample code: Create Managed Cluster with LongTermSupport. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithLongTermSupport( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku( + new ManagedClusterSKU().withName(ManagedClusterSKUName.BASE).withTier(ManagedClusterSKUTier.PREMIUM)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIP(true) + .withEnableEncryptionAtHost(true) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withEnableRBAC(true) + .withSupportPlan(KubernetesSupportPlan.AKSLONG_TERM_SUPPORT) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withApiServerAccessProfile(new ManagedClusterApiServerAccessProfile().withDisableRunCommand(true)) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_NodePublicIPPrefix.json + */ + /** + * Sample code: Create Managed Cluster with Node Public IP Prefix. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithNodePublicIPPrefix( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIP(true) + .withNodePublicIPPrefixID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/public-ip-prefix") + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_EnableEncryptionAtHost.json + */ + /** + * Sample code: Create Managed Cluster with EncryptionAtHost enabled. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithEncryptionAtHostEnabled( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIP(true) + .withEnableEncryptionAtHost(true) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_PrivateClusterPublicFQDN.json + */ + /** + * Sample code: Create Managed Private Cluster with Public FQDN specified. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedPrivateClusterWithPublicFQDNSpecified( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIP(true) + .withEnableEncryptionAtHost(true) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withApiServerAccessProfile(new ManagedClusterApiServerAccessProfile().withEnablePrivateCluster(true) + .withEnablePrivateClusterPublicFQDN(true)) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_HTTPProxy.json + */ + /** + * Sample code: Create Managed Cluster with HTTP proxy configured. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithHTTPProxyConfigured( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIP(true) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .withHttpProxyConfig(new ManagedClusterHttpProxyConfig().withHttpProxy("http://myproxy.server.com:8080") + .withHttpsProxy("https://myproxy.server.com:8080") + .withNoProxy(Arrays.asList("localhost", "127.0.0.1")) + .withTrustedCa("Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U=")) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_DedicatedHostGroup.json + */ + /** + * Sample code: Create Managed Cluster with Dedicated Host Group. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithDedicatedHostGroup( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withEnableNodePublicIP(true) + .withHostGroupID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1") + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_EnabledFIPS.json + */ + /** + * Sample code: Create Managed Cluster with FIPS enabled OS. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithFIPSEnabledOS( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIP(true) + .withEnableFIPS(true) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_SecurityProfile.json + */ + /** + * Sample code: Create Managed Cluster with Security Profile configured. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithSecurityProfileConfigured( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIP(true) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withSecurityProfile(new ManagedClusterSecurityProfile() + .withDefender(new ManagedClusterSecurityProfileDefender().withLogAnalyticsWorkspaceResourceId( + "/subscriptions/SUB_ID/resourceGroups/RG_NAME/providers/microsoft.operationalinsights/workspaces/WORKSPACE_NAME") + .withSecurityMonitoring( + new ManagedClusterSecurityProfileDefenderSecurityMonitoring().withEnabled(true))) + .withWorkloadIdentity(new ManagedClusterSecurityProfileWorkloadIdentity().withEnabled(true))) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_PPG.json + */ + /** + * Sample code: Create Managed Cluster with PPG. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithPPG( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIP(true) + .withProximityPlacementGroupID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1") + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_IngressProfile_WebAppRouting.json + */ + /** + * Sample code: Create Managed Cluster with Web App Routing Ingress Profile configured. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithWebAppRoutingIngressProfileConfigured( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIP(true) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withIngressProfile(new ManagedClusterIngressProfile() + .withWebAppRouting(new ManagedClusterIngressProfileWebAppRouting().withEnabled(true) + .withDnsZoneResourceIds(Arrays.asList( + "/subscriptions/SUB_ID/resourceGroups/RG_NAME/providers/Microsoft.Network/dnszones/DNS_ZONE_NAME")))) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_UpdateWithAHUB.json + */ + /** + * Sample code: Create/Update Managed Cluster with EnableAHUB. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createUpdateManagedClusterWithEnableAHUB( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withIdentity(new ManagedClusterIdentity().withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1", + new ManagedServiceIdentityUserAssignedIdentitiesValue()))) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS1_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withAvailabilityZones(Arrays.asList("1", "2", "3")) + .withEnableNodePublicIP(true) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder") + .withLicenseType(LicenseType.WINDOWS_SERVER)) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_DisableRunCommand.json + */ + /** + * Sample code: Create Managed Cluster with RunCommand disabled. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithRunCommandDisabled( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIP(true) + .withEnableEncryptionAtHost(true) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withApiServerAccessProfile(new ManagedClusterApiServerAccessProfile().withDisableRunCommand(true)) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_AzureServiceMesh.json + */ + /** + * Sample code: Create/Update Managed Cluster with Azure Service Mesh. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createUpdateManagedClusterWithAzureServiceMesh( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIP(true) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf("azureKeyvaultSecretsProvider", + new ManagedClusterAddonProfile().withEnabled(true) + .withConfig(mapOf("enableSecretRotation", "fakeTokenPlaceholder", "rotationPollInterval", "2m")))) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .withServiceMeshProfile( + new ServiceMeshProfile().withMode(ServiceMeshMode.ISTIO) + .withIstio( + new IstioServiceMesh() + .withComponents(new IstioComponents() + .withIngressGateways( + Arrays.asList(new IstioIngressGateway().withMode(IstioIngressGatewayMode.INTERNAL) + .withEnabled(true))) + .withEgressGateways(Arrays.asList(new IstioEgressGateway().withEnabled(true) + .withName("test-istio-egress") + .withGatewayConfigurationName("test-gateway-configuration")))) + .withCertificateAuthority(new IstioCertificateAuthority() + .withPlugin(new IstioPluginCertificateAuthority().withKeyVaultId("fakeTokenPlaceholder") + .withCertObjectName("ca-cert") + .withKeyObjectName("fakeTokenPlaceholder") + .withRootCertObjectName("root-cert") + .withCertChainObjectName("cert-chain"))))) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_Snapshot.json + */ + /** + * Sample code: Create Managed Cluster using an agent pool snapshot. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterUsingAnAgentPoolSnapshot( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIP(true) + .withEnableFIPS(true) + .withCreationData(new CreationData().withSourceResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1")) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_AzureKeyvaultSecretsProvider.json + */ + /** + * Sample code: Create Managed Cluster with Azure KeyVault Secrets Provider Addon. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithAzureKeyVaultSecretsProviderAddon( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIP(true) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf("azureKeyvaultSecretsProvider", + new ManagedClusterAddonProfile().withEnabled(true) + .withConfig(mapOf("enableSecretRotation", "fakeTokenPlaceholder", "rotationPollInterval", "2m")))) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_OSSKU.json + */ + /** + * Sample code: Create Managed Cluster with OSSKU. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithOSSKU( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withOsSKU(OSSKU.AZURE_LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIP(true) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .withHttpProxyConfig(new ManagedClusterHttpProxyConfig().withHttpProxy("http://myproxy.server.com:8080") + .withHttpsProxy("https://myproxy.server.com:8080") + .withNoProxy(Arrays.asList("localhost", "127.0.0.1")) + .withTrustedCa("Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U=")) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/AdvancedNetworkingTransitEncryption.json + */ + /** + * Sample code: Create Managed Cluster with Advanced Networking Transit Encryption. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithAdvancedNetworkingTransitEncryption( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIP(true) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withNetworkPlugin(NetworkPlugin.AZURE) + .withNetworkPluginMode(NetworkPluginMode.OVERLAY) + .withNetworkDataplane(NetworkDataplane.CILIUM) + .withAdvancedNetworking(new AdvancedNetworking().withEnabled(true) + .withObservability(new AdvancedNetworkingObservability().withEnabled(false)) + .withSecurity(new AdvancedNetworkingSecurity().withEnabled(true) + .withAdvancedNetworkPolicies(AdvancedNetworkPolicies.FQDN) + .withTransitEncryption(new AdvancedNetworkingSecurityTransitEncryption() + .withType(TransitEncryptionType.WIRE_GUARD)))) + .withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_UpdateWithEnableAzureRBAC.json + */ + /** + * Sample code: Create/Update AAD Managed Cluster with EnableAzureRBAC. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createUpdateAADManagedClusterWithEnableAzureRBAC( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS1_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withAvailabilityZones(Arrays.asList("1", "2", "3")) + .withEnableNodePublicIP(true) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAadProfile(new ManagedClusterAADProfile().withManaged(true).withEnableAzureRBAC(true)) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_EnableUltraSSD.json + */ + /** + * Sample code: Create Managed Cluster with UltraSSD enabled. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithUltraSSDEnabled( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIP(true) + .withEnableUltraSSD(true) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_UpdateWindowsGmsa.json + */ + /** + * Sample code: Create/Update Managed Cluster with Windows gMSA enabled. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createUpdateManagedClusterWithWindowsGMSAEnabled( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withIdentity(new ManagedClusterIdentity().withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1", + new ManagedServiceIdentityUserAssignedIdentitiesValue()))) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_DS1_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withAvailabilityZones(Arrays.asList("1", "2", "3")) + .withEnableNodePublicIP(true) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder") + .withGmsaProfile(new WindowsGmsaProfile().withEnabled(true))) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: 2026-01-01/ManagedClustersCreate_GPUMIG.json + */ + /** + * Sample code: Create Managed Cluster with GPUMIG. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithGPUMIG( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSKU().withName(ManagedClusterSKUName.fromString("Basic")) + .withTier(ManagedClusterSKUTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3) + .withVmSize("Standard_ND96asr_v4") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIP(true) + .withGpuInstanceProfile(GPUInstanceProfile.MIG3G) + .withName("nodepool1"))) + .withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser") + .withSsh(new ContainerServiceSshConfiguration().withPublicKeys( + Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder"))))) + .withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser") + .withAdminPassword("fakeTokenPlaceholder")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder")) + .withAddonProfiles(mapOf()) + .withEnableRBAC(true) + .withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetID( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .withHttpProxyConfig(new ManagedClusterHttpProxyConfig().withHttpProxy("http://myproxy.server.com:8080") + .withHttpsProxy("https://myproxy.server.com:8080") + .withNoProxy(Arrays.asList("localhost", "127.0.0.1")) + .withTrustedCa("Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U=")) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersDeleteSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersDeleteSamples.java new file mode 100644 index 000000000000..bd13f12d59e4 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for ManagedClusters Delete. + */ +public final class ManagedClustersDeleteSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedClustersDelete.json + */ + /** + * Sample code: Delete Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + deleteManagedCluster(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters().delete("rg1", "clustername1", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetAccessProfileSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetAccessProfileSamples.java new file mode 100644 index 000000000000..ff8e205453a4 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetAccessProfileSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for ManagedClusters GetAccessProfile. + */ +public final class ManagedClustersGetAccessProfileSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedClustersGetAccessProfile.json + */ + /** + * Sample code: Get Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + getManagedCluster(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .getAccessProfileWithResponse("rg1", "clustername1", "clusterUser", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetByResourceGroupSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetByResourceGroupSamples.java new file mode 100644 index 000000000000..267347ae2d0f --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetByResourceGroupSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for ManagedClusters GetByResourceGroup. + */ +public final class ManagedClustersGetByResourceGroupSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedClustersGet.json + */ + /** + * Sample code: Get Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + getManagedCluster(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .getByResourceGroupWithResponse("rg1", "clustername1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetCommandResultSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetCommandResultSamples.java new file mode 100644 index 000000000000..5458c81fc85e --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetCommandResultSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for ManagedClusters GetCommandResult. + */ +public final class ManagedClustersGetCommandResultSamples { + /* + * x-ms-original-file: 2026-01-01/RunCommandResultFailed.json + */ + /** + * Sample code: commandFailedResult. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + commandFailedResult(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .getCommandResultWithResponse("rg1", "clustername1", "def7b3ea71bd4f7e9d226ddbc0f00ad9", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-01-01/RunCommandResultSucceed.json + */ + /** + * Sample code: commandSucceedResult. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + commandSucceedResult(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .getCommandResultWithResponse("rg1", "clustername1", "def7b3ea71bd4f7e9d226ddbc0f00ad9", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetMeshRevisionProfileSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetMeshRevisionProfileSamples.java new file mode 100644 index 000000000000..056e28132cac --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetMeshRevisionProfileSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for ManagedClusters GetMeshRevisionProfile. + */ +public final class ManagedClustersGetMeshRevisionProfileSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedClustersGet_MeshRevisionProfile.json + */ + /** + * Sample code: Get a mesh revision profile for a mesh mode. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getAMeshRevisionProfileForAMeshMode( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .getMeshRevisionProfileWithResponse("location1", "istio", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetMeshUpgradeProfileSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetMeshUpgradeProfileSamples.java new file mode 100644 index 000000000000..6e8b5b2eec56 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetMeshUpgradeProfileSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for ManagedClusters GetMeshUpgradeProfile. + */ +public final class ManagedClustersGetMeshUpgradeProfileSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedClustersGet_MeshUpgradeProfile.json + */ + /** + * Sample code: Gets version compatibility and upgrade profile for a service mesh in a cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getsVersionCompatibilityAndUpgradeProfileForAServiceMeshInACluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .getMeshUpgradeProfileWithResponse("rg1", "clustername1", "istio", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetUpgradeProfileSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetUpgradeProfileSamples.java new file mode 100644 index 000000000000..953fd4eed633 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetUpgradeProfileSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for ManagedClusters GetUpgradeProfile. + */ +public final class ManagedClustersGetUpgradeProfileSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedClustersGetUpgradeProfile.json + */ + /** + * Sample code: Get Upgrade Profile for Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getUpgradeProfileForManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .getUpgradeProfileWithResponse("rg1", "clustername1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListByResourceGroupSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListByResourceGroupSamples.java new file mode 100644 index 000000000000..e83fc678eba2 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for ManagedClusters ListByResourceGroup. + */ +public final class ManagedClustersListByResourceGroupSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedClustersListByResourceGroup.json + */ + /** + * Sample code: Get Managed Clusters by Resource Group. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getManagedClustersByResourceGroup( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListClusterAdminCredentialsSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListClusterAdminCredentialsSamples.java new file mode 100644 index 000000000000..6694487ee5de --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListClusterAdminCredentialsSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for ManagedClusters ListClusterAdminCredentials. + */ +public final class ManagedClustersListClusterAdminCredentialsSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedClustersListClusterAdminCredentials.json + */ + /** + * Sample code: Get Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + getManagedCluster(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .listClusterAdminCredentialsWithResponse("rg1", "clustername1", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListClusterMonitoringUserCredentialsSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListClusterMonitoringUserCredentialsSamples.java new file mode 100644 index 000000000000..307db0b51b0b --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListClusterMonitoringUserCredentialsSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for ManagedClusters ListClusterMonitoringUserCredentials. + */ +public final class ManagedClustersListClusterMonitoringUserCredentialsSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedClustersListClusterMonitoringUserCredentials.json + */ + /** + * Sample code: Get Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + getManagedCluster(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .listClusterMonitoringUserCredentialsWithResponse("rg1", "clustername1", null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListClusterUserCredentialsSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListClusterUserCredentialsSamples.java new file mode 100644 index 000000000000..36167acd18e6 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListClusterUserCredentialsSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for ManagedClusters ListClusterUserCredentials. + */ +public final class ManagedClustersListClusterUserCredentialsSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedClustersListClusterUserCredentials.json + */ + /** + * Sample code: Get Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + getManagedCluster(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .listClusterUserCredentialsWithResponse("rg1", "clustername1", null, null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListKubernetesVersionsSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListKubernetesVersionsSamples.java new file mode 100644 index 000000000000..6870adaebbaa --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListKubernetesVersionsSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for ManagedClusters ListKubernetesVersions. + */ +public final class ManagedClustersListKubernetesVersionsSamples { + /* + * x-ms-original-file: 2026-01-01/KubernetesVersions_List.json + */ + /** + * Sample code: List Kubernetes Versions. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + listKubernetesVersions(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters().listKubernetesVersionsWithResponse("location1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListMeshRevisionProfilesSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListMeshRevisionProfilesSamples.java new file mode 100644 index 000000000000..c98cd989dbb5 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListMeshRevisionProfilesSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for ManagedClusters ListMeshRevisionProfiles. + */ +public final class ManagedClustersListMeshRevisionProfilesSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedClustersList_MeshRevisionProfiles.json + */ + /** + * Sample code: List mesh revision profiles in a location. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listMeshRevisionProfilesInALocation( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters().listMeshRevisionProfiles("location1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListMeshUpgradeProfilesSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListMeshUpgradeProfilesSamples.java new file mode 100644 index 000000000000..4a690400acf8 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListMeshUpgradeProfilesSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for ManagedClusters ListMeshUpgradeProfiles. + */ +public final class ManagedClustersListMeshUpgradeProfilesSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedClustersList_MeshUpgradeProfiles.json + */ + /** + * Sample code: Lists version compatibility and upgrade profile for all service meshes in a cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listsVersionCompatibilityAndUpgradeProfileForAllServiceMeshesInACluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters().listMeshUpgradeProfiles("rg1", "clustername1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListOutboundNetworkDependenciesEndpointsSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListOutboundNetworkDependenciesEndpointsSamples.java new file mode 100644 index 000000000000..5d4ba4f80a39 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListOutboundNetworkDependenciesEndpointsSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for ManagedClusters ListOutboundNetworkDependenciesEndpoints. + */ +public final class ManagedClustersListOutboundNetworkDependenciesEndpointsSamples { + /* + * x-ms-original-file: 2026-01-01/OutboundNetworkDependenciesEndpointsList.json + */ + /** + * Sample code: List OutboundNetworkDependenciesEndpoints by Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listOutboundNetworkDependenciesEndpointsByManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .listOutboundNetworkDependenciesEndpoints("rg1", "clustername1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListSamples.java new file mode 100644 index 000000000000..a809a5a3c2cb --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for ManagedClusters List. + */ +public final class ManagedClustersListSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedClustersList.json + */ + /** + * Sample code: List Managed Clusters. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + listManagedClusters(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersResetAADProfileSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersResetAADProfileSamples.java new file mode 100644 index 000000000000..811c61695c35 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersResetAADProfileSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAADProfile; + +/** + * Samples for ManagedClusters ResetAADProfile. + */ +public final class ManagedClustersResetAADProfileSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedClustersResetAADProfile.json + */ + /** + * Sample code: Reset AAD Profile. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + resetAADProfile(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .resetAADProfile("rg1", "clustername1", + new ManagedClusterAADProfile().withClientAppID("clientappid") + .withServerAppID("serverappid") + .withServerAppSecret("fakeTokenPlaceholder") + .withTenantID("tenantid"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersResetServicePrincipalProfileSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersResetServicePrincipalProfileSamples.java new file mode 100644 index 000000000000..d9e0f944ed0f --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersResetServicePrincipalProfileSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterServicePrincipalProfile; + +/** + * Samples for ManagedClusters ResetServicePrincipalProfile. + */ +public final class ManagedClustersResetServicePrincipalProfileSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedClustersResetServicePrincipalProfile.json + */ + /** + * Sample code: Reset Service Principal Profile. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void resetServicePrincipalProfile( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .resetServicePrincipalProfile("rg1", "clustername1", + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersRotateClusterCertificatesSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersRotateClusterCertificatesSamples.java new file mode 100644 index 000000000000..938447ae1a2a --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersRotateClusterCertificatesSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for ManagedClusters RotateClusterCertificates. + */ +public final class ManagedClustersRotateClusterCertificatesSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedClustersRotateClusterCertificates.json + */ + /** + * Sample code: Rotate Cluster Certificates. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void rotateClusterCertificates( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters().rotateClusterCertificates("rg1", "clustername1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersRotateServiceAccountSigningKeysSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersRotateServiceAccountSigningKeysSamples.java new file mode 100644 index 000000000000..e0b6ade2f5de --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersRotateServiceAccountSigningKeysSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for ManagedClusters RotateServiceAccountSigningKeys. + */ +public final class ManagedClustersRotateServiceAccountSigningKeysSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedClustersRotateServiceAccountSigningKeys.json + */ + /** + * Sample code: Rotate Cluster Service Account Signing Keys. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void rotateClusterServiceAccountSigningKeys( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .rotateServiceAccountSigningKeys("rg1", "clustername1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersRunCommandSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersRunCommandSamples.java new file mode 100644 index 000000000000..8dfd0a1c2328 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersRunCommandSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.resourcemanager.containerservice.generated.models.RunCommandRequest; + +/** + * Samples for ManagedClusters RunCommand. + */ +public final class ManagedClustersRunCommandSamples { + /* + * x-ms-original-file: 2026-01-01/RunCommandRequest.json + */ + /** + * Sample code: submitNewCommand. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + submitNewCommand(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters() + .runCommand("rg1", "clustername1", + new RunCommandRequest().withCommand("kubectl apply -f ns.yaml") + .withContext("") + .withClusterToken("fakeTokenPlaceholder"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersStartSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersStartSamples.java new file mode 100644 index 000000000000..e92965c89a8b --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersStartSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for ManagedClusters Start. + */ +public final class ManagedClustersStartSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedClustersStart.json + */ + /** + * Sample code: Start Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + startManagedCluster(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters().start("rg1", "clustername1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersStopSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersStopSamples.java new file mode 100644 index 000000000000..ddd492bf7a69 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersStopSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for ManagedClusters Stop. + */ +public final class ManagedClustersStopSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedClustersStop.json + */ + /** + * Sample code: Stop Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + stopManagedCluster(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters().stop("rg1", "clustername1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersUpdateTagsSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersUpdateTagsSamples.java new file mode 100644 index 000000000000..940b26f3ab04 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersUpdateTagsSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.resourcemanager.containerservice.generated.models.ManagedCluster; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ManagedClusters UpdateTags. + */ +public final class ManagedClustersUpdateTagsSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedClustersUpdateTags.json + */ + /** + * Sample code: Update Managed Cluster Tags. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + updateManagedClusterTags(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + ManagedCluster resource = manager.managedClusters() + .getByResourceGroupWithResponse("rg1", "clustername1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("archv3", "", "tier", "testing")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedNamespacesCreateOrUpdateSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedNamespacesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..b8904d4b2d46 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedNamespacesCreateOrUpdateSamples.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.resourcemanager.containerservice.generated.models.AdoptionPolicy; +import com.azure.resourcemanager.containerservice.generated.models.DeletePolicy; +import com.azure.resourcemanager.containerservice.generated.models.NamespaceProperties; +import com.azure.resourcemanager.containerservice.generated.models.NetworkPolicies; +import com.azure.resourcemanager.containerservice.generated.models.PolicyRule; +import com.azure.resourcemanager.containerservice.generated.models.ResourceQuota; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ManagedNamespaces CreateOrUpdate. + */ +public final class ManagedNamespacesCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedNamespacesCreate_Update.json + */ + /** + * Sample code: Create/Update Managed Namespace. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createUpdateManagedNamespace( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedNamespaces() + .define("namespace1") + .withExistingManagedCluster("rg1", "clustername1") + .withTags(mapOf("tagKey1", "fakeTokenPlaceholder")) + .withProperties(new NamespaceProperties().withLabels(mapOf("kubernetes.io/metadata.name", "true")) + .withAnnotations(mapOf("annatationKey", "fakeTokenPlaceholder")) + .withDefaultResourceQuota(new ResourceQuota().withCpuRequest("3m") + .withCpuLimit("3m") + .withMemoryRequest("5Gi") + .withMemoryLimit("5Gi")) + .withDefaultNetworkPolicy( + new NetworkPolicies().withIngress(PolicyRule.ALLOW_SAME_NAMESPACE).withEgress(PolicyRule.ALLOW_ALL)) + .withAdoptionPolicy(AdoptionPolicy.IF_IDENTICAL) + .withDeletePolicy(DeletePolicy.KEEP)) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedNamespacesDeleteSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedNamespacesDeleteSamples.java new file mode 100644 index 000000000000..f82ef3f6b0fe --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedNamespacesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for ManagedNamespaces Delete. + */ +public final class ManagedNamespacesDeleteSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedNamespacesDelete.json + */ + /** + * Sample code: Delete Managed Namespace. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + deleteManagedNamespace(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedNamespaces().delete("rg1", "clustername1", "namespace1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedNamespacesGetSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedNamespacesGetSamples.java new file mode 100644 index 000000000000..d3eab51d0bfb --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedNamespacesGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for ManagedNamespaces Get. + */ +public final class ManagedNamespacesGetSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedNamespacesGet.json + */ + /** + * Sample code: Get Managed Namespace. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + getManagedNamespace(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedNamespaces() + .getWithResponse("rg1", "clustername1", "namespace1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedNamespacesListByManagedClusterSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedNamespacesListByManagedClusterSamples.java new file mode 100644 index 000000000000..5517fb17585a --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedNamespacesListByManagedClusterSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for ManagedNamespaces ListByManagedCluster. + */ +public final class ManagedNamespacesListByManagedClusterSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedNamespacesList.json + */ + /** + * Sample code: List namespaces by Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listNamespacesByManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedNamespaces().listByManagedCluster("rg1", "clustername1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedNamespacesListCredentialSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedNamespacesListCredentialSamples.java new file mode 100644 index 000000000000..2711e3c24c4c --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedNamespacesListCredentialSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for ManagedNamespaces ListCredential. + */ +public final class ManagedNamespacesListCredentialSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedNamespacesListCredentialResult.json + */ + /** + * Sample code: List managed namespace credentials. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listManagedNamespaceCredentials( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedNamespaces() + .listCredentialWithResponse("rg1", "clustername1", "namespace1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedNamespacesUpdateSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedNamespacesUpdateSamples.java new file mode 100644 index 000000000000..de3b1915f7f8 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedNamespacesUpdateSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.resourcemanager.containerservice.generated.models.ManagedNamespace; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ManagedNamespaces Update. + */ +public final class ManagedNamespacesUpdateSamples { + /* + * x-ms-original-file: 2026-01-01/ManagedNamespacesUpdateTags.json + */ + /** + * Sample code: Update Managed Namespace Tags. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void updateManagedNamespaceTags( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + ManagedNamespace resource = manager.managedNamespaces() + .getWithResponse("rg1", "clustername1", "namespace1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagKey1", "fakeTokenPlaceholder", "tagKey2", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/OperationsListSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/OperationsListSamples.java new file mode 100644 index 000000000000..a6a286a36fc9 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/OperationsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: 2026-01-01/Operation_List.json + */ + /** + * Sample code: List available operations for the container service resource provider. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listAvailableOperationsForTheContainerServiceResourceProvider( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionsDeleteSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionsDeleteSamples.java new file mode 100644 index 000000000000..1b37a75a7787 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionsDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for PrivateEndpointConnections Delete. + */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: 2026-01-01/PrivateEndpointConnectionsDelete.json + */ + /** + * Sample code: Delete Private Endpoint Connection. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void deletePrivateEndpointConnection( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.privateEndpointConnections() + .delete("rg1", "clustername1", "privateendpointconnection1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionsGetSamples.java new file mode 100644 index 000000000000..70274659e6ba --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for PrivateEndpointConnections Get. + */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: 2026-01-01/PrivateEndpointConnectionsGet.json + */ + /** + * Sample code: Get Private Endpoint Connection. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getPrivateEndpointConnection( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.privateEndpointConnections() + .getWithResponse("rg1", "clustername1", "privateendpointconnection1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionsListSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionsListSamples.java new file mode 100644 index 000000000000..8967358f1b82 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for PrivateEndpointConnections List. + */ +public final class PrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: 2026-01-01/PrivateEndpointConnectionsList.json + */ + /** + * Sample code: List Private Endpoint Connections by Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listPrivateEndpointConnectionsByManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.privateEndpointConnections().listWithResponse("rg1", "clustername1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionsUpdateSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionsUpdateSamples.java new file mode 100644 index 000000000000..3f498203601d --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionsUpdateSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.containerservice.generated.models.ConnectionStatus; +import com.azure.resourcemanager.containerservice.generated.models.PrivateLinkServiceConnectionState; + +/** + * Samples for PrivateEndpointConnections Update. + */ +public final class PrivateEndpointConnectionsUpdateSamples { + /* + * x-ms-original-file: 2026-01-01/PrivateEndpointConnectionsUpdate.json + */ + /** + * Sample code: Update Private Endpoint Connection. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void updatePrivateEndpointConnection( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.privateEndpointConnections() + .updateWithResponse("rg1", "clustername1", "privateendpointconnection1", + new PrivateEndpointConnectionInner().withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState().withStatus(ConnectionStatus.APPROVED)), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateLinkResourcesListSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateLinkResourcesListSamples.java new file mode 100644 index 000000000000..35c73e6f1e6c --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateLinkResourcesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for PrivateLinkResources List. + */ +public final class PrivateLinkResourcesListSamples { + /* + * x-ms-original-file: 2026-01-01/PrivateLinkResourcesList.json + */ + /** + * Sample code: List Private Link Resources by Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listPrivateLinkResourcesByManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.privateLinkResources().listWithResponse("rg1", "clustername1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ResolvePrivateLinkServiceIdPOSTSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ResolvePrivateLinkServiceIdPOSTSamples.java new file mode 100644 index 000000000000..27f97a956082 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ResolvePrivateLinkServiceIdPOSTSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateLinkResourceInner; + +/** + * Samples for ResolvePrivateLinkServiceId POST. + */ +public final class ResolvePrivateLinkServiceIdPOSTSamples { + /* + * x-ms-original-file: 2026-01-01/ResolvePrivateLinkServiceId.json + */ + /** + * Sample code: Resolve the Private Link Service ID for Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void resolveThePrivateLinkServiceIDForManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.resolvePrivateLinkServiceIds() + .pOSTWithResponse("rg1", "clustername1", new PrivateLinkResourceInner().withName("management"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsCreateOrUpdateSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..7a0e0e788943 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsCreateOrUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.resourcemanager.containerservice.generated.models.CreationData; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Snapshots CreateOrUpdate. + */ +public final class SnapshotsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-01-01/SnapshotsCreate.json + */ + /** + * Sample code: Create/Update Snapshot. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + createUpdateSnapshot(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.snapshots() + .define("snapshot1") + .withRegion("westus") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) + .withCreationData(new CreationData().withSourceResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1/agentPools/pool0")) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsDeleteSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsDeleteSamples.java new file mode 100644 index 000000000000..943b0c280058 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for Snapshots Delete. + */ +public final class SnapshotsDeleteSamples { + /* + * x-ms-original-file: 2026-01-01/SnapshotsDelete.json + */ + /** + * Sample code: Delete Snapshot. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + deleteSnapshot(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.snapshots().deleteByResourceGroupWithResponse("rg1", "snapshot1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsGetByResourceGroupSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..f8dd661161f7 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsGetByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for Snapshots GetByResourceGroup. + */ +public final class SnapshotsGetByResourceGroupSamples { + /* + * x-ms-original-file: 2026-01-01/SnapshotsGet.json + */ + /** + * Sample code: Get Snapshot. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + getSnapshot(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.snapshots().getByResourceGroupWithResponse("rg1", "snapshot1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsListByResourceGroupSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsListByResourceGroupSamples.java new file mode 100644 index 000000000000..fbf02b20bfef --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for Snapshots ListByResourceGroup. + */ +public final class SnapshotsListByResourceGroupSamples { + /* + * x-ms-original-file: 2026-01-01/SnapshotsListByResourceGroup.json + */ + /** + * Sample code: List Snapshots by Resource Group. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listSnapshotsByResourceGroup( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.snapshots().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsListSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsListSamples.java new file mode 100644 index 000000000000..d2020daebd9f --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for Snapshots List. + */ +public final class SnapshotsListSamples { + /* + * x-ms-original-file: 2026-01-01/SnapshotsList.json + */ + /** + * Sample code: List Snapshots. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + listSnapshots(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.snapshots().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsUpdateTagsSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsUpdateTagsSamples.java new file mode 100644 index 000000000000..c15a0eb838b8 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsUpdateTagsSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.resourcemanager.containerservice.generated.models.Snapshot; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Snapshots UpdateTags. + */ +public final class SnapshotsUpdateTagsSamples { + /* + * x-ms-original-file: 2026-01-01/SnapshotsUpdateTags.json + */ + /** + * Sample code: Update Snapshot Tags. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + updateSnapshotTags(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + Snapshot resource = manager.snapshots() + .getByResourceGroupWithResponse("rg1", "snapshot1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key2", "fakeTokenPlaceholder", "key3", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleBindingsCreateOrUpdateSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleBindingsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..49b2670ff126 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleBindingsCreateOrUpdateSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import java.util.Arrays; + +/** + * Samples for TrustedAccessRoleBindings CreateOrUpdate. + */ +public final class TrustedAccessRoleBindingsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-01-01/TrustedAccessRoleBindings_CreateOrUpdate.json + */ + /** + * Sample code: Create or update a trusted access role binding. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createOrUpdateATrustedAccessRoleBinding( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.trustedAccessRoleBindings() + .define("binding1") + .withExistingManagedCluster("rg1", "clustername1") + .withSourceResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/b/providers/Microsoft.MachineLearningServices/workspaces/c") + .withRoles(Arrays.asList("Microsoft.MachineLearningServices/workspaces/reader", + "Microsoft.MachineLearningServices/workspaces/writer")) + .create(); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleBindingsDeleteSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleBindingsDeleteSamples.java new file mode 100644 index 000000000000..81525304b515 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleBindingsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for TrustedAccessRoleBindings Delete. + */ +public final class TrustedAccessRoleBindingsDeleteSamples { + /* + * x-ms-original-file: 2026-01-01/TrustedAccessRoleBindings_Delete.json + */ + /** + * Sample code: Delete a trusted access role binding. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void deleteATrustedAccessRoleBinding( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.trustedAccessRoleBindings().delete("rg1", "clustername1", "binding1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleBindingsGetSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleBindingsGetSamples.java new file mode 100644 index 000000000000..c06671835306 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleBindingsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for TrustedAccessRoleBindings Get. + */ +public final class TrustedAccessRoleBindingsGetSamples { + /* + * x-ms-original-file: 2026-01-01/TrustedAccessRoleBindings_Get.json + */ + /** + * Sample code: Get a trusted access role binding. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getATrustedAccessRoleBinding( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.trustedAccessRoleBindings() + .getWithResponse("rg1", "clustername1", "binding1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleBindingsListSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleBindingsListSamples.java new file mode 100644 index 000000000000..eeb9501e1b61 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleBindingsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for TrustedAccessRoleBindings List. + */ +public final class TrustedAccessRoleBindingsListSamples { + /* + * x-ms-original-file: 2026-01-01/TrustedAccessRoleBindings_List.json + */ + /** + * Sample code: List trusted access role bindings. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listTrustedAccessRoleBindings( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.trustedAccessRoleBindings().list("rg1", "clustername1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRolesListSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRolesListSamples.java new file mode 100644 index 000000000000..226b3fd952b5 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRolesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +/** + * Samples for TrustedAccessRoles List. + */ +public final class TrustedAccessRolesListSamples { + /* + * x-ms-original-file: 2026-01-01/TrustedAccessRoles_List.json + */ + /** + * Sample code: List trusted access roles. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void + listTrustedAccessRoles(com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.trustedAccessRoles().list("westus2", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AbsoluteMonthlyScheduleTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AbsoluteMonthlyScheduleTests.java new file mode 100644 index 000000000000..99d8057a143f --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AbsoluteMonthlyScheduleTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.AbsoluteMonthlySchedule; +import org.junit.jupiter.api.Assertions; + +public final class AbsoluteMonthlyScheduleTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AbsoluteMonthlySchedule model + = BinaryData.fromString("{\"intervalMonths\":1064707426,\"dayOfMonth\":1460544442}") + .toObject(AbsoluteMonthlySchedule.class); + Assertions.assertEquals(1064707426, model.intervalMonths()); + Assertions.assertEquals(1460544442, model.dayOfMonth()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AbsoluteMonthlySchedule model + = new AbsoluteMonthlySchedule().withIntervalMonths(1064707426).withDayOfMonth(1460544442); + model = BinaryData.fromObject(model).toObject(AbsoluteMonthlySchedule.class); + Assertions.assertEquals(1064707426, model.intervalMonths()); + Assertions.assertEquals(1460544442, model.dayOfMonth()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AccessProfileTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AccessProfileTests.java new file mode 100644 index 000000000000..67828432f738 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AccessProfileTests.java @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.fluent.models.AccessProfile; + +public final class AccessProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AccessProfile model = BinaryData.fromString("{}").toObject(AccessProfile.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AdvancedNetworkingObservabilityTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AdvancedNetworkingObservabilityTests.java new file mode 100644 index 000000000000..6b57e555c2ad --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AdvancedNetworkingObservabilityTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.AdvancedNetworkingObservability; +import org.junit.jupiter.api.Assertions; + +public final class AdvancedNetworkingObservabilityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AdvancedNetworkingObservability model + = BinaryData.fromString("{\"enabled\":false}").toObject(AdvancedNetworkingObservability.class); + Assertions.assertFalse(model.enabled()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AdvancedNetworkingObservability model = new AdvancedNetworkingObservability().withEnabled(false); + model = BinaryData.fromObject(model).toObject(AdvancedNetworkingObservability.class); + Assertions.assertFalse(model.enabled()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AdvancedNetworkingPerformanceTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AdvancedNetworkingPerformanceTests.java new file mode 100644 index 000000000000..80cce671d3bf --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AdvancedNetworkingPerformanceTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.AccelerationMode; +import com.azure.resourcemanager.containerservice.generated.models.AdvancedNetworkingPerformance; +import org.junit.jupiter.api.Assertions; + +public final class AdvancedNetworkingPerformanceTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AdvancedNetworkingPerformance model + = BinaryData.fromString("{\"accelerationMode\":\"BpfVeth\"}").toObject(AdvancedNetworkingPerformance.class); + Assertions.assertEquals(AccelerationMode.BPF_VETH, model.accelerationMode()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AdvancedNetworkingPerformance model + = new AdvancedNetworkingPerformance().withAccelerationMode(AccelerationMode.BPF_VETH); + model = BinaryData.fromObject(model).toObject(AdvancedNetworkingPerformance.class); + Assertions.assertEquals(AccelerationMode.BPF_VETH, model.accelerationMode()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AdvancedNetworkingSecurityTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AdvancedNetworkingSecurityTests.java new file mode 100644 index 000000000000..b58d1dd0d4ca --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AdvancedNetworkingSecurityTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.AdvancedNetworkPolicies; +import com.azure.resourcemanager.containerservice.generated.models.AdvancedNetworkingSecurity; +import com.azure.resourcemanager.containerservice.generated.models.AdvancedNetworkingSecurityTransitEncryption; +import com.azure.resourcemanager.containerservice.generated.models.TransitEncryptionType; +import org.junit.jupiter.api.Assertions; + +public final class AdvancedNetworkingSecurityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AdvancedNetworkingSecurity model = BinaryData + .fromString( + "{\"enabled\":true,\"advancedNetworkPolicies\":\"None\",\"transitEncryption\":{\"type\":\"None\"}}") + .toObject(AdvancedNetworkingSecurity.class); + Assertions.assertTrue(model.enabled()); + Assertions.assertEquals(AdvancedNetworkPolicies.NONE, model.advancedNetworkPolicies()); + Assertions.assertEquals(TransitEncryptionType.NONE, model.transitEncryption().type()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AdvancedNetworkingSecurity model = new AdvancedNetworkingSecurity().withEnabled(true) + .withAdvancedNetworkPolicies(AdvancedNetworkPolicies.NONE) + .withTransitEncryption( + new AdvancedNetworkingSecurityTransitEncryption().withType(TransitEncryptionType.NONE)); + model = BinaryData.fromObject(model).toObject(AdvancedNetworkingSecurity.class); + Assertions.assertTrue(model.enabled()); + Assertions.assertEquals(AdvancedNetworkPolicies.NONE, model.advancedNetworkPolicies()); + Assertions.assertEquals(TransitEncryptionType.NONE, model.transitEncryption().type()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AdvancedNetworkingSecurityTransitEncryptionTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AdvancedNetworkingSecurityTransitEncryptionTests.java new file mode 100644 index 000000000000..dc636920dec2 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AdvancedNetworkingSecurityTransitEncryptionTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.AdvancedNetworkingSecurityTransitEncryption; +import com.azure.resourcemanager.containerservice.generated.models.TransitEncryptionType; +import org.junit.jupiter.api.Assertions; + +public final class AdvancedNetworkingSecurityTransitEncryptionTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AdvancedNetworkingSecurityTransitEncryption model = BinaryData.fromString("{\"type\":\"WireGuard\"}") + .toObject(AdvancedNetworkingSecurityTransitEncryption.class); + Assertions.assertEquals(TransitEncryptionType.WIRE_GUARD, model.type()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AdvancedNetworkingSecurityTransitEncryption model + = new AdvancedNetworkingSecurityTransitEncryption().withType(TransitEncryptionType.WIRE_GUARD); + model = BinaryData.fromObject(model).toObject(AdvancedNetworkingSecurityTransitEncryption.class); + Assertions.assertEquals(TransitEncryptionType.WIRE_GUARD, model.type()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AdvancedNetworkingTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AdvancedNetworkingTests.java new file mode 100644 index 000000000000..36645fe8fd24 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AdvancedNetworkingTests.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.AccelerationMode; +import com.azure.resourcemanager.containerservice.generated.models.AdvancedNetworkPolicies; +import com.azure.resourcemanager.containerservice.generated.models.AdvancedNetworking; +import com.azure.resourcemanager.containerservice.generated.models.AdvancedNetworkingObservability; +import com.azure.resourcemanager.containerservice.generated.models.AdvancedNetworkingPerformance; +import com.azure.resourcemanager.containerservice.generated.models.AdvancedNetworkingSecurity; +import com.azure.resourcemanager.containerservice.generated.models.AdvancedNetworkingSecurityTransitEncryption; +import com.azure.resourcemanager.containerservice.generated.models.TransitEncryptionType; +import org.junit.jupiter.api.Assertions; + +public final class AdvancedNetworkingTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AdvancedNetworking model = BinaryData.fromString( + "{\"enabled\":false,\"observability\":{\"enabled\":true},\"security\":{\"enabled\":false,\"advancedNetworkPolicies\":\"L7\",\"transitEncryption\":{\"type\":\"WireGuard\"}},\"performance\":{\"accelerationMode\":\"None\"}}") + .toObject(AdvancedNetworking.class); + Assertions.assertFalse(model.enabled()); + Assertions.assertTrue(model.observability().enabled()); + Assertions.assertFalse(model.security().enabled()); + Assertions.assertEquals(AdvancedNetworkPolicies.L7, model.security().advancedNetworkPolicies()); + Assertions.assertEquals(TransitEncryptionType.WIRE_GUARD, model.security().transitEncryption().type()); + Assertions.assertEquals(AccelerationMode.NONE, model.performance().accelerationMode()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AdvancedNetworking model = new AdvancedNetworking().withEnabled(false) + .withObservability(new AdvancedNetworkingObservability().withEnabled(true)) + .withSecurity(new AdvancedNetworkingSecurity().withEnabled(false) + .withAdvancedNetworkPolicies(AdvancedNetworkPolicies.L7) + .withTransitEncryption( + new AdvancedNetworkingSecurityTransitEncryption().withType(TransitEncryptionType.WIRE_GUARD))) + .withPerformance(new AdvancedNetworkingPerformance().withAccelerationMode(AccelerationMode.NONE)); + model = BinaryData.fromObject(model).toObject(AdvancedNetworking.class); + Assertions.assertFalse(model.enabled()); + Assertions.assertTrue(model.observability().enabled()); + Assertions.assertFalse(model.security().enabled()); + Assertions.assertEquals(AdvancedNetworkPolicies.L7, model.security().advancedNetworkPolicies()); + Assertions.assertEquals(TransitEncryptionType.WIRE_GUARD, model.security().transitEncryption().type()); + Assertions.assertEquals(AccelerationMode.NONE, model.performance().accelerationMode()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolAvailableVersionsInnerTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolAvailableVersionsInnerTests.java new file mode 100644 index 000000000000..49b5f5953dd7 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolAvailableVersionsInnerTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.fluent.models.AgentPoolAvailableVersionsInner; +import org.junit.jupiter.api.Assertions; + +public final class AgentPoolAvailableVersionsInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AgentPoolAvailableVersionsInner model = BinaryData.fromString( + "{\"id\":\"tumkdosvqwhbm\",\"name\":\"bbjfddgmbmbexp\",\"type\":\"htqqrolfp\",\"properties\":{\"agentPoolVersions\":[{\"default\":false,\"kubernetesVersion\":\"bquxigjy\",\"isPreview\":true}]}}") + .toObject(AgentPoolAvailableVersionsInner.class); + Assertions.assertFalse(model.agentPoolVersions().get(0).defaultProperty()); + Assertions.assertEquals("bquxigjy", model.agentPoolVersions().get(0).kubernetesVersion()); + Assertions.assertTrue(model.agentPoolVersions().get(0).isPreview()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItemTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItemTests.java new file mode 100644 index 000000000000..df6118146de3 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItemTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem; +import org.junit.jupiter.api.Assertions; + +public final class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItemTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem model + = BinaryData.fromString("{\"default\":false,\"kubernetesVersion\":\"qguhmuo\",\"isPreview\":false}") + .toObject(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem.class); + Assertions.assertFalse(model.defaultProperty()); + Assertions.assertEquals("qguhmuo", model.kubernetesVersion()); + Assertions.assertFalse(model.isPreview()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolAvailableVersionsPropertiesTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolAvailableVersionsPropertiesTests.java new file mode 100644 index 000000000000..5e1f061288c9 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolAvailableVersionsPropertiesTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.fluent.models.AgentPoolAvailableVersionsProperties; +import org.junit.jupiter.api.Assertions; + +public final class AgentPoolAvailableVersionsPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AgentPoolAvailableVersionsProperties model = BinaryData.fromString( + "{\"agentPoolVersions\":[{\"default\":true,\"kubernetesVersion\":\"hr\",\"isPreview\":true},{\"default\":false,\"kubernetesVersion\":\"rkujy\",\"isPreview\":false},{\"default\":false,\"kubernetesVersion\":\"vfqawrlyxwjkcpr\",\"isPreview\":false},{\"default\":false,\"kubernetesVersion\":\"jvtbvpyss\",\"isPreview\":false}]}") + .toObject(AgentPoolAvailableVersionsProperties.class); + Assertions.assertTrue(model.agentPoolVersions().get(0).defaultProperty()); + Assertions.assertEquals("hr", model.agentPoolVersions().get(0).kubernetesVersion()); + Assertions.assertTrue(model.agentPoolVersions().get(0).isPreview()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolDeleteMachinesParameterTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolDeleteMachinesParameterTests.java new file mode 100644 index 000000000000..675037283a3d --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolDeleteMachinesParameterTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolDeleteMachinesParameter; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class AgentPoolDeleteMachinesParameterTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AgentPoolDeleteMachinesParameter model + = BinaryData.fromString("{\"machineNames\":[\"mmnkzsmodmgl\",\"ugpbkw\",\"mutduqktaps\",\"wgcu\"]}") + .toObject(AgentPoolDeleteMachinesParameter.class); + Assertions.assertEquals("mmnkzsmodmgl", model.machineNames().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AgentPoolDeleteMachinesParameter model = new AgentPoolDeleteMachinesParameter() + .withMachineNames(Arrays.asList("mmnkzsmodmgl", "ugpbkw", "mutduqktaps", "wgcu")); + model = BinaryData.fromObject(model).toObject(AgentPoolDeleteMachinesParameter.class); + Assertions.assertEquals("mmnkzsmodmgl", model.machineNames().get(0)); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolGatewayProfileTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolGatewayProfileTests.java new file mode 100644 index 000000000000..0e1bb46e871b --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolGatewayProfileTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolGatewayProfile; +import org.junit.jupiter.api.Assertions; + +public final class AgentPoolGatewayProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AgentPoolGatewayProfile model + = BinaryData.fromString("{\"publicIPPrefixSize\":1439394091}").toObject(AgentPoolGatewayProfile.class); + Assertions.assertEquals(1439394091, model.publicIPPrefixSize()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AgentPoolGatewayProfile model = new AgentPoolGatewayProfile().withPublicIPPrefixSize(1439394091); + model = BinaryData.fromObject(model).toObject(AgentPoolGatewayProfile.class); + Assertions.assertEquals(1439394091, model.publicIPPrefixSize()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolNetworkProfileTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolNetworkProfileTests.java new file mode 100644 index 000000000000..eedaa326591c --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolNetworkProfileTests.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolNetworkProfile; +import com.azure.resourcemanager.containerservice.generated.models.IPTag; +import com.azure.resourcemanager.containerservice.generated.models.PortRange; +import com.azure.resourcemanager.containerservice.generated.models.Protocol; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class AgentPoolNetworkProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AgentPoolNetworkProfile model = BinaryData.fromString( + "{\"nodePublicIPTags\":[{\"ipTagType\":\"rwfndiod\",\"tag\":\"slwejdpvw\"},{\"ipTagType\":\"oqpsoa\",\"tag\":\"tazak\"}],\"allowedHostPorts\":[{\"portStart\":1628568580,\"portEnd\":276706615,\"protocol\":\"TCP\"},{\"portStart\":1060950423,\"portEnd\":1389039399,\"protocol\":\"TCP\"},{\"portStart\":1461689436,\"portEnd\":962942512,\"protocol\":\"UDP\"}],\"applicationSecurityGroups\":[\"jakhmsbzjh\",\"rzevdphlxaol\",\"hqtrgqjbpf\",\"fsinzgvfcjrwzoxx\"]}") + .toObject(AgentPoolNetworkProfile.class); + Assertions.assertEquals("rwfndiod", model.nodePublicIPTags().get(0).ipTagType()); + Assertions.assertEquals("slwejdpvw", model.nodePublicIPTags().get(0).tag()); + Assertions.assertEquals(1628568580, model.allowedHostPorts().get(0).portStart()); + Assertions.assertEquals(276706615, model.allowedHostPorts().get(0).portEnd()); + Assertions.assertEquals(Protocol.TCP, model.allowedHostPorts().get(0).protocol()); + Assertions.assertEquals("jakhmsbzjh", model.applicationSecurityGroups().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AgentPoolNetworkProfile model = new AgentPoolNetworkProfile() + .withNodePublicIPTags(Arrays.asList(new IPTag().withIpTagType("rwfndiod").withTag("slwejdpvw"), + new IPTag().withIpTagType("oqpsoa").withTag("tazak"))) + .withAllowedHostPorts(Arrays.asList( + new PortRange().withPortStart(1628568580).withPortEnd(276706615).withProtocol(Protocol.TCP), + new PortRange().withPortStart(1060950423).withPortEnd(1389039399).withProtocol(Protocol.TCP), + new PortRange().withPortStart(1461689436).withPortEnd(962942512).withProtocol(Protocol.UDP))) + .withApplicationSecurityGroups( + Arrays.asList("jakhmsbzjh", "rzevdphlxaol", "hqtrgqjbpf", "fsinzgvfcjrwzoxx")); + model = BinaryData.fromObject(model).toObject(AgentPoolNetworkProfile.class); + Assertions.assertEquals("rwfndiod", model.nodePublicIPTags().get(0).ipTagType()); + Assertions.assertEquals("slwejdpvw", model.nodePublicIPTags().get(0).tag()); + Assertions.assertEquals(1628568580, model.allowedHostPorts().get(0).portStart()); + Assertions.assertEquals(276706615, model.allowedHostPorts().get(0).portEnd()); + Assertions.assertEquals(Protocol.TCP, model.allowedHostPorts().get(0).protocol()); + Assertions.assertEquals("jakhmsbzjh", model.applicationSecurityGroups().get(0)); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolSecurityProfileTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolSecurityProfileTests.java new file mode 100644 index 000000000000..28597589fe1c --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolSecurityProfileTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolSSHAccess; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolSecurityProfile; +import org.junit.jupiter.api.Assertions; + +public final class AgentPoolSecurityProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AgentPoolSecurityProfile model + = BinaryData.fromString("{\"enableVTPM\":true,\"enableSecureBoot\":false,\"sshAccess\":\"LocalUser\"}") + .toObject(AgentPoolSecurityProfile.class); + Assertions.assertTrue(model.enableVTPM()); + Assertions.assertFalse(model.enableSecureBoot()); + Assertions.assertEquals(AgentPoolSSHAccess.LOCAL_USER, model.sshAccess()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AgentPoolSecurityProfile model = new AgentPoolSecurityProfile().withEnableVTPM(true) + .withEnableSecureBoot(false) + .withSshAccess(AgentPoolSSHAccess.LOCAL_USER); + model = BinaryData.fromObject(model).toObject(AgentPoolSecurityProfile.class); + Assertions.assertTrue(model.enableVTPM()); + Assertions.assertFalse(model.enableSecureBoot()); + Assertions.assertEquals(AgentPoolSSHAccess.LOCAL_USER, model.sshAccess()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolUpgradeProfileInnerTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolUpgradeProfileInnerTests.java new file mode 100644 index 000000000000..12b62bd91365 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolUpgradeProfileInnerTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.fluent.models.AgentPoolUpgradeProfileInner; +import com.azure.resourcemanager.containerservice.generated.models.OSType; +import org.junit.jupiter.api.Assertions; + +public final class AgentPoolUpgradeProfileInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AgentPoolUpgradeProfileInner model = BinaryData.fromString( + "{\"properties\":{\"kubernetesVersion\":\"prwzwbnguitnwui\",\"osType\":\"Linux\",\"upgrades\":[{\"kubernetesVersion\":\"ufizuckyf\",\"isPreview\":true},{\"kubernetesVersion\":\"idf\",\"isPreview\":true}],\"latestNodeImageVersion\":\"zuhtymwisdkfthwx\"},\"id\":\"t\",\"name\":\"i\",\"type\":\"aop\"}") + .toObject(AgentPoolUpgradeProfileInner.class); + Assertions.assertEquals("prwzwbnguitnwui", model.kubernetesVersion()); + Assertions.assertEquals(OSType.LINUX, model.osType()); + Assertions.assertEquals("ufizuckyf", model.upgrades().get(0).kubernetesVersion()); + Assertions.assertTrue(model.upgrades().get(0).isPreview()); + Assertions.assertEquals("zuhtymwisdkfthwx", model.latestNodeImageVersion()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolUpgradeProfilePropertiesTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolUpgradeProfilePropertiesTests.java new file mode 100644 index 000000000000..408909488045 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolUpgradeProfilePropertiesTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.fluent.models.AgentPoolUpgradeProfileProperties; +import com.azure.resourcemanager.containerservice.generated.models.OSType; +import org.junit.jupiter.api.Assertions; + +public final class AgentPoolUpgradeProfilePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AgentPoolUpgradeProfileProperties model = BinaryData.fromString( + "{\"kubernetesVersion\":\"km\",\"osType\":\"Windows\",\"upgrades\":[{\"kubernetesVersion\":\"xdcu\",\"isPreview\":true},{\"kubernetesVersion\":\"rpymzidnsez\",\"isPreview\":true}],\"latestNodeImageVersion\":\"zsgfyccsnewmd\"}") + .toObject(AgentPoolUpgradeProfileProperties.class); + Assertions.assertEquals("km", model.kubernetesVersion()); + Assertions.assertEquals(OSType.WINDOWS, model.osType()); + Assertions.assertEquals("xdcu", model.upgrades().get(0).kubernetesVersion()); + Assertions.assertTrue(model.upgrades().get(0).isPreview()); + Assertions.assertEquals("zsgfyccsnewmd", model.latestNodeImageVersion()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolUpgradeProfilePropertiesUpgradesItemTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolUpgradeProfilePropertiesUpgradesItemTests.java new file mode 100644 index 000000000000..f6370708cad2 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolUpgradeProfilePropertiesUpgradesItemTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolUpgradeProfilePropertiesUpgradesItem; +import org.junit.jupiter.api.Assertions; + +public final class AgentPoolUpgradeProfilePropertiesUpgradesItemTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AgentPoolUpgradeProfilePropertiesUpgradesItem model + = BinaryData.fromString("{\"kubernetesVersion\":\"jeiachboosfl\",\"isPreview\":true}") + .toObject(AgentPoolUpgradeProfilePropertiesUpgradesItem.class); + Assertions.assertEquals("jeiachboosfl", model.kubernetesVersion()); + Assertions.assertTrue(model.isPreview()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolUpgradeSettingsTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolUpgradeSettingsTests.java new file mode 100644 index 000000000000..69d68e0ca4d5 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolUpgradeSettingsTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolUpgradeSettings; +import com.azure.resourcemanager.containerservice.generated.models.UndrainableNodeBehavior; +import org.junit.jupiter.api.Assertions; + +public final class AgentPoolUpgradeSettingsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AgentPoolUpgradeSettings model = BinaryData.fromString( + "{\"maxSurge\":\"hmwhfpmrqo\",\"maxUnavailable\":\"tu\",\"drainTimeoutInMinutes\":1941399376,\"nodeSoakDurationInMinutes\":1306784267,\"undrainableNodeBehavior\":\"Cordon\"}") + .toObject(AgentPoolUpgradeSettings.class); + Assertions.assertEquals("hmwhfpmrqo", model.maxSurge()); + Assertions.assertEquals("tu", model.maxUnavailable()); + Assertions.assertEquals(1941399376, model.drainTimeoutInMinutes()); + Assertions.assertEquals(1306784267, model.nodeSoakDurationInMinutes()); + Assertions.assertEquals(UndrainableNodeBehavior.CORDON, model.undrainableNodeBehavior()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AgentPoolUpgradeSettings model = new AgentPoolUpgradeSettings().withMaxSurge("hmwhfpmrqo") + .withMaxUnavailable("tu") + .withDrainTimeoutInMinutes(1941399376) + .withNodeSoakDurationInMinutes(1306784267) + .withUndrainableNodeBehavior(UndrainableNodeBehavior.CORDON); + model = BinaryData.fromObject(model).toObject(AgentPoolUpgradeSettings.class); + Assertions.assertEquals("hmwhfpmrqo", model.maxSurge()); + Assertions.assertEquals("tu", model.maxUnavailable()); + Assertions.assertEquals(1941399376, model.drainTimeoutInMinutes()); + Assertions.assertEquals(1306784267, model.nodeSoakDurationInMinutes()); + Assertions.assertEquals(UndrainableNodeBehavior.CORDON, model.undrainableNodeBehavior()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolWindowsProfileTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolWindowsProfileTests.java new file mode 100644 index 000000000000..1a47989f2149 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolWindowsProfileTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolWindowsProfile; +import org.junit.jupiter.api.Assertions; + +public final class AgentPoolWindowsProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AgentPoolWindowsProfile model + = BinaryData.fromString("{\"disableOutboundNat\":true}").toObject(AgentPoolWindowsProfile.class); + Assertions.assertTrue(model.disableOutboundNat()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AgentPoolWindowsProfile model = new AgentPoolWindowsProfile().withDisableOutboundNat(true); + model = BinaryData.fromObject(model).toObject(AgentPoolWindowsProfile.class); + Assertions.assertTrue(model.disableOutboundNat()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsGetAvailableAgentPoolVersionsWithResponseMockTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsGetAvailableAgentPoolVersionsWithResponseMockTests.java new file mode 100644 index 000000000000..96b55f5366ca --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsGetAvailableAgentPoolVersionsWithResponseMockTests.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.containerservice.generated.ContainerServiceManager; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolAvailableVersions; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class AgentPoolsGetAvailableAgentPoolVersionsWithResponseMockTests { + @Test + public void testGetAvailableAgentPoolVersionsWithResponse() throws Exception { + String responseStr + = "{\"id\":\"eljeamurvzmlovua\",\"name\":\"shcxlpmjerbdk\",\"type\":\"vidizozsdb\",\"properties\":{\"agentPoolVersions\":[{\"default\":true,\"kubernetesVersion\":\"nfdgn\",\"isPreview\":true},{\"default\":false,\"kubernetesVersion\":\"uwwltvuqjctz\",\"isPreview\":true}]}}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ContainerServiceManager manager = ContainerServiceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + AgentPoolAvailableVersions response = manager.agentPools() + .getAvailableAgentPoolVersionsWithResponse("zehtdhgb", "k", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertTrue(response.agentPoolVersions().get(0).defaultProperty()); + Assertions.assertEquals("nfdgn", response.agentPoolVersions().get(0).kubernetesVersion()); + Assertions.assertTrue(response.agentPoolVersions().get(0).isPreview()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsGetUpgradeProfileWithResponseMockTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsGetUpgradeProfileWithResponseMockTests.java new file mode 100644 index 000000000000..ed35c657b508 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsGetUpgradeProfileWithResponseMockTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.containerservice.generated.ContainerServiceManager; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolUpgradeProfile; +import com.azure.resourcemanager.containerservice.generated.models.OSType; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class AgentPoolsGetUpgradeProfileWithResponseMockTests { + @Test + public void testGetUpgradeProfileWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"kubernetesVersion\":\"xcudchxgsr\",\"osType\":\"Windows\",\"upgrades\":[{\"kubernetesVersion\":\"or\",\"isPreview\":true}],\"latestNodeImageVersion\":\"lvizb\"},\"id\":\"fovvacqpbtuodxes\",\"name\":\"abbelawumuaslzk\",\"type\":\"rrwoycqucwyhahn\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ContainerServiceManager manager = ContainerServiceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + AgentPoolUpgradeProfile response = manager.agentPools() + .getUpgradeProfileWithResponse("eifzzhmk", "as", "flyh", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("xcudchxgsr", response.kubernetesVersion()); + Assertions.assertEquals(OSType.WINDOWS, response.osType()); + Assertions.assertEquals("or", response.upgrades().get(0).kubernetesVersion()); + Assertions.assertTrue(response.upgrades().get(0).isPreview()); + Assertions.assertEquals("lvizb", response.latestNodeImageVersion()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsUpgradeNodeImageVersionMockTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsUpgradeNodeImageVersionMockTests.java new file mode 100644 index 000000000000..eb2afa10326c --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsUpgradeNodeImageVersionMockTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.containerservice.generated.ContainerServiceManager; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class AgentPoolsUpgradeNodeImageVersionMockTests { + @Test + public void testUpgradeNodeImageVersion() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ContainerServiceManager manager = ContainerServiceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.agentPools() + .upgradeNodeImageVersion("gnl", "zonzlrpiqywnc", "jtszcof", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ClusterUpgradeSettingsTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ClusterUpgradeSettingsTests.java new file mode 100644 index 000000000000..d1aa4b55a714 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ClusterUpgradeSettingsTests.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ClusterUpgradeSettings; +import com.azure.resourcemanager.containerservice.generated.models.UpgradeOverrideSettings; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class ClusterUpgradeSettingsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ClusterUpgradeSettings model + = BinaryData.fromString("{\"overrideSettings\":{\"forceUpgrade\":true,\"until\":\"2021-09-16T17:03:50Z\"}}") + .toObject(ClusterUpgradeSettings.class); + Assertions.assertTrue(model.overrideSettings().forceUpgrade()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-16T17:03:50Z"), model.overrideSettings().until()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ClusterUpgradeSettings model + = new ClusterUpgradeSettings().withOverrideSettings(new UpgradeOverrideSettings().withForceUpgrade(true) + .withUntil(OffsetDateTime.parse("2021-09-16T17:03:50Z"))); + model = BinaryData.fromObject(model).toObject(ClusterUpgradeSettings.class); + Assertions.assertTrue(model.overrideSettings().forceUpgrade()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-16T17:03:50Z"), model.overrideSettings().until()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/CompatibleVersionsTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/CompatibleVersionsTests.java new file mode 100644 index 000000000000..70a05a7219e5 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/CompatibleVersionsTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.CompatibleVersions; +import org.junit.jupiter.api.Assertions; + +public final class CompatibleVersionsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CompatibleVersions model + = BinaryData.fromString("{\"name\":\"atklddxbjhwuaa\",\"versions\":[\"jos\",\"hyoulpjr\"]}") + .toObject(CompatibleVersions.class); + Assertions.assertEquals("atklddxbjhwuaa", model.name()); + Assertions.assertEquals("jos", model.versions().get(0)); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ContainerServiceNetworkProfileTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ContainerServiceNetworkProfileTests.java new file mode 100644 index 000000000000..f237967df65d --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ContainerServiceNetworkProfileTests.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.AccelerationMode; +import com.azure.resourcemanager.containerservice.generated.models.AdvancedNetworkPolicies; +import com.azure.resourcemanager.containerservice.generated.models.AdvancedNetworking; +import com.azure.resourcemanager.containerservice.generated.models.AdvancedNetworkingObservability; +import com.azure.resourcemanager.containerservice.generated.models.AdvancedNetworkingPerformance; +import com.azure.resourcemanager.containerservice.generated.models.AdvancedNetworkingSecurity; +import com.azure.resourcemanager.containerservice.generated.models.AdvancedNetworkingSecurityTransitEncryption; +import com.azure.resourcemanager.containerservice.generated.models.BackendPoolType; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServiceNetworkProfile; +import com.azure.resourcemanager.containerservice.generated.models.IPFamily; +import com.azure.resourcemanager.containerservice.generated.models.LoadBalancerSku; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterLoadBalancerProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterLoadBalancerProfileOutboundIPs; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterManagedOutboundIPProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterNATGatewayProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterStaticEgressGatewayProfile; +import com.azure.resourcemanager.containerservice.generated.models.NetworkDataplane; +import com.azure.resourcemanager.containerservice.generated.models.NetworkMode; +import com.azure.resourcemanager.containerservice.generated.models.NetworkPlugin; +import com.azure.resourcemanager.containerservice.generated.models.NetworkPluginMode; +import com.azure.resourcemanager.containerservice.generated.models.NetworkPolicy; +import com.azure.resourcemanager.containerservice.generated.models.OutboundType; +import com.azure.resourcemanager.containerservice.generated.models.ResourceReference; +import com.azure.resourcemanager.containerservice.generated.models.TransitEncryptionType; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ContainerServiceNetworkProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ContainerServiceNetworkProfile model = BinaryData.fromString( + "{\"networkPlugin\":\"none\",\"networkPluginMode\":\"overlay\",\"networkPolicy\":\"azure\",\"networkMode\":\"bridge\",\"networkDataplane\":\"cilium\",\"advancedNetworking\":{\"enabled\":true,\"observability\":{\"enabled\":false},\"security\":{\"enabled\":true,\"advancedNetworkPolicies\":\"FQDN\",\"transitEncryption\":{\"type\":\"WireGuard\"}},\"performance\":{\"accelerationMode\":\"BpfVeth\"}},\"podCidr\":\"e\",\"serviceCidr\":\"alhbx\",\"dnsServiceIP\":\"e\",\"outboundType\":\"none\",\"loadBalancerSku\":\"standard\",\"loadBalancerProfile\":{\"managedOutboundIPs\":{\"count\":572482803,\"countIPv6\":621270176},\"outboundIPPrefixes\":{\"publicIPPrefixes\":[{\"id\":\"otwmcyn\"},{\"id\":\"lbjnpgacftadehx\"}]},\"outboundIPs\":{\"publicIPs\":[{\"id\":\"sop\"},{\"id\":\"suesnzw\"}]},\"effectiveOutboundIPs\":[{\"id\":\"avo\"},{\"id\":\"zdmohctbqvu\"},{\"id\":\"xdn\"}],\"allocatedOutboundPorts\":378897714,\"idleTimeoutInMinutes\":202688177,\"enableMultipleStandardLoadBalancers\":true,\"backendPoolType\":\"NodeIP\"},\"natGatewayProfile\":{\"managedOutboundIPProfile\":{\"count\":1929800645},\"effectiveOutboundIPs\":[{\"id\":\"lhslazjdyggdtj\"},{\"id\":\"hbkuofqwey\"},{\"id\":\"menevfyexfwh\"},{\"id\":\"cibvyvdcsitynn\"}],\"idleTimeoutInMinutes\":1611277697},\"staticEgressGatewayProfile\":{\"enabled\":true},\"podCidrs\":[\"hfiqscjeypvhe\"],\"serviceCidrs\":[\"gqhcjrefovg\",\"kqsleyyvxy\",\"jpkcattpng\"],\"ipFamilies\":[\"IPv4\",\"IPv6\",\"IPv6\"]}") + .toObject(ContainerServiceNetworkProfile.class); + Assertions.assertEquals(NetworkPlugin.NONE, model.networkPlugin()); + Assertions.assertEquals(NetworkPluginMode.OVERLAY, model.networkPluginMode()); + Assertions.assertEquals(NetworkPolicy.AZURE, model.networkPolicy()); + Assertions.assertEquals(NetworkMode.BRIDGE, model.networkMode()); + Assertions.assertEquals(NetworkDataplane.CILIUM, model.networkDataplane()); + Assertions.assertTrue(model.advancedNetworking().enabled()); + Assertions.assertFalse(model.advancedNetworking().observability().enabled()); + Assertions.assertTrue(model.advancedNetworking().security().enabled()); + Assertions.assertEquals(AdvancedNetworkPolicies.FQDN, + model.advancedNetworking().security().advancedNetworkPolicies()); + Assertions.assertEquals(TransitEncryptionType.WIRE_GUARD, + model.advancedNetworking().security().transitEncryption().type()); + Assertions.assertEquals(AccelerationMode.BPF_VETH, model.advancedNetworking().performance().accelerationMode()); + Assertions.assertEquals("e", model.podCidr()); + Assertions.assertEquals("alhbx", model.serviceCidr()); + Assertions.assertEquals("e", model.dnsServiceIP()); + Assertions.assertEquals(OutboundType.NONE, model.outboundType()); + Assertions.assertEquals(LoadBalancerSku.STANDARD, model.loadBalancerSku()); + Assertions.assertEquals(572482803, model.loadBalancerProfile().managedOutboundIPs().count()); + Assertions.assertEquals(621270176, model.loadBalancerProfile().managedOutboundIPs().countIPv6()); + Assertions.assertEquals("otwmcyn", + model.loadBalancerProfile().outboundIPPrefixes().publicIPPrefixes().get(0).id()); + Assertions.assertEquals("sop", model.loadBalancerProfile().outboundIPs().publicIPs().get(0).id()); + Assertions.assertEquals(378897714, model.loadBalancerProfile().allocatedOutboundPorts()); + Assertions.assertEquals(202688177, model.loadBalancerProfile().idleTimeoutInMinutes()); + Assertions.assertTrue(model.loadBalancerProfile().enableMultipleStandardLoadBalancers()); + Assertions.assertEquals(BackendPoolType.NODE_IP, model.loadBalancerProfile().backendPoolType()); + Assertions.assertEquals(1929800645, model.natGatewayProfile().managedOutboundIPProfile().count()); + Assertions.assertEquals(1611277697, model.natGatewayProfile().idleTimeoutInMinutes()); + Assertions.assertTrue(model.staticEgressGatewayProfile().enabled()); + Assertions.assertEquals("hfiqscjeypvhe", model.podCidrs().get(0)); + Assertions.assertEquals("gqhcjrefovg", model.serviceCidrs().get(0)); + Assertions.assertEquals(IPFamily.IPV4, model.ipFamilies().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ContainerServiceNetworkProfile model + = new ContainerServiceNetworkProfile().withNetworkPlugin(NetworkPlugin.NONE) + .withNetworkPluginMode(NetworkPluginMode.OVERLAY) + .withNetworkPolicy(NetworkPolicy.AZURE) + .withNetworkMode(NetworkMode.BRIDGE) + .withNetworkDataplane(NetworkDataplane.CILIUM) + .withAdvancedNetworking(new AdvancedNetworking() + .withEnabled(true) + .withObservability(new AdvancedNetworkingObservability().withEnabled(false)) + .withSecurity(new AdvancedNetworkingSecurity().withEnabled(true) + .withAdvancedNetworkPolicies(AdvancedNetworkPolicies.FQDN) + .withTransitEncryption(new AdvancedNetworkingSecurityTransitEncryption() + .withType(TransitEncryptionType.WIRE_GUARD))) + .withPerformance( + new AdvancedNetworkingPerformance().withAccelerationMode(AccelerationMode.BPF_VETH))) + .withPodCidr("e") + .withServiceCidr("alhbx") + .withDnsServiceIP("e") + .withOutboundType(OutboundType.NONE) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs( + new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(572482803) + .withCountIPv6(621270176)) + .withOutboundIPPrefixes( + new ManagedClusterLoadBalancerProfileOutboundIPPrefixes().withPublicIPPrefixes( + Arrays.asList(new ResourceReference().withId("otwmcyn"), + new ResourceReference().withId("lbjnpgacftadehx")))) + .withOutboundIPs(new ManagedClusterLoadBalancerProfileOutboundIPs().withPublicIPs(Arrays + .asList(new ResourceReference().withId("sop"), new ResourceReference().withId("suesnzw")))) + .withAllocatedOutboundPorts(378897714) + .withIdleTimeoutInMinutes(202688177) + .withEnableMultipleStandardLoadBalancers(true) + .withBackendPoolType(BackendPoolType.NODE_IP)) + .withNatGatewayProfile(new ManagedClusterNATGatewayProfile() + .withManagedOutboundIPProfile(new ManagedClusterManagedOutboundIPProfile().withCount(1929800645)) + .withIdleTimeoutInMinutes(1611277697)) + .withStaticEgressGatewayProfile(new ManagedClusterStaticEgressGatewayProfile().withEnabled(true)) + .withPodCidrs(Arrays.asList("hfiqscjeypvhe")) + .withServiceCidrs(Arrays.asList("gqhcjrefovg", "kqsleyyvxy", "jpkcattpng")) + .withIpFamilies(Arrays.asList(IPFamily.IPV4, IPFamily.IPV6, IPFamily.IPV6)); + model = BinaryData.fromObject(model).toObject(ContainerServiceNetworkProfile.class); + Assertions.assertEquals(NetworkPlugin.NONE, model.networkPlugin()); + Assertions.assertEquals(NetworkPluginMode.OVERLAY, model.networkPluginMode()); + Assertions.assertEquals(NetworkPolicy.AZURE, model.networkPolicy()); + Assertions.assertEquals(NetworkMode.BRIDGE, model.networkMode()); + Assertions.assertEquals(NetworkDataplane.CILIUM, model.networkDataplane()); + Assertions.assertTrue(model.advancedNetworking().enabled()); + Assertions.assertFalse(model.advancedNetworking().observability().enabled()); + Assertions.assertTrue(model.advancedNetworking().security().enabled()); + Assertions.assertEquals(AdvancedNetworkPolicies.FQDN, + model.advancedNetworking().security().advancedNetworkPolicies()); + Assertions.assertEquals(TransitEncryptionType.WIRE_GUARD, + model.advancedNetworking().security().transitEncryption().type()); + Assertions.assertEquals(AccelerationMode.BPF_VETH, model.advancedNetworking().performance().accelerationMode()); + Assertions.assertEquals("e", model.podCidr()); + Assertions.assertEquals("alhbx", model.serviceCidr()); + Assertions.assertEquals("e", model.dnsServiceIP()); + Assertions.assertEquals(OutboundType.NONE, model.outboundType()); + Assertions.assertEquals(LoadBalancerSku.STANDARD, model.loadBalancerSku()); + Assertions.assertEquals(572482803, model.loadBalancerProfile().managedOutboundIPs().count()); + Assertions.assertEquals(621270176, model.loadBalancerProfile().managedOutboundIPs().countIPv6()); + Assertions.assertEquals("otwmcyn", + model.loadBalancerProfile().outboundIPPrefixes().publicIPPrefixes().get(0).id()); + Assertions.assertEquals("sop", model.loadBalancerProfile().outboundIPs().publicIPs().get(0).id()); + Assertions.assertEquals(378897714, model.loadBalancerProfile().allocatedOutboundPorts()); + Assertions.assertEquals(202688177, model.loadBalancerProfile().idleTimeoutInMinutes()); + Assertions.assertTrue(model.loadBalancerProfile().enableMultipleStandardLoadBalancers()); + Assertions.assertEquals(BackendPoolType.NODE_IP, model.loadBalancerProfile().backendPoolType()); + Assertions.assertEquals(1929800645, model.natGatewayProfile().managedOutboundIPProfile().count()); + Assertions.assertEquals(1611277697, model.natGatewayProfile().idleTimeoutInMinutes()); + Assertions.assertTrue(model.staticEgressGatewayProfile().enabled()); + Assertions.assertEquals("hfiqscjeypvhe", model.podCidrs().get(0)); + Assertions.assertEquals("gqhcjrefovg", model.serviceCidrs().get(0)); + Assertions.assertEquals(IPFamily.IPV4, model.ipFamilies().get(0)); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/CreationDataTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/CreationDataTests.java new file mode 100644 index 000000000000..150415397373 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/CreationDataTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.CreationData; +import org.junit.jupiter.api.Assertions; + +public final class CreationDataTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CreationData model + = BinaryData.fromString("{\"sourceResourceId\":\"dvpjhulsuuvmk\"}").toObject(CreationData.class); + Assertions.assertEquals("dvpjhulsuuvmk", model.sourceResourceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CreationData model = new CreationData().withSourceResourceId("dvpjhulsuuvmk"); + model = BinaryData.fromObject(model).toObject(CreationData.class); + Assertions.assertEquals("dvpjhulsuuvmk", model.sourceResourceId()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/CredentialResultTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/CredentialResultTests.java new file mode 100644 index 000000000000..0e466d72a49e --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/CredentialResultTests.java @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.CredentialResult; + +public final class CredentialResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CredentialResult model + = BinaryData.fromString("{\"name\":\"jyofdxluusdtto\"}").toObject(CredentialResult.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/CredentialResultsInnerTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/CredentialResultsInnerTests.java new file mode 100644 index 000000000000..917c9367a472 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/CredentialResultsInnerTests.java @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.fluent.models.CredentialResultsInner; + +public final class CredentialResultsInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CredentialResultsInner model = BinaryData.fromString("{\"kubeconfigs\":[{\"name\":\"wozuhkf\"}]}") + .toObject(CredentialResultsInner.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/DailyScheduleTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/DailyScheduleTests.java new file mode 100644 index 000000000000..a5347503bcb1 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/DailyScheduleTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.DailySchedule; +import org.junit.jupiter.api.Assertions; + +public final class DailyScheduleTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DailySchedule model = BinaryData.fromString("{\"intervalDays\":1694830705}").toObject(DailySchedule.class); + Assertions.assertEquals(1694830705, model.intervalDays()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DailySchedule model = new DailySchedule().withIntervalDays(1694830705); + model = BinaryData.fromObject(model).toObject(DailySchedule.class); + Assertions.assertEquals(1694830705, model.intervalDays()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/DateSpanTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/DateSpanTests.java new file mode 100644 index 000000000000..e713440ea1e5 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/DateSpanTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.DateSpan; + +public final class DateSpanTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DateSpan model = BinaryData.fromString("{}").toObject(DateSpan.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DateSpan model = new DateSpan(); + model = BinaryData.fromObject(model).toObject(DateSpan.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/DelegatedResourceTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/DelegatedResourceTests.java new file mode 100644 index 000000000000..73b621fc4d4a --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/DelegatedResourceTests.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.DelegatedResource; +import org.junit.jupiter.api.Assertions; + +public final class DelegatedResourceTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DelegatedResource model = BinaryData.fromString( + "{\"resourceId\":\"cg\",\"tenantId\":\"wndnhj\",\"referralResource\":\"uwhvylwzbtdhxujz\",\"location\":\"mpowuwpr\"}") + .toObject(DelegatedResource.class); + Assertions.assertEquals("cg", model.resourceId()); + Assertions.assertEquals("wndnhj", model.tenantId()); + Assertions.assertEquals("uwhvylwzbtdhxujz", model.referralResource()); + Assertions.assertEquals("mpowuwpr", model.location()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DelegatedResource model = new DelegatedResource().withResourceId("cg") + .withTenantId("wndnhj") + .withReferralResource("uwhvylwzbtdhxujz") + .withLocation("mpowuwpr"); + model = BinaryData.fromObject(model).toObject(DelegatedResource.class); + Assertions.assertEquals("cg", model.resourceId()); + Assertions.assertEquals("wndnhj", model.tenantId()); + Assertions.assertEquals("uwhvylwzbtdhxujz", model.referralResource()); + Assertions.assertEquals("mpowuwpr", model.location()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/EndpointDependencyTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/EndpointDependencyTests.java new file mode 100644 index 000000000000..91d397dfea3e --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/EndpointDependencyTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.EndpointDependency; +import org.junit.jupiter.api.Assertions; + +public final class EndpointDependencyTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EndpointDependency model = BinaryData.fromString( + "{\"domainName\":\"emwabnet\",\"endpointDetails\":[{\"ipAddress\":\"zhedplvwiw\",\"port\":1386333367,\"protocol\":\"mbes\",\"description\":\"nkww\"},{\"ipAddress\":\"pjflcxogao\",\"port\":244687825,\"protocol\":\"m\",\"description\":\"ikvmkqzeqqk\"},{\"ipAddress\":\"tfz\",\"port\":992785532,\"protocol\":\"v\",\"description\":\"ur\"},{\"ipAddress\":\"dkwobdagx\",\"port\":1583051460,\"protocol\":\"dxbx\",\"description\":\"kbogqxndlkzgx\"}]}") + .toObject(EndpointDependency.class); + Assertions.assertEquals("emwabnet", model.domainName()); + Assertions.assertEquals("zhedplvwiw", model.endpointDetails().get(0).ipAddress()); + Assertions.assertEquals(1386333367, model.endpointDetails().get(0).port()); + Assertions.assertEquals("mbes", model.endpointDetails().get(0).protocol()); + Assertions.assertEquals("nkww", model.endpointDetails().get(0).description()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/EndpointDetailTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/EndpointDetailTests.java new file mode 100644 index 000000000000..0d341b725308 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/EndpointDetailTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.EndpointDetail; +import org.junit.jupiter.api.Assertions; + +public final class EndpointDetailTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EndpointDetail model = BinaryData.fromString( + "{\"ipAddress\":\"ripl\",\"port\":1185146175,\"protocol\":\"xunkbebxmubyynt\",\"description\":\"rbqtkoie\"}") + .toObject(EndpointDetail.class); + Assertions.assertEquals("ripl", model.ipAddress()); + Assertions.assertEquals(1185146175, model.port()); + Assertions.assertEquals("xunkbebxmubyynt", model.protocol()); + Assertions.assertEquals("rbqtkoie", model.description()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ExtendedLocationTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ExtendedLocationTests.java new file mode 100644 index 000000000000..169e46580a90 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ExtendedLocationTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ExtendedLocation; +import com.azure.resourcemanager.containerservice.generated.models.ExtendedLocationTypes; +import org.junit.jupiter.api.Assertions; + +public final class ExtendedLocationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ExtendedLocation model = BinaryData.fromString("{\"name\":\"qxtccmgyudx\",\"type\":\"EdgeZone\"}") + .toObject(ExtendedLocation.class); + Assertions.assertEquals("qxtccmgyudx", model.name()); + Assertions.assertEquals(ExtendedLocationTypes.EDGE_ZONE, model.type()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ExtendedLocation model + = new ExtendedLocation().withName("qxtccmgyudx").withType(ExtendedLocationTypes.EDGE_ZONE); + model = BinaryData.fromObject(model).toObject(ExtendedLocation.class); + Assertions.assertEquals("qxtccmgyudx", model.name()); + Assertions.assertEquals(ExtendedLocationTypes.EDGE_ZONE, model.type()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/GPUProfileTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/GPUProfileTests.java new file mode 100644 index 000000000000..ee7aa5ce3df0 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/GPUProfileTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.GPUDriver; +import com.azure.resourcemanager.containerservice.generated.models.GPUProfile; +import org.junit.jupiter.api.Assertions; + +public final class GPUProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + GPUProfile model = BinaryData.fromString("{\"driver\":\"Install\"}").toObject(GPUProfile.class); + Assertions.assertEquals(GPUDriver.INSTALL, model.driver()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + GPUProfile model = new GPUProfile().withDriver(GPUDriver.INSTALL); + model = BinaryData.fromObject(model).toObject(GPUProfile.class); + Assertions.assertEquals(GPUDriver.INSTALL, model.driver()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/IPTagTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/IPTagTests.java new file mode 100644 index 000000000000..96ab08653000 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/IPTagTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.IPTag; +import org.junit.jupiter.api.Assertions; + +public final class IPTagTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + IPTag model + = BinaryData.fromString("{\"ipTagType\":\"felluwfzitonpe\",\"tag\":\"pjkjlxofpdv\"}").toObject(IPTag.class); + Assertions.assertEquals("felluwfzitonpe", model.ipTagType()); + Assertions.assertEquals("pjkjlxofpdv", model.tag()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + IPTag model = new IPTag().withIpTagType("felluwfzitonpe").withTag("pjkjlxofpdv"); + model = BinaryData.fromObject(model).toObject(IPTag.class); + Assertions.assertEquals("felluwfzitonpe", model.ipTagType()); + Assertions.assertEquals("pjkjlxofpdv", model.tag()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/IstioComponentsTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/IstioComponentsTests.java new file mode 100644 index 000000000000..ed7810e60ac6 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/IstioComponentsTests.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.IstioComponents; +import com.azure.resourcemanager.containerservice.generated.models.IstioEgressGateway; +import com.azure.resourcemanager.containerservice.generated.models.IstioIngressGateway; +import com.azure.resourcemanager.containerservice.generated.models.IstioIngressGatewayMode; +import com.azure.resourcemanager.containerservice.generated.models.ProxyRedirectionMechanism; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class IstioComponentsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + IstioComponents model = BinaryData.fromString( + "{\"ingressGateways\":[{\"mode\":\"External\",\"enabled\":false},{\"mode\":\"Internal\",\"enabled\":true},{\"mode\":\"External\",\"enabled\":true},{\"mode\":\"Internal\",\"enabled\":false}],\"egressGateways\":[{\"enabled\":false,\"name\":\"lo\",\"namespace\":\"oty\",\"gatewayConfigurationName\":\"fcnj\"}],\"proxyRedirectionMechanism\":\"InitContainers\"}") + .toObject(IstioComponents.class); + Assertions.assertEquals(IstioIngressGatewayMode.EXTERNAL, model.ingressGateways().get(0).mode()); + Assertions.assertFalse(model.ingressGateways().get(0).enabled()); + Assertions.assertFalse(model.egressGateways().get(0).enabled()); + Assertions.assertEquals("lo", model.egressGateways().get(0).name()); + Assertions.assertEquals("oty", model.egressGateways().get(0).namespace()); + Assertions.assertEquals("fcnj", model.egressGateways().get(0).gatewayConfigurationName()); + Assertions.assertEquals(ProxyRedirectionMechanism.INIT_CONTAINERS, model.proxyRedirectionMechanism()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + IstioComponents model = new IstioComponents() + .withIngressGateways( + Arrays.asList(new IstioIngressGateway().withMode(IstioIngressGatewayMode.EXTERNAL).withEnabled(false), + new IstioIngressGateway().withMode(IstioIngressGatewayMode.INTERNAL).withEnabled(true), + new IstioIngressGateway().withMode(IstioIngressGatewayMode.EXTERNAL).withEnabled(true), + new IstioIngressGateway().withMode(IstioIngressGatewayMode.INTERNAL).withEnabled(false))) + .withEgressGateways(Arrays.asList(new IstioEgressGateway().withEnabled(false) + .withName("lo") + .withNamespace("oty") + .withGatewayConfigurationName("fcnj"))) + .withProxyRedirectionMechanism(ProxyRedirectionMechanism.INIT_CONTAINERS); + model = BinaryData.fromObject(model).toObject(IstioComponents.class); + Assertions.assertEquals(IstioIngressGatewayMode.EXTERNAL, model.ingressGateways().get(0).mode()); + Assertions.assertFalse(model.ingressGateways().get(0).enabled()); + Assertions.assertFalse(model.egressGateways().get(0).enabled()); + Assertions.assertEquals("lo", model.egressGateways().get(0).name()); + Assertions.assertEquals("oty", model.egressGateways().get(0).namespace()); + Assertions.assertEquals("fcnj", model.egressGateways().get(0).gatewayConfigurationName()); + Assertions.assertEquals(ProxyRedirectionMechanism.INIT_CONTAINERS, model.proxyRedirectionMechanism()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/IstioEgressGatewayTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/IstioEgressGatewayTests.java new file mode 100644 index 000000000000..7d9423e746e1 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/IstioEgressGatewayTests.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.IstioEgressGateway; +import org.junit.jupiter.api.Assertions; + +public final class IstioEgressGatewayTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + IstioEgressGateway model = BinaryData.fromString( + "{\"enabled\":false,\"name\":\"hbttkphyw\",\"namespace\":\"vjtoqnermclfp\",\"gatewayConfigurationName\":\"hoxus\"}") + .toObject(IstioEgressGateway.class); + Assertions.assertFalse(model.enabled()); + Assertions.assertEquals("hbttkphyw", model.name()); + Assertions.assertEquals("vjtoqnermclfp", model.namespace()); + Assertions.assertEquals("hoxus", model.gatewayConfigurationName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + IstioEgressGateway model = new IstioEgressGateway().withEnabled(false) + .withName("hbttkphyw") + .withNamespace("vjtoqnermclfp") + .withGatewayConfigurationName("hoxus"); + model = BinaryData.fromObject(model).toObject(IstioEgressGateway.class); + Assertions.assertFalse(model.enabled()); + Assertions.assertEquals("hbttkphyw", model.name()); + Assertions.assertEquals("vjtoqnermclfp", model.namespace()); + Assertions.assertEquals("hoxus", model.gatewayConfigurationName()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/IstioIngressGatewayTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/IstioIngressGatewayTests.java new file mode 100644 index 000000000000..9a4bd655aa5d --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/IstioIngressGatewayTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.IstioIngressGateway; +import com.azure.resourcemanager.containerservice.generated.models.IstioIngressGatewayMode; +import org.junit.jupiter.api.Assertions; + +public final class IstioIngressGatewayTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + IstioIngressGateway model + = BinaryData.fromString("{\"mode\":\"External\",\"enabled\":false}").toObject(IstioIngressGateway.class); + Assertions.assertEquals(IstioIngressGatewayMode.EXTERNAL, model.mode()); + Assertions.assertFalse(model.enabled()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + IstioIngressGateway model + = new IstioIngressGateway().withMode(IstioIngressGatewayMode.EXTERNAL).withEnabled(false); + model = BinaryData.fromObject(model).toObject(IstioIngressGateway.class); + Assertions.assertEquals(IstioIngressGatewayMode.EXTERNAL, model.mode()); + Assertions.assertFalse(model.enabled()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/KubeletConfigTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/KubeletConfigTests.java new file mode 100644 index 000000000000..c32be5469415 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/KubeletConfigTests.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.KubeletConfig; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class KubeletConfigTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + KubeletConfig model = BinaryData.fromString( + "{\"cpuManagerPolicy\":\"xtij\",\"cpuCfsQuota\":false,\"cpuCfsQuotaPeriod\":\"gnwzsymglzufc\",\"imageGcHighThreshold\":2049014083,\"imageGcLowThreshold\":1760407196,\"topologyManagerPolicy\":\"bihanuf\",\"allowedUnsafeSysctls\":[\"bj\"],\"failSwapOn\":false,\"containerLogMaxSizeMB\":987241828,\"containerLogMaxFiles\":901713267,\"podMaxPids\":1190451363}") + .toObject(KubeletConfig.class); + Assertions.assertEquals("xtij", model.cpuManagerPolicy()); + Assertions.assertFalse(model.cpuCfsQuota()); + Assertions.assertEquals("gnwzsymglzufc", model.cpuCfsQuotaPeriod()); + Assertions.assertEquals(2049014083, model.imageGcHighThreshold()); + Assertions.assertEquals(1760407196, model.imageGcLowThreshold()); + Assertions.assertEquals("bihanuf", model.topologyManagerPolicy()); + Assertions.assertEquals("bj", model.allowedUnsafeSysctls().get(0)); + Assertions.assertFalse(model.failSwapOn()); + Assertions.assertEquals(987241828, model.containerLogMaxSizeMB()); + Assertions.assertEquals(901713267, model.containerLogMaxFiles()); + Assertions.assertEquals(1190451363, model.podMaxPids()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + KubeletConfig model = new KubeletConfig().withCpuManagerPolicy("xtij") + .withCpuCfsQuota(false) + .withCpuCfsQuotaPeriod("gnwzsymglzufc") + .withImageGcHighThreshold(2049014083) + .withImageGcLowThreshold(1760407196) + .withTopologyManagerPolicy("bihanuf") + .withAllowedUnsafeSysctls(Arrays.asList("bj")) + .withFailSwapOn(false) + .withContainerLogMaxSizeMB(987241828) + .withContainerLogMaxFiles(901713267) + .withPodMaxPids(1190451363); + model = BinaryData.fromObject(model).toObject(KubeletConfig.class); + Assertions.assertEquals("xtij", model.cpuManagerPolicy()); + Assertions.assertFalse(model.cpuCfsQuota()); + Assertions.assertEquals("gnwzsymglzufc", model.cpuCfsQuotaPeriod()); + Assertions.assertEquals(2049014083, model.imageGcHighThreshold()); + Assertions.assertEquals(1760407196, model.imageGcLowThreshold()); + Assertions.assertEquals("bihanuf", model.topologyManagerPolicy()); + Assertions.assertEquals("bj", model.allowedUnsafeSysctls().get(0)); + Assertions.assertFalse(model.failSwapOn()); + Assertions.assertEquals(987241828, model.containerLogMaxSizeMB()); + Assertions.assertEquals(901713267, model.containerLogMaxFiles()); + Assertions.assertEquals(1190451363, model.podMaxPids()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/KubernetesPatchVersionTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/KubernetesPatchVersionTests.java new file mode 100644 index 000000000000..d019628caae6 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/KubernetesPatchVersionTests.java @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.KubernetesPatchVersion; +import org.junit.jupiter.api.Assertions; + +public final class KubernetesPatchVersionTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + KubernetesPatchVersion model + = BinaryData.fromString("{\"upgrades\":[\"bi\"]}").toObject(KubernetesPatchVersion.class); + Assertions.assertEquals("bi", model.upgrades().get(0)); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/KubernetesVersionCapabilitiesTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/KubernetesVersionCapabilitiesTests.java new file mode 100644 index 000000000000..c80fb7b05501 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/KubernetesVersionCapabilitiesTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.KubernetesSupportPlan; +import com.azure.resourcemanager.containerservice.generated.models.KubernetesVersionCapabilities; +import org.junit.jupiter.api.Assertions; + +public final class KubernetesVersionCapabilitiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + KubernetesVersionCapabilities model = BinaryData.fromString("{\"supportPlan\":[\"KubernetesOfficial\"]}") + .toObject(KubernetesVersionCapabilities.class); + Assertions.assertEquals(KubernetesSupportPlan.KUBERNETES_OFFICIAL, model.supportPlan().get(0)); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/KubernetesVersionListResultInnerTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/KubernetesVersionListResultInnerTests.java new file mode 100644 index 000000000000..ef2b3543803d --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/KubernetesVersionListResultInnerTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.fluent.models.KubernetesVersionListResultInner; +import com.azure.resourcemanager.containerservice.generated.models.KubernetesSupportPlan; +import org.junit.jupiter.api.Assertions; + +public final class KubernetesVersionListResultInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + KubernetesVersionListResultInner model = BinaryData.fromString( + "{\"values\":[{\"version\":\"kopbminrf\",\"capabilities\":{\"supportPlan\":[\"AKSLongTermSupport\",\"KubernetesOfficial\"]},\"isDefault\":true,\"isPreview\":false,\"patchVersions\":{\"hxicslfaoqz\":{\"upgrades\":[\"zbhd\",\"smlmzqhoftrm\",\"equi\"]},\"h\":{\"upgrades\":[\"ylhalnswhcc\",\"ph\",\"aivwitqscywu\",\"gwol\"]},\"wmsweypqwd\":{\"upgrades\":[\"wem\",\"ai\",\"sbrgz\"]}}},{\"version\":\"gicccnxqhuex\",\"capabilities\":{\"supportPlan\":[\"AKSLongTermSupport\",\"AKSLongTermSupport\",\"KubernetesOfficial\"]},\"isDefault\":true,\"isPreview\":false,\"patchVersions\":{\"lusiy\":{\"upgrades\":[\"zrncsdt\"]},\"swibyr\":{\"upgrades\":[\"fgytguslfeadcyg\",\"ukyhejhzis\",\"gfpelolppvksrpqv\",\"jzraehtwdwrf\"]},\"hevxcced\":{\"upgrades\":[\"bhshfwpracstwity\"]}}},{\"version\":\"nmdyodnwzxl\",\"capabilities\":{\"supportPlan\":[\"AKSLongTermSupport\",\"KubernetesOfficial\",\"AKSLongTermSupport\"]},\"isDefault\":true,\"isPreview\":false,\"patchVersions\":{\"unyowxwl\":{\"upgrades\":[\"vvwxqi\",\"y\"]},\"rwkq\":{\"upgrades\":[\"rkvfgbvfvpdbo\",\"acizsjqlhkrr\",\"bdeibqipqk\",\"hvxndzwmkrefajpj\"]}}}]}") + .toObject(KubernetesVersionListResultInner.class); + Assertions.assertEquals("kopbminrf", model.values().get(0).version()); + Assertions.assertEquals(KubernetesSupportPlan.AKSLONG_TERM_SUPPORT, + model.values().get(0).capabilities().supportPlan().get(0)); + Assertions.assertTrue(model.values().get(0).isDefault()); + Assertions.assertFalse(model.values().get(0).isPreview()); + Assertions.assertEquals("zbhd", model.values().get(0).patchVersions().get("hxicslfaoqz").upgrades().get(0)); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/KubernetesVersionTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/KubernetesVersionTests.java new file mode 100644 index 000000000000..332a059d9cd2 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/KubernetesVersionTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.KubernetesSupportPlan; +import com.azure.resourcemanager.containerservice.generated.models.KubernetesVersion; +import org.junit.jupiter.api.Assertions; + +public final class KubernetesVersionTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + KubernetesVersion model = BinaryData.fromString( + "{\"version\":\"hgbijt\",\"capabilities\":{\"supportPlan\":[\"KubernetesOfficial\",\"KubernetesOfficial\",\"KubernetesOfficial\",\"AKSLongTermSupport\"]},\"isDefault\":true,\"isPreview\":true,\"patchVersions\":{\"zhjjklffhmouwq\":{\"upgrades\":[\"awfsdjpvkvpbjxbk\",\"bzkdvn\",\"jabudurgkakmo\"]},\"bjbsybb\":{\"upgrades\":[\"rfzeey\",\"bizikayuhq\"]},\"slthaq\":{\"upgrades\":[\"vtldgmfpgvmpip\"]},\"hneuyowqkd\":{\"upgrades\":[\"smwutwbdsrezpd\"]}}}") + .toObject(KubernetesVersion.class); + Assertions.assertEquals("hgbijt", model.version()); + Assertions.assertEquals(KubernetesSupportPlan.KUBERNETES_OFFICIAL, model.capabilities().supportPlan().get(0)); + Assertions.assertTrue(model.isDefault()); + Assertions.assertTrue(model.isPreview()); + Assertions.assertEquals("awfsdjpvkvpbjxbk", model.patchVersions().get("zhjjklffhmouwq").upgrades().get(0)); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/LinuxOSConfigTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/LinuxOSConfigTests.java new file mode 100644 index 000000000000..088b7dff68b1 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/LinuxOSConfigTests.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.LinuxOSConfig; +import com.azure.resourcemanager.containerservice.generated.models.SysctlConfig; +import org.junit.jupiter.api.Assertions; + +public final class LinuxOSConfigTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + LinuxOSConfig model = BinaryData.fromString( + "{\"sysctls\":{\"netCoreSomaxconn\":676674728,\"netCoreNetdevMaxBacklog\":135475125,\"netCoreRmemDefault\":1105410727,\"netCoreRmemMax\":352895136,\"netCoreWmemDefault\":1464856632,\"netCoreWmemMax\":1445888442,\"netCoreOptmemMax\":785135180,\"netIpv4TcpMaxSynBacklog\":1384277756,\"netIpv4TcpMaxTwBuckets\":196107786,\"netIpv4TcpFinTimeout\":219984358,\"netIpv4TcpKeepaliveTime\":1646115006,\"netIpv4TcpKeepaliveProbes\":222313615,\"netIpv4TcpkeepaliveIntvl\":1846033,\"netIpv4TcpTwReuse\":false,\"netIpv4IpLocalPortRange\":\"ybrk\",\"netIpv4NeighDefaultGcThresh1\":827133079,\"netIpv4NeighDefaultGcThresh2\":832798449,\"netIpv4NeighDefaultGcThresh3\":1629282531,\"netNetfilterNfConntrackMax\":1041852302,\"netNetfilterNfConntrackBuckets\":1126091678,\"fsInotifyMaxUserWatches\":1656802567,\"fsFileMax\":2033205532,\"fsAioMaxNr\":224471404,\"fsNrOpen\":626683604,\"kernelThreadsMax\":300178324,\"vmMaxMapCount\":157917305,\"vmSwappiness\":14804050,\"vmVfsCachePressure\":2045600331},\"transparentHugePageEnabled\":\"yejhk\",\"transparentHugePageDefrag\":\"htnapczwlokjyem\",\"swapFileSizeMB\":1665801665}") + .toObject(LinuxOSConfig.class); + Assertions.assertEquals(676674728, model.sysctls().netCoreSomaxconn()); + Assertions.assertEquals(135475125, model.sysctls().netCoreNetdevMaxBacklog()); + Assertions.assertEquals(1105410727, model.sysctls().netCoreRmemDefault()); + Assertions.assertEquals(352895136, model.sysctls().netCoreRmemMax()); + Assertions.assertEquals(1464856632, model.sysctls().netCoreWmemDefault()); + Assertions.assertEquals(1445888442, model.sysctls().netCoreWmemMax()); + Assertions.assertEquals(785135180, model.sysctls().netCoreOptmemMax()); + Assertions.assertEquals(1384277756, model.sysctls().netIpv4TcpMaxSynBacklog()); + Assertions.assertEquals(196107786, model.sysctls().netIpv4TcpMaxTwBuckets()); + Assertions.assertEquals(219984358, model.sysctls().netIpv4TcpFinTimeout()); + Assertions.assertEquals(1646115006, model.sysctls().netIpv4TcpKeepaliveTime()); + Assertions.assertEquals(222313615, model.sysctls().netIpv4TcpKeepaliveProbes()); + Assertions.assertEquals(1846033, model.sysctls().netIpv4TcpkeepaliveIntvl()); + Assertions.assertFalse(model.sysctls().netIpv4TcpTwReuse()); + Assertions.assertEquals("ybrk", model.sysctls().netIpv4IpLocalPortRange()); + Assertions.assertEquals(827133079, model.sysctls().netIpv4NeighDefaultGcThresh1()); + Assertions.assertEquals(832798449, model.sysctls().netIpv4NeighDefaultGcThresh2()); + Assertions.assertEquals(1629282531, model.sysctls().netIpv4NeighDefaultGcThresh3()); + Assertions.assertEquals(1041852302, model.sysctls().netNetfilterNfConntrackMax()); + Assertions.assertEquals(1126091678, model.sysctls().netNetfilterNfConntrackBuckets()); + Assertions.assertEquals(1656802567, model.sysctls().fsInotifyMaxUserWatches()); + Assertions.assertEquals(2033205532, model.sysctls().fsFileMax()); + Assertions.assertEquals(224471404, model.sysctls().fsAioMaxNr()); + Assertions.assertEquals(626683604, model.sysctls().fsNrOpen()); + Assertions.assertEquals(300178324, model.sysctls().kernelThreadsMax()); + Assertions.assertEquals(157917305, model.sysctls().vmMaxMapCount()); + Assertions.assertEquals(14804050, model.sysctls().vmSwappiness()); + Assertions.assertEquals(2045600331, model.sysctls().vmVfsCachePressure()); + Assertions.assertEquals("yejhk", model.transparentHugePageEnabled()); + Assertions.assertEquals("htnapczwlokjyem", model.transparentHugePageDefrag()); + Assertions.assertEquals(1665801665, model.swapFileSizeMB()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + LinuxOSConfig model = new LinuxOSConfig() + .withSysctls(new SysctlConfig().withNetCoreSomaxconn(676674728) + .withNetCoreNetdevMaxBacklog(135475125) + .withNetCoreRmemDefault(1105410727) + .withNetCoreRmemMax(352895136) + .withNetCoreWmemDefault(1464856632) + .withNetCoreWmemMax(1445888442) + .withNetCoreOptmemMax(785135180) + .withNetIpv4TcpMaxSynBacklog(1384277756) + .withNetIpv4TcpMaxTwBuckets(196107786) + .withNetIpv4TcpFinTimeout(219984358) + .withNetIpv4TcpKeepaliveTime(1646115006) + .withNetIpv4TcpKeepaliveProbes(222313615) + .withNetIpv4TcpkeepaliveIntvl(1846033) + .withNetIpv4TcpTwReuse(false) + .withNetIpv4IpLocalPortRange("ybrk") + .withNetIpv4NeighDefaultGcThresh1(827133079) + .withNetIpv4NeighDefaultGcThresh2(832798449) + .withNetIpv4NeighDefaultGcThresh3(1629282531) + .withNetNetfilterNfConntrackMax(1041852302) + .withNetNetfilterNfConntrackBuckets(1126091678) + .withFsInotifyMaxUserWatches(1656802567) + .withFsFileMax(2033205532) + .withFsAioMaxNr(224471404) + .withFsNrOpen(626683604) + .withKernelThreadsMax(300178324) + .withVmMaxMapCount(157917305) + .withVmSwappiness(14804050) + .withVmVfsCachePressure(2045600331)) + .withTransparentHugePageEnabled("yejhk") + .withTransparentHugePageDefrag("htnapczwlokjyem") + .withSwapFileSizeMB(1665801665); + model = BinaryData.fromObject(model).toObject(LinuxOSConfig.class); + Assertions.assertEquals(676674728, model.sysctls().netCoreSomaxconn()); + Assertions.assertEquals(135475125, model.sysctls().netCoreNetdevMaxBacklog()); + Assertions.assertEquals(1105410727, model.sysctls().netCoreRmemDefault()); + Assertions.assertEquals(352895136, model.sysctls().netCoreRmemMax()); + Assertions.assertEquals(1464856632, model.sysctls().netCoreWmemDefault()); + Assertions.assertEquals(1445888442, model.sysctls().netCoreWmemMax()); + Assertions.assertEquals(785135180, model.sysctls().netCoreOptmemMax()); + Assertions.assertEquals(1384277756, model.sysctls().netIpv4TcpMaxSynBacklog()); + Assertions.assertEquals(196107786, model.sysctls().netIpv4TcpMaxTwBuckets()); + Assertions.assertEquals(219984358, model.sysctls().netIpv4TcpFinTimeout()); + Assertions.assertEquals(1646115006, model.sysctls().netIpv4TcpKeepaliveTime()); + Assertions.assertEquals(222313615, model.sysctls().netIpv4TcpKeepaliveProbes()); + Assertions.assertEquals(1846033, model.sysctls().netIpv4TcpkeepaliveIntvl()); + Assertions.assertFalse(model.sysctls().netIpv4TcpTwReuse()); + Assertions.assertEquals("ybrk", model.sysctls().netIpv4IpLocalPortRange()); + Assertions.assertEquals(827133079, model.sysctls().netIpv4NeighDefaultGcThresh1()); + Assertions.assertEquals(832798449, model.sysctls().netIpv4NeighDefaultGcThresh2()); + Assertions.assertEquals(1629282531, model.sysctls().netIpv4NeighDefaultGcThresh3()); + Assertions.assertEquals(1041852302, model.sysctls().netNetfilterNfConntrackMax()); + Assertions.assertEquals(1126091678, model.sysctls().netNetfilterNfConntrackBuckets()); + Assertions.assertEquals(1656802567, model.sysctls().fsInotifyMaxUserWatches()); + Assertions.assertEquals(2033205532, model.sysctls().fsFileMax()); + Assertions.assertEquals(224471404, model.sysctls().fsAioMaxNr()); + Assertions.assertEquals(626683604, model.sysctls().fsNrOpen()); + Assertions.assertEquals(300178324, model.sysctls().kernelThreadsMax()); + Assertions.assertEquals(157917305, model.sysctls().vmMaxMapCount()); + Assertions.assertEquals(14804050, model.sysctls().vmSwappiness()); + Assertions.assertEquals(2045600331, model.sysctls().vmVfsCachePressure()); + Assertions.assertEquals("yejhk", model.transparentHugePageEnabled()); + Assertions.assertEquals("htnapczwlokjyem", model.transparentHugePageDefrag()); + Assertions.assertEquals(1665801665, model.swapFileSizeMB()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/LocalDNSOverrideTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/LocalDNSOverrideTests.java new file mode 100644 index 000000000000..f248a032109b --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/LocalDNSOverrideTests.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.LocalDNSForwardDestination; +import com.azure.resourcemanager.containerservice.generated.models.LocalDNSForwardPolicy; +import com.azure.resourcemanager.containerservice.generated.models.LocalDNSOverride; +import com.azure.resourcemanager.containerservice.generated.models.LocalDNSProtocol; +import com.azure.resourcemanager.containerservice.generated.models.LocalDNSQueryLogging; +import com.azure.resourcemanager.containerservice.generated.models.LocalDNSServeStale; +import org.junit.jupiter.api.Assertions; + +public final class LocalDNSOverrideTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + LocalDNSOverride model = BinaryData.fromString( + "{\"queryLogging\":\"Error\",\"protocol\":\"ForceTCP\",\"forwardDestination\":\"ClusterCoreDNS\",\"forwardPolicy\":\"Sequential\",\"maxConcurrent\":1003107077,\"cacheDurationInSeconds\":1757775346,\"serveStaleDurationInSeconds\":1700892403,\"serveStale\":\"Verify\"}") + .toObject(LocalDNSOverride.class); + Assertions.assertEquals(LocalDNSQueryLogging.ERROR, model.queryLogging()); + Assertions.assertEquals(LocalDNSProtocol.FORCE_TCP, model.protocol()); + Assertions.assertEquals(LocalDNSForwardDestination.CLUSTER_CORE_DNS, model.forwardDestination()); + Assertions.assertEquals(LocalDNSForwardPolicy.SEQUENTIAL, model.forwardPolicy()); + Assertions.assertEquals(1003107077, model.maxConcurrent()); + Assertions.assertEquals(1757775346, model.cacheDurationInSeconds()); + Assertions.assertEquals(1700892403, model.serveStaleDurationInSeconds()); + Assertions.assertEquals(LocalDNSServeStale.VERIFY, model.serveStale()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + LocalDNSOverride model = new LocalDNSOverride().withQueryLogging(LocalDNSQueryLogging.ERROR) + .withProtocol(LocalDNSProtocol.FORCE_TCP) + .withForwardDestination(LocalDNSForwardDestination.CLUSTER_CORE_DNS) + .withForwardPolicy(LocalDNSForwardPolicy.SEQUENTIAL) + .withMaxConcurrent(1003107077) + .withCacheDurationInSeconds(1757775346) + .withServeStaleDurationInSeconds(1700892403) + .withServeStale(LocalDNSServeStale.VERIFY); + model = BinaryData.fromObject(model).toObject(LocalDNSOverride.class); + Assertions.assertEquals(LocalDNSQueryLogging.ERROR, model.queryLogging()); + Assertions.assertEquals(LocalDNSProtocol.FORCE_TCP, model.protocol()); + Assertions.assertEquals(LocalDNSForwardDestination.CLUSTER_CORE_DNS, model.forwardDestination()); + Assertions.assertEquals(LocalDNSForwardPolicy.SEQUENTIAL, model.forwardPolicy()); + Assertions.assertEquals(1003107077, model.maxConcurrent()); + Assertions.assertEquals(1757775346, model.cacheDurationInSeconds()); + Assertions.assertEquals(1700892403, model.serveStaleDurationInSeconds()); + Assertions.assertEquals(LocalDNSServeStale.VERIFY, model.serveStale()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/LocalDNSProfileTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/LocalDNSProfileTests.java new file mode 100644 index 000000000000..778d03edf70f --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/LocalDNSProfileTests.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.LocalDNSForwardDestination; +import com.azure.resourcemanager.containerservice.generated.models.LocalDNSForwardPolicy; +import com.azure.resourcemanager.containerservice.generated.models.LocalDNSMode; +import com.azure.resourcemanager.containerservice.generated.models.LocalDNSOverride; +import com.azure.resourcemanager.containerservice.generated.models.LocalDNSProfile; +import com.azure.resourcemanager.containerservice.generated.models.LocalDNSProtocol; +import com.azure.resourcemanager.containerservice.generated.models.LocalDNSQueryLogging; +import com.azure.resourcemanager.containerservice.generated.models.LocalDNSServeStale; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class LocalDNSProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + LocalDNSProfile model = BinaryData.fromString( + "{\"mode\":\"Preferred\",\"state\":\"Disabled\",\"vnetDNSOverrides\":{\"s\":{\"queryLogging\":\"Log\",\"protocol\":\"ForceTCP\",\"forwardDestination\":\"ClusterCoreDNS\",\"forwardPolicy\":\"RoundRobin\",\"maxConcurrent\":1887671612,\"cacheDurationInSeconds\":565226786,\"serveStaleDurationInSeconds\":1787416912,\"serveStale\":\"Disable\"}},\"kubeDNSOverrides\":{\"gc\":{\"queryLogging\":\"Error\",\"protocol\":\"PreferUDP\",\"forwardDestination\":\"VnetDNS\",\"forwardPolicy\":\"Sequential\",\"maxConcurrent\":568686899,\"cacheDurationInSeconds\":1462243642,\"serveStaleDurationInSeconds\":588307069,\"serveStale\":\"Immediate\"},\"qvkoc\":{\"queryLogging\":\"Error\",\"protocol\":\"ForceTCP\",\"forwardDestination\":\"VnetDNS\",\"forwardPolicy\":\"Random\",\"maxConcurrent\":1334059398,\"cacheDurationInSeconds\":1070346714,\"serveStaleDurationInSeconds\":890604952,\"serveStale\":\"Immediate\"},\"qrglssainqpjwn\":{\"queryLogging\":\"Log\",\"protocol\":\"PreferUDP\",\"forwardDestination\":\"ClusterCoreDNS\",\"forwardPolicy\":\"Random\",\"maxConcurrent\":2077137838,\"cacheDurationInSeconds\":1299495603,\"serveStaleDurationInSeconds\":1320429450,\"serveStale\":\"Disable\"},\"bkyqduu\":{\"queryLogging\":\"Error\",\"protocol\":\"PreferUDP\",\"forwardDestination\":\"VnetDNS\",\"forwardPolicy\":\"Sequential\",\"maxConcurrent\":2010421384,\"cacheDurationInSeconds\":1530688943,\"serveStaleDurationInSeconds\":168593557,\"serveStale\":\"Disable\"}}}") + .toObject(LocalDNSProfile.class); + Assertions.assertEquals(LocalDNSMode.PREFERRED, model.mode()); + Assertions.assertEquals(LocalDNSQueryLogging.LOG, model.vnetDNSOverrides().get("s").queryLogging()); + Assertions.assertEquals(LocalDNSProtocol.FORCE_TCP, model.vnetDNSOverrides().get("s").protocol()); + Assertions.assertEquals(LocalDNSForwardDestination.CLUSTER_CORE_DNS, + model.vnetDNSOverrides().get("s").forwardDestination()); + Assertions.assertEquals(LocalDNSForwardPolicy.ROUND_ROBIN, model.vnetDNSOverrides().get("s").forwardPolicy()); + Assertions.assertEquals(1887671612, model.vnetDNSOverrides().get("s").maxConcurrent()); + Assertions.assertEquals(565226786, model.vnetDNSOverrides().get("s").cacheDurationInSeconds()); + Assertions.assertEquals(1787416912, model.vnetDNSOverrides().get("s").serveStaleDurationInSeconds()); + Assertions.assertEquals(LocalDNSServeStale.DISABLE, model.vnetDNSOverrides().get("s").serveStale()); + Assertions.assertEquals(LocalDNSQueryLogging.ERROR, model.kubeDNSOverrides().get("gc").queryLogging()); + Assertions.assertEquals(LocalDNSProtocol.PREFER_UDP, model.kubeDNSOverrides().get("gc").protocol()); + Assertions.assertEquals(LocalDNSForwardDestination.VNET_DNS, + model.kubeDNSOverrides().get("gc").forwardDestination()); + Assertions.assertEquals(LocalDNSForwardPolicy.SEQUENTIAL, model.kubeDNSOverrides().get("gc").forwardPolicy()); + Assertions.assertEquals(568686899, model.kubeDNSOverrides().get("gc").maxConcurrent()); + Assertions.assertEquals(1462243642, model.kubeDNSOverrides().get("gc").cacheDurationInSeconds()); + Assertions.assertEquals(588307069, model.kubeDNSOverrides().get("gc").serveStaleDurationInSeconds()); + Assertions.assertEquals(LocalDNSServeStale.IMMEDIATE, model.kubeDNSOverrides().get("gc").serveStale()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + LocalDNSProfile model = new LocalDNSProfile().withMode(LocalDNSMode.PREFERRED) + .withVnetDNSOverrides(mapOf("s", + new LocalDNSOverride().withQueryLogging(LocalDNSQueryLogging.LOG) + .withProtocol(LocalDNSProtocol.FORCE_TCP) + .withForwardDestination(LocalDNSForwardDestination.CLUSTER_CORE_DNS) + .withForwardPolicy(LocalDNSForwardPolicy.ROUND_ROBIN) + .withMaxConcurrent(1887671612) + .withCacheDurationInSeconds(565226786) + .withServeStaleDurationInSeconds(1787416912) + .withServeStale(LocalDNSServeStale.DISABLE))) + .withKubeDNSOverrides(mapOf("gc", + new LocalDNSOverride().withQueryLogging(LocalDNSQueryLogging.ERROR) + .withProtocol(LocalDNSProtocol.PREFER_UDP) + .withForwardDestination(LocalDNSForwardDestination.VNET_DNS) + .withForwardPolicy(LocalDNSForwardPolicy.SEQUENTIAL) + .withMaxConcurrent(568686899) + .withCacheDurationInSeconds(1462243642) + .withServeStaleDurationInSeconds(588307069) + .withServeStale(LocalDNSServeStale.IMMEDIATE), + "qvkoc", + new LocalDNSOverride().withQueryLogging(LocalDNSQueryLogging.ERROR) + .withProtocol(LocalDNSProtocol.FORCE_TCP) + .withForwardDestination(LocalDNSForwardDestination.VNET_DNS) + .withForwardPolicy(LocalDNSForwardPolicy.RANDOM) + .withMaxConcurrent(1334059398) + .withCacheDurationInSeconds(1070346714) + .withServeStaleDurationInSeconds(890604952) + .withServeStale(LocalDNSServeStale.IMMEDIATE), + "qrglssainqpjwn", + new LocalDNSOverride().withQueryLogging(LocalDNSQueryLogging.LOG) + .withProtocol(LocalDNSProtocol.PREFER_UDP) + .withForwardDestination(LocalDNSForwardDestination.CLUSTER_CORE_DNS) + .withForwardPolicy(LocalDNSForwardPolicy.RANDOM) + .withMaxConcurrent(2077137838) + .withCacheDurationInSeconds(1299495603) + .withServeStaleDurationInSeconds(1320429450) + .withServeStale(LocalDNSServeStale.DISABLE), + "bkyqduu", + new LocalDNSOverride().withQueryLogging(LocalDNSQueryLogging.ERROR) + .withProtocol(LocalDNSProtocol.PREFER_UDP) + .withForwardDestination(LocalDNSForwardDestination.VNET_DNS) + .withForwardPolicy(LocalDNSForwardPolicy.SEQUENTIAL) + .withMaxConcurrent(2010421384) + .withCacheDurationInSeconds(1530688943) + .withServeStaleDurationInSeconds(168593557) + .withServeStale(LocalDNSServeStale.DISABLE))); + model = BinaryData.fromObject(model).toObject(LocalDNSProfile.class); + Assertions.assertEquals(LocalDNSMode.PREFERRED, model.mode()); + Assertions.assertEquals(LocalDNSQueryLogging.LOG, model.vnetDNSOverrides().get("s").queryLogging()); + Assertions.assertEquals(LocalDNSProtocol.FORCE_TCP, model.vnetDNSOverrides().get("s").protocol()); + Assertions.assertEquals(LocalDNSForwardDestination.CLUSTER_CORE_DNS, + model.vnetDNSOverrides().get("s").forwardDestination()); + Assertions.assertEquals(LocalDNSForwardPolicy.ROUND_ROBIN, model.vnetDNSOverrides().get("s").forwardPolicy()); + Assertions.assertEquals(1887671612, model.vnetDNSOverrides().get("s").maxConcurrent()); + Assertions.assertEquals(565226786, model.vnetDNSOverrides().get("s").cacheDurationInSeconds()); + Assertions.assertEquals(1787416912, model.vnetDNSOverrides().get("s").serveStaleDurationInSeconds()); + Assertions.assertEquals(LocalDNSServeStale.DISABLE, model.vnetDNSOverrides().get("s").serveStale()); + Assertions.assertEquals(LocalDNSQueryLogging.ERROR, model.kubeDNSOverrides().get("gc").queryLogging()); + Assertions.assertEquals(LocalDNSProtocol.PREFER_UDP, model.kubeDNSOverrides().get("gc").protocol()); + Assertions.assertEquals(LocalDNSForwardDestination.VNET_DNS, + model.kubeDNSOverrides().get("gc").forwardDestination()); + Assertions.assertEquals(LocalDNSForwardPolicy.SEQUENTIAL, model.kubeDNSOverrides().get("gc").forwardPolicy()); + Assertions.assertEquals(568686899, model.kubeDNSOverrides().get("gc").maxConcurrent()); + Assertions.assertEquals(1462243642, model.kubeDNSOverrides().get("gc").cacheDurationInSeconds()); + Assertions.assertEquals(588307069, model.kubeDNSOverrides().get("gc").serveStaleDurationInSeconds()); + Assertions.assertEquals(LocalDNSServeStale.IMMEDIATE, model.kubeDNSOverrides().get("gc").serveStale()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MachineInnerTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MachineInnerTests.java new file mode 100644 index 000000000000..8dc251647fb8 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MachineInnerTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.fluent.models.MachineInner; + +public final class MachineInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MachineInner model = BinaryData.fromString( + "{\"properties\":{\"network\":{\"ipAddresses\":[{\"family\":\"IPv6\",\"ip\":\"qubkw\"},{\"family\":\"IPv4\",\"ip\":\"rds\"},{\"family\":\"IPv6\",\"ip\":\"bazpjuohmi\"}]},\"resourceId\":\"flnorwmduvwp\"},\"zones\":[\"xwmygdxpgpqc\",\"isze\"],\"id\":\"nb\",\"name\":\"crxgibb\",\"type\":\"axconfozauo\"}") + .toObject(MachineInner.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MachineIpAddressTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MachineIpAddressTests.java new file mode 100644 index 000000000000..1199b86b2600 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MachineIpAddressTests.java @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.MachineIpAddress; + +public final class MachineIpAddressTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MachineIpAddress model + = BinaryData.fromString("{\"family\":\"IPv4\",\"ip\":\"nmacj\"}").toObject(MachineIpAddress.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MachineListResultTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MachineListResultTests.java new file mode 100644 index 000000000000..0cdbdca4d6cd --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MachineListResultTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.implementation.models.MachineListResult; +import org.junit.jupiter.api.Assertions; + +public final class MachineListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MachineListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"network\":{\"ipAddresses\":[{},{},{}]},\"resourceId\":\"qvci\"},\"zones\":[\"vfgmblrrilby\"],\"id\":\"xsmiccwrwfscjf\",\"name\":\"ynszquji\",\"type\":\"dvoqyt\"}],\"nextLink\":\"yo\"}") + .toObject(MachineListResult.class); + Assertions.assertEquals("yo", model.nextLink()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MachineNetworkPropertiesTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MachineNetworkPropertiesTests.java new file mode 100644 index 000000000000..ee52b659f256 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MachineNetworkPropertiesTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.MachineNetworkProperties; + +public final class MachineNetworkPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MachineNetworkProperties model = BinaryData.fromString( + "{\"ipAddresses\":[{\"family\":\"IPv4\",\"ip\":\"ggdufiqndieu\"},{\"family\":\"IPv6\",\"ip\":\"jchvcyy\"},{\"family\":\"IPv4\",\"ip\":\"dotcubiipuip\"}]}") + .toObject(MachineNetworkProperties.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MachinePropertiesTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MachinePropertiesTests.java new file mode 100644 index 000000000000..449582e89c9d --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MachinePropertiesTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.MachineProperties; + +public final class MachinePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MachineProperties model = BinaryData.fromString( + "{\"network\":{\"ipAddresses\":[{\"family\":\"IPv6\",\"ip\":\"bqplh\"},{\"family\":\"IPv6\",\"ip\":\"uepzl\"},{\"family\":\"IPv4\",\"ip\":\"zsoldwey\"},{\"family\":\"IPv6\",\"ip\":\"nvmnnrwrbiorkta\"}]},\"resourceId\":\"wjhhgdnhxmsivf\"}") + .toObject(MachineProperties.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MachinesGetWithResponseMockTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MachinesGetWithResponseMockTests.java new file mode 100644 index 000000000000..2380b939ac6f --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MachinesGetWithResponseMockTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.containerservice.generated.ContainerServiceManager; +import com.azure.resourcemanager.containerservice.generated.models.Machine; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class MachinesGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"network\":{\"ipAddresses\":[{\"family\":\"IPv6\",\"ip\":\"mu\"},{\"family\":\"IPv4\",\"ip\":\"yrplrohkpigqfus\"},{\"family\":\"IPv6\",\"ip\":\"mkwkl\"}]},\"resourceId\":\"oxaxm\"},\"zones\":[\"alhhjnhgwydyynfs\",\"khgb\"],\"id\":\"ta\",\"name\":\"arfdlpukhpyrnei\",\"type\":\"jcpeogkhnmg\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ContainerServiceManager manager = ContainerServiceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + Machine response = manager.machines() + .getWithResponse("nchrszizoyu", "lyetndnbfqygg", "g", "lnlg", com.azure.core.util.Context.NONE) + .getValue(); + + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MachinesListMockTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MachinesListMockTests.java new file mode 100644 index 000000000000..883afbc05a4a --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MachinesListMockTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.containerservice.generated.ContainerServiceManager; +import com.azure.resourcemanager.containerservice.generated.models.Machine; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class MachinesListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"network\":{\"ipAddresses\":[{\"family\":\"IPv6\",\"ip\":\"ntacn\"},{\"family\":\"IPv4\",\"ip\":\"ehtuevrhr\"},{\"family\":\"IPv4\",\"ip\":\"ogwxhnsduugwb\"}]},\"resourceId\":\"e\"},\"zones\":[\"q\",\"fuarenlvhht\",\"lnvnafvvkyfedev\"],\"id\":\"oslc\",\"name\":\"xypokkhmi\",\"type\":\"q\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ContainerServiceManager manager = ContainerServiceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.machines().list("ro", "xddbhfhpfpaz", "zoyw", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationInnerTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationInnerTests.java new file mode 100644 index 000000000000..b9bf6d54db75 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationInnerTests.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.fluent.models.MaintenanceConfigurationInner; +import com.azure.resourcemanager.containerservice.generated.models.AbsoluteMonthlySchedule; +import com.azure.resourcemanager.containerservice.generated.models.DailySchedule; +import com.azure.resourcemanager.containerservice.generated.models.DateSpan; +import com.azure.resourcemanager.containerservice.generated.models.MaintenanceWindow; +import com.azure.resourcemanager.containerservice.generated.models.RelativeMonthlySchedule; +import com.azure.resourcemanager.containerservice.generated.models.Schedule; +import com.azure.resourcemanager.containerservice.generated.models.TimeInWeek; +import com.azure.resourcemanager.containerservice.generated.models.TimeSpan; +import com.azure.resourcemanager.containerservice.generated.models.Type; +import com.azure.resourcemanager.containerservice.generated.models.WeekDay; +import com.azure.resourcemanager.containerservice.generated.models.WeeklySchedule; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class MaintenanceConfigurationInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MaintenanceConfigurationInner model = BinaryData.fromString( + "{\"properties\":{\"timeInWeek\":[{\"day\":\"Saturday\",\"hourSlots\":[2086081346,1051878092,2049479560]},{\"day\":\"Sunday\",\"hourSlots\":[2016240775,108512766,1785480642]}],\"notAllowedTime\":[{\"start\":\"2021-06-15T11:53:02Z\",\"end\":\"2021-11-26T01:54:29Z\"},{\"start\":\"2021-09-16T17:22:47Z\",\"end\":\"2021-09-13T10:29:44Z\"}],\"maintenanceWindow\":{\"schedule\":{\"daily\":{\"intervalDays\":185109829},\"weekly\":{\"intervalWeeks\":988966310,\"dayOfWeek\":\"Tuesday\"},\"absoluteMonthly\":{\"intervalMonths\":1432241544,\"dayOfMonth\":1122267125},\"relativeMonthly\":{\"intervalMonths\":1711524187,\"weekIndex\":\"Second\",\"dayOfWeek\":\"Friday\"}},\"durationHours\":655143714,\"utcOffset\":\"lazszrn\",\"startTime\":\"iin\",\"notAllowedDates\":[{}]}},\"id\":\"pj\",\"name\":\"lwbtlhf\",\"type\":\"sj\"}") + .toObject(MaintenanceConfigurationInner.class); + Assertions.assertEquals(WeekDay.SATURDAY, model.timeInWeek().get(0).day()); + Assertions.assertEquals(2086081346, model.timeInWeek().get(0).hourSlots().get(0)); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-15T11:53:02Z"), model.notAllowedTime().get(0).start()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-26T01:54:29Z"), model.notAllowedTime().get(0).end()); + Assertions.assertEquals(185109829, model.maintenanceWindow().schedule().daily().intervalDays()); + Assertions.assertEquals(988966310, model.maintenanceWindow().schedule().weekly().intervalWeeks()); + Assertions.assertEquals(WeekDay.TUESDAY, model.maintenanceWindow().schedule().weekly().dayOfWeek()); + Assertions.assertEquals(1432241544, model.maintenanceWindow().schedule().absoluteMonthly().intervalMonths()); + Assertions.assertEquals(1122267125, model.maintenanceWindow().schedule().absoluteMonthly().dayOfMonth()); + Assertions.assertEquals(1711524187, model.maintenanceWindow().schedule().relativeMonthly().intervalMonths()); + Assertions.assertEquals(Type.SECOND, model.maintenanceWindow().schedule().relativeMonthly().weekIndex()); + Assertions.assertEquals(WeekDay.FRIDAY, model.maintenanceWindow().schedule().relativeMonthly().dayOfWeek()); + Assertions.assertEquals(655143714, model.maintenanceWindow().durationHours()); + Assertions.assertEquals("lazszrn", model.maintenanceWindow().utcOffset()); + Assertions.assertEquals("iin", model.maintenanceWindow().startTime()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MaintenanceConfigurationInner model + = new MaintenanceConfigurationInner() + .withTimeInWeek(Arrays.asList( + new TimeInWeek().withDay(WeekDay.SATURDAY) + .withHourSlots(Arrays.asList(2086081346, 1051878092, 2049479560)), + new TimeInWeek().withDay(WeekDay.SUNDAY) + .withHourSlots(Arrays.asList(2016240775, 108512766, 1785480642)))) + .withNotAllowedTime(Arrays.asList( + new TimeSpan().withStart(OffsetDateTime.parse("2021-06-15T11:53:02Z")) + .withEnd(OffsetDateTime.parse("2021-11-26T01:54:29Z")), + new TimeSpan().withStart(OffsetDateTime.parse("2021-09-16T17:22:47Z")) + .withEnd(OffsetDateTime.parse("2021-09-13T10:29:44Z")))) + .withMaintenanceWindow( + new MaintenanceWindow() + .withSchedule(new Schedule().withDaily(new DailySchedule().withIntervalDays(185109829)) + .withWeekly( + new WeeklySchedule().withIntervalWeeks(988966310).withDayOfWeek(WeekDay.TUESDAY)) + .withAbsoluteMonthly( + new AbsoluteMonthlySchedule().withIntervalMonths(1432241544).withDayOfMonth(1122267125)) + .withRelativeMonthly(new RelativeMonthlySchedule().withIntervalMonths(1711524187) + .withWeekIndex(Type.SECOND) + .withDayOfWeek(WeekDay.FRIDAY))) + .withDurationHours(655143714) + .withUtcOffset("lazszrn") + .withStartTime("iin") + .withNotAllowedDates(Arrays.asList(new DateSpan()))); + model = BinaryData.fromObject(model).toObject(MaintenanceConfigurationInner.class); + Assertions.assertEquals(WeekDay.SATURDAY, model.timeInWeek().get(0).day()); + Assertions.assertEquals(2086081346, model.timeInWeek().get(0).hourSlots().get(0)); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-15T11:53:02Z"), model.notAllowedTime().get(0).start()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-26T01:54:29Z"), model.notAllowedTime().get(0).end()); + Assertions.assertEquals(185109829, model.maintenanceWindow().schedule().daily().intervalDays()); + Assertions.assertEquals(988966310, model.maintenanceWindow().schedule().weekly().intervalWeeks()); + Assertions.assertEquals(WeekDay.TUESDAY, model.maintenanceWindow().schedule().weekly().dayOfWeek()); + Assertions.assertEquals(1432241544, model.maintenanceWindow().schedule().absoluteMonthly().intervalMonths()); + Assertions.assertEquals(1122267125, model.maintenanceWindow().schedule().absoluteMonthly().dayOfMonth()); + Assertions.assertEquals(1711524187, model.maintenanceWindow().schedule().relativeMonthly().intervalMonths()); + Assertions.assertEquals(Type.SECOND, model.maintenanceWindow().schedule().relativeMonthly().weekIndex()); + Assertions.assertEquals(WeekDay.FRIDAY, model.maintenanceWindow().schedule().relativeMonthly().dayOfWeek()); + Assertions.assertEquals(655143714, model.maintenanceWindow().durationHours()); + Assertions.assertEquals("lazszrn", model.maintenanceWindow().utcOffset()); + Assertions.assertEquals("iin", model.maintenanceWindow().startTime()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationListResultTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationListResultTests.java new file mode 100644 index 000000000000..609a90a3e7ac --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationListResultTests.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.implementation.models.MaintenanceConfigurationListResult; +import com.azure.resourcemanager.containerservice.generated.models.Type; +import com.azure.resourcemanager.containerservice.generated.models.WeekDay; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class MaintenanceConfigurationListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MaintenanceConfigurationListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"timeInWeek\":[{\"day\":\"Monday\",\"hourSlots\":[1353261360]},{\"day\":\"Sunday\",\"hourSlots\":[1068554694,1206519159,84977587]}],\"notAllowedTime\":[{\"start\":\"2021-01-15T03:34:12Z\",\"end\":\"2021-01-15T03:57:36Z\"},{\"start\":\"2021-05-19T06:58:08Z\",\"end\":\"2021-08-16T19:44:14Z\"},{\"start\":\"2021-09-23T11:43:17Z\",\"end\":\"2021-06-05T19:52:45Z\"}],\"maintenanceWindow\":{\"schedule\":{\"daily\":{\"intervalDays\":647378344},\"weekly\":{\"intervalWeeks\":869640496,\"dayOfWeek\":\"Friday\"},\"absoluteMonthly\":{\"intervalMonths\":298074003,\"dayOfMonth\":1607958077},\"relativeMonthly\":{\"intervalMonths\":1469869368,\"weekIndex\":\"Fourth\",\"dayOfWeek\":\"Wednesday\"}},\"durationHours\":248286602,\"utcOffset\":\"qfhwyg\",\"startTime\":\"vdnkfxusem\",\"notAllowedDates\":[{},{},{},{}]}},\"id\":\"muhapfcqdpsqxqv\",\"name\":\"svuo\",\"type\":\"mgccelvezrypq\"},{\"properties\":{\"timeInWeek\":[{\"day\":\"Wednesday\",\"hourSlots\":[426790791,1007513685]},{\"day\":\"Tuesday\",\"hourSlots\":[359384916,1870547697,1045878267]},{\"day\":\"Thursday\",\"hourSlots\":[899879665,222452990,1041237961,540686876]},{\"day\":\"Thursday\",\"hourSlots\":[313036289,490524091]}],\"notAllowedTime\":[{\"start\":\"2021-08-09T01:15:02Z\",\"end\":\"2021-08-28T15:47:36Z\"}],\"maintenanceWindow\":{\"schedule\":{\"daily\":{\"intervalDays\":561719480},\"weekly\":{\"intervalWeeks\":1094493551,\"dayOfWeek\":\"Sunday\"},\"absoluteMonthly\":{\"intervalMonths\":922836414,\"dayOfMonth\":1775489060},\"relativeMonthly\":{\"intervalMonths\":16536699,\"weekIndex\":\"First\",\"dayOfWeek\":\"Thursday\"}},\"durationHours\":1000927704,\"utcOffset\":\"tn\",\"startTime\":\"tjsyin\",\"notAllowedDates\":[{}]}},\"id\":\"atmtdhtmdvy\",\"name\":\"gikdgsz\",\"type\":\"w\"},{\"properties\":{\"timeInWeek\":[{\"day\":\"Tuesday\",\"hourSlots\":[1689730147]},{\"day\":\"Monday\",\"hourSlots\":[904307607,1267831893,1964093020]},{\"day\":\"Saturday\",\"hourSlots\":[2015959117,54237508,2065168211,680417186]}],\"notAllowedTime\":[{\"start\":\"2021-03-11T10:48:23Z\",\"end\":\"2021-07-06T00:36:52Z\"}],\"maintenanceWindow\":{\"schedule\":{\"daily\":{\"intervalDays\":1392207805},\"weekly\":{\"intervalWeeks\":487870725,\"dayOfWeek\":\"Friday\"},\"absoluteMonthly\":{\"intervalMonths\":121941130,\"dayOfMonth\":918518964},\"relativeMonthly\":{\"intervalMonths\":2107533163,\"weekIndex\":\"First\",\"dayOfWeek\":\"Tuesday\"}},\"durationHours\":364570184,\"utcOffset\":\"rwxkvtkkgl\",\"startTime\":\"wjygvjayvblmhvk\",\"notAllowedDates\":[{},{},{},{}]}},\"id\":\"xvvy\",\"name\":\"gsopbyrqufegxu\",\"type\":\"wz\"},{\"properties\":{\"timeInWeek\":[{\"day\":\"Sunday\",\"hourSlots\":[171252991,25336970]},{\"day\":\"Thursday\",\"hourSlots\":[1116199441,1360421335,845127211,1613274561]},{\"day\":\"Thursday\",\"hourSlots\":[731430664,283160638,479082652,384819468]},{\"day\":\"Sunday\",\"hourSlots\":[2074654020,568576807,1102514107,1374422252]}],\"notAllowedTime\":[{\"start\":\"2021-09-18T06:49:11Z\",\"end\":\"2021-07-24T17:08:17Z\"},{\"start\":\"2020-12-21T03:38:52Z\",\"end\":\"2021-09-08T02:56:48Z\"},{\"start\":\"2021-07-11T23:25:50Z\",\"end\":\"2021-07-21T15:24:23Z\"},{\"start\":\"2021-08-31T06:18:37Z\",\"end\":\"2021-08-23T16:35:14Z\"}],\"maintenanceWindow\":{\"schedule\":{\"daily\":{\"intervalDays\":973361877},\"weekly\":{\"intervalWeeks\":1031923330,\"dayOfWeek\":\"Friday\"},\"absoluteMonthly\":{\"intervalMonths\":894068250,\"dayOfMonth\":1321945994},\"relativeMonthly\":{\"intervalMonths\":762768084,\"weekIndex\":\"Second\",\"dayOfWeek\":\"Friday\"}},\"durationHours\":1074007188,\"utcOffset\":\"tpwijnh\",\"startTime\":\"svfycxzbfv\",\"notAllowedDates\":[{},{}]}},\"id\":\"rvmtgjq\",\"name\":\"pyostronzmyhgfi\",\"type\":\"nsxkmcwaekrrjr\"}],\"nextLink\":\"fxtsgum\"}") + .toObject(MaintenanceConfigurationListResult.class); + Assertions.assertEquals(WeekDay.MONDAY, model.value().get(0).timeInWeek().get(0).day()); + Assertions.assertEquals(1353261360, model.value().get(0).timeInWeek().get(0).hourSlots().get(0)); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-15T03:34:12Z"), + model.value().get(0).notAllowedTime().get(0).start()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-15T03:57:36Z"), + model.value().get(0).notAllowedTime().get(0).end()); + Assertions.assertEquals(647378344, model.value().get(0).maintenanceWindow().schedule().daily().intervalDays()); + Assertions.assertEquals(869640496, + model.value().get(0).maintenanceWindow().schedule().weekly().intervalWeeks()); + Assertions.assertEquals(WeekDay.FRIDAY, + model.value().get(0).maintenanceWindow().schedule().weekly().dayOfWeek()); + Assertions.assertEquals(298074003, + model.value().get(0).maintenanceWindow().schedule().absoluteMonthly().intervalMonths()); + Assertions.assertEquals(1607958077, + model.value().get(0).maintenanceWindow().schedule().absoluteMonthly().dayOfMonth()); + Assertions.assertEquals(1469869368, + model.value().get(0).maintenanceWindow().schedule().relativeMonthly().intervalMonths()); + Assertions.assertEquals(Type.FOURTH, + model.value().get(0).maintenanceWindow().schedule().relativeMonthly().weekIndex()); + Assertions.assertEquals(WeekDay.WEDNESDAY, + model.value().get(0).maintenanceWindow().schedule().relativeMonthly().dayOfWeek()); + Assertions.assertEquals(248286602, model.value().get(0).maintenanceWindow().durationHours()); + Assertions.assertEquals("qfhwyg", model.value().get(0).maintenanceWindow().utcOffset()); + Assertions.assertEquals("vdnkfxusem", model.value().get(0).maintenanceWindow().startTime()); + Assertions.assertEquals("fxtsgum", model.nextLink()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationPropertiesTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationPropertiesTests.java new file mode 100644 index 000000000000..78005f24a2cb --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationPropertiesTests.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.fluent.models.MaintenanceConfigurationProperties; +import com.azure.resourcemanager.containerservice.generated.models.AbsoluteMonthlySchedule; +import com.azure.resourcemanager.containerservice.generated.models.DailySchedule; +import com.azure.resourcemanager.containerservice.generated.models.DateSpan; +import com.azure.resourcemanager.containerservice.generated.models.MaintenanceWindow; +import com.azure.resourcemanager.containerservice.generated.models.RelativeMonthlySchedule; +import com.azure.resourcemanager.containerservice.generated.models.Schedule; +import com.azure.resourcemanager.containerservice.generated.models.TimeInWeek; +import com.azure.resourcemanager.containerservice.generated.models.TimeSpan; +import com.azure.resourcemanager.containerservice.generated.models.Type; +import com.azure.resourcemanager.containerservice.generated.models.WeekDay; +import com.azure.resourcemanager.containerservice.generated.models.WeeklySchedule; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class MaintenanceConfigurationPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MaintenanceConfigurationProperties model = BinaryData.fromString( + "{\"timeInWeek\":[{\"day\":\"Saturday\",\"hourSlots\":[2030266414,1868624750,29574674]},{\"day\":\"Saturday\",\"hourSlots\":[312566317,943279998]}],\"notAllowedTime\":[{\"start\":\"2021-09-13T20:46:53Z\",\"end\":\"2021-09-01T07:33:06Z\"},{\"start\":\"2021-05-17T18:51:39Z\",\"end\":\"2021-03-07T21:36:25Z\"},{\"start\":\"2021-10-25T17:37:19Z\",\"end\":\"2021-01-05T15:59:38Z\"}],\"maintenanceWindow\":{\"schedule\":{\"daily\":{\"intervalDays\":1756672367},\"weekly\":{\"intervalWeeks\":401482588,\"dayOfWeek\":\"Thursday\"},\"absoluteMonthly\":{\"intervalMonths\":524245347,\"dayOfMonth\":42140994},\"relativeMonthly\":{\"intervalMonths\":763336670,\"weekIndex\":\"First\",\"dayOfWeek\":\"Tuesday\"}},\"durationHours\":477043409,\"utcOffset\":\"sowueluqhhahhx\",\"startTime\":\"hmzk\",\"notAllowedDates\":[{},{},{}]}}") + .toObject(MaintenanceConfigurationProperties.class); + Assertions.assertEquals(WeekDay.SATURDAY, model.timeInWeek().get(0).day()); + Assertions.assertEquals(2030266414, model.timeInWeek().get(0).hourSlots().get(0)); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-13T20:46:53Z"), model.notAllowedTime().get(0).start()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-01T07:33:06Z"), model.notAllowedTime().get(0).end()); + Assertions.assertEquals(1756672367, model.maintenanceWindow().schedule().daily().intervalDays()); + Assertions.assertEquals(401482588, model.maintenanceWindow().schedule().weekly().intervalWeeks()); + Assertions.assertEquals(WeekDay.THURSDAY, model.maintenanceWindow().schedule().weekly().dayOfWeek()); + Assertions.assertEquals(524245347, model.maintenanceWindow().schedule().absoluteMonthly().intervalMonths()); + Assertions.assertEquals(42140994, model.maintenanceWindow().schedule().absoluteMonthly().dayOfMonth()); + Assertions.assertEquals(763336670, model.maintenanceWindow().schedule().relativeMonthly().intervalMonths()); + Assertions.assertEquals(Type.FIRST, model.maintenanceWindow().schedule().relativeMonthly().weekIndex()); + Assertions.assertEquals(WeekDay.TUESDAY, model.maintenanceWindow().schedule().relativeMonthly().dayOfWeek()); + Assertions.assertEquals(477043409, model.maintenanceWindow().durationHours()); + Assertions.assertEquals("sowueluqhhahhx", model.maintenanceWindow().utcOffset()); + Assertions.assertEquals("hmzk", model.maintenanceWindow().startTime()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MaintenanceConfigurationProperties model + = new MaintenanceConfigurationProperties() + .withTimeInWeek(Arrays.asList( + new TimeInWeek().withDay(WeekDay.SATURDAY) + .withHourSlots(Arrays.asList(2030266414, 1868624750, 29574674)), + new TimeInWeek().withDay(WeekDay.SATURDAY).withHourSlots(Arrays.asList(312566317, 943279998)))) + .withNotAllowedTime(Arrays.asList( + new TimeSpan().withStart(OffsetDateTime.parse("2021-09-13T20:46:53Z")) + .withEnd(OffsetDateTime.parse("2021-09-01T07:33:06Z")), + new TimeSpan().withStart(OffsetDateTime.parse("2021-05-17T18:51:39Z")) + .withEnd(OffsetDateTime.parse("2021-03-07T21:36:25Z")), + new TimeSpan().withStart(OffsetDateTime.parse("2021-10-25T17:37:19Z")) + .withEnd(OffsetDateTime.parse("2021-01-05T15:59:38Z")))) + .withMaintenanceWindow( + new MaintenanceWindow() + .withSchedule(new Schedule().withDaily(new DailySchedule().withIntervalDays(1756672367)) + .withWeekly( + new WeeklySchedule().withIntervalWeeks(401482588).withDayOfWeek(WeekDay.THURSDAY)) + .withAbsoluteMonthly( + new AbsoluteMonthlySchedule().withIntervalMonths(524245347).withDayOfMonth(42140994)) + .withRelativeMonthly(new RelativeMonthlySchedule().withIntervalMonths(763336670) + .withWeekIndex(Type.FIRST) + .withDayOfWeek(WeekDay.TUESDAY))) + .withDurationHours(477043409) + .withUtcOffset("sowueluqhhahhx") + .withStartTime("hmzk") + .withNotAllowedDates(Arrays.asList(new DateSpan(), new DateSpan(), new DateSpan()))); + model = BinaryData.fromObject(model).toObject(MaintenanceConfigurationProperties.class); + Assertions.assertEquals(WeekDay.SATURDAY, model.timeInWeek().get(0).day()); + Assertions.assertEquals(2030266414, model.timeInWeek().get(0).hourSlots().get(0)); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-13T20:46:53Z"), model.notAllowedTime().get(0).start()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-01T07:33:06Z"), model.notAllowedTime().get(0).end()); + Assertions.assertEquals(1756672367, model.maintenanceWindow().schedule().daily().intervalDays()); + Assertions.assertEquals(401482588, model.maintenanceWindow().schedule().weekly().intervalWeeks()); + Assertions.assertEquals(WeekDay.THURSDAY, model.maintenanceWindow().schedule().weekly().dayOfWeek()); + Assertions.assertEquals(524245347, model.maintenanceWindow().schedule().absoluteMonthly().intervalMonths()); + Assertions.assertEquals(42140994, model.maintenanceWindow().schedule().absoluteMonthly().dayOfMonth()); + Assertions.assertEquals(763336670, model.maintenanceWindow().schedule().relativeMonthly().intervalMonths()); + Assertions.assertEquals(Type.FIRST, model.maintenanceWindow().schedule().relativeMonthly().weekIndex()); + Assertions.assertEquals(WeekDay.TUESDAY, model.maintenanceWindow().schedule().relativeMonthly().dayOfWeek()); + Assertions.assertEquals(477043409, model.maintenanceWindow().durationHours()); + Assertions.assertEquals("sowueluqhhahhx", model.maintenanceWindow().utcOffset()); + Assertions.assertEquals("hmzk", model.maintenanceWindow().startTime()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationsCreateOrUpdateWithResponseMockTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationsCreateOrUpdateWithResponseMockTests.java new file mode 100644 index 000000000000..5dd78a75d020 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationsCreateOrUpdateWithResponseMockTests.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.containerservice.generated.ContainerServiceManager; +import com.azure.resourcemanager.containerservice.generated.models.AbsoluteMonthlySchedule; +import com.azure.resourcemanager.containerservice.generated.models.DailySchedule; +import com.azure.resourcemanager.containerservice.generated.models.DateSpan; +import com.azure.resourcemanager.containerservice.generated.models.MaintenanceConfiguration; +import com.azure.resourcemanager.containerservice.generated.models.MaintenanceWindow; +import com.azure.resourcemanager.containerservice.generated.models.RelativeMonthlySchedule; +import com.azure.resourcemanager.containerservice.generated.models.Schedule; +import com.azure.resourcemanager.containerservice.generated.models.TimeInWeek; +import com.azure.resourcemanager.containerservice.generated.models.TimeSpan; +import com.azure.resourcemanager.containerservice.generated.models.Type; +import com.azure.resourcemanager.containerservice.generated.models.WeekDay; +import com.azure.resourcemanager.containerservice.generated.models.WeeklySchedule; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class MaintenanceConfigurationsCreateOrUpdateWithResponseMockTests { + @Test + public void testCreateOrUpdateWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"timeInWeek\":[{\"day\":\"Wednesday\",\"hourSlots\":[1096789874,1338439395,1059489407,955344780]},{\"day\":\"Monday\",\"hourSlots\":[1052873212,1559597250,1582916728,578758071]},{\"day\":\"Monday\",\"hourSlots\":[150383679,521294772]},{\"day\":\"Wednesday\",\"hourSlots\":[1041266491,816519573,81881982]}],\"notAllowedTime\":[{\"start\":\"2021-01-01T22:57:53Z\",\"end\":\"2021-04-27T14:09:03Z\"}],\"maintenanceWindow\":{\"schedule\":{\"daily\":{\"intervalDays\":1389777641},\"weekly\":{\"intervalWeeks\":311832546,\"dayOfWeek\":\"Wednesday\"},\"absoluteMonthly\":{\"intervalMonths\":594488875,\"dayOfMonth\":796493990},\"relativeMonthly\":{\"intervalMonths\":144887508,\"weekIndex\":\"Last\",\"dayOfWeek\":\"Sunday\"}},\"durationHours\":1342979435,\"utcOffset\":\"df\",\"startTime\":\"yogtieyujtvczkcn\",\"notAllowedDates\":[{},{},{}]}},\"id\":\"munjdxvglnkvx\",\"name\":\"xpaglqivbgkc\",\"type\":\"khpzvuqdflv\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ContainerServiceManager manager = ContainerServiceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + MaintenanceConfiguration response + = manager.maintenanceConfigurations() + .define("qaclnapxbiy") + .withExistingManagedCluster("rgxffmshkw", "bkgozxwopdbydpi") + .withTimeInWeek(Arrays.asList(new TimeInWeek().withDay(WeekDay.SATURDAY) + .withHourSlots(Arrays.asList(1701530674, 1734135140, 1087326396, 1684781811)))) + .withNotAllowedTime(Arrays.asList( + new TimeSpan().withStart(OffsetDateTime.parse("2021-07-24T11:33:54Z")) + .withEnd(OffsetDateTime.parse("2021-08-23T00:10Z")), + new TimeSpan().withStart(OffsetDateTime.parse("2021-04-12T22:42:56Z")) + .withEnd(OffsetDateTime.parse("2021-10-26T11:31:47Z")), + new TimeSpan().withStart(OffsetDateTime.parse("2021-03-08T18:22:09Z")) + .withEnd(OffsetDateTime.parse("2021-01-25T18:03:32Z")))) + .withMaintenanceWindow( + new MaintenanceWindow() + .withSchedule(new Schedule().withDaily(new DailySchedule().withIntervalDays(1624648913)) + .withWeekly( + new WeeklySchedule().withIntervalWeeks(1236082259).withDayOfWeek(WeekDay.MONDAY)) + .withAbsoluteMonthly( + new AbsoluteMonthlySchedule().withIntervalMonths(2121197417).withDayOfMonth(340863806)) + .withRelativeMonthly(new RelativeMonthlySchedule().withIntervalMonths(2121804794) + .withWeekIndex(Type.FOURTH) + .withDayOfWeek(WeekDay.THURSDAY))) + .withDurationHours(1348933129) + .withUtcOffset("ztczytq") + .withStartTime("w") + .withNotAllowedDates( + Arrays.asList(new DateSpan(), new DateSpan(), new DateSpan(), new DateSpan()))) + .create(); + + Assertions.assertEquals(WeekDay.WEDNESDAY, response.timeInWeek().get(0).day()); + Assertions.assertEquals(1096789874, response.timeInWeek().get(0).hourSlots().get(0)); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-01T22:57:53Z"), response.notAllowedTime().get(0).start()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-27T14:09:03Z"), response.notAllowedTime().get(0).end()); + Assertions.assertEquals(1389777641, response.maintenanceWindow().schedule().daily().intervalDays()); + Assertions.assertEquals(311832546, response.maintenanceWindow().schedule().weekly().intervalWeeks()); + Assertions.assertEquals(WeekDay.WEDNESDAY, response.maintenanceWindow().schedule().weekly().dayOfWeek()); + Assertions.assertEquals(594488875, response.maintenanceWindow().schedule().absoluteMonthly().intervalMonths()); + Assertions.assertEquals(796493990, response.maintenanceWindow().schedule().absoluteMonthly().dayOfMonth()); + Assertions.assertEquals(144887508, response.maintenanceWindow().schedule().relativeMonthly().intervalMonths()); + Assertions.assertEquals(Type.LAST, response.maintenanceWindow().schedule().relativeMonthly().weekIndex()); + Assertions.assertEquals(WeekDay.SUNDAY, response.maintenanceWindow().schedule().relativeMonthly().dayOfWeek()); + Assertions.assertEquals(1342979435, response.maintenanceWindow().durationHours()); + Assertions.assertEquals("df", response.maintenanceWindow().utcOffset()); + Assertions.assertEquals("yogtieyujtvczkcn", response.maintenanceWindow().startTime()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationsDeleteWithResponseMockTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationsDeleteWithResponseMockTests.java new file mode 100644 index 000000000000..2ff2910d90f3 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationsDeleteWithResponseMockTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.containerservice.generated.ContainerServiceManager; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class MaintenanceConfigurationsDeleteWithResponseMockTests { + @Test + public void testDeleteWithResponse() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ContainerServiceManager manager = ContainerServiceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.maintenanceConfigurations().deleteWithResponse("kqbh", "y", "qunjqh", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationsGetWithResponseMockTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationsGetWithResponseMockTests.java new file mode 100644 index 000000000000..c30ce79a0dda --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationsGetWithResponseMockTests.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.containerservice.generated.ContainerServiceManager; +import com.azure.resourcemanager.containerservice.generated.models.MaintenanceConfiguration; +import com.azure.resourcemanager.containerservice.generated.models.Type; +import com.azure.resourcemanager.containerservice.generated.models.WeekDay; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class MaintenanceConfigurationsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"timeInWeek\":[{\"day\":\"Monday\",\"hourSlots\":[604410280,1025410232,418171935,1977430236]}],\"notAllowedTime\":[{\"start\":\"2021-06-30T22:23:34Z\",\"end\":\"2021-07-19T16:44:26Z\"},{\"start\":\"2021-09-18T03:10:41Z\",\"end\":\"2021-10-11T06:17:10Z\"}],\"maintenanceWindow\":{\"schedule\":{\"daily\":{\"intervalDays\":1238184742},\"weekly\":{\"intervalWeeks\":1962331095,\"dayOfWeek\":\"Saturday\"},\"absoluteMonthly\":{\"intervalMonths\":1579880352,\"dayOfMonth\":1797453594},\"relativeMonthly\":{\"intervalMonths\":104465798,\"weekIndex\":\"Third\",\"dayOfWeek\":\"Monday\"}},\"durationHours\":2093406085,\"utcOffset\":\"qavbpdqmj\",\"startTime\":\"yyzglgouwtlmjjy\",\"notAllowedDates\":[{}]}},\"id\":\"tob\",\"name\":\"xkjeytunlbfj\",\"type\":\"wrus\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ContainerServiceManager manager = ContainerServiceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + MaintenanceConfiguration response = manager.maintenanceConfigurations() + .getWithResponse("dl", "rtltla", "rltzkatbhjmz", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(WeekDay.MONDAY, response.timeInWeek().get(0).day()); + Assertions.assertEquals(604410280, response.timeInWeek().get(0).hourSlots().get(0)); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-30T22:23:34Z"), response.notAllowedTime().get(0).start()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-19T16:44:26Z"), response.notAllowedTime().get(0).end()); + Assertions.assertEquals(1238184742, response.maintenanceWindow().schedule().daily().intervalDays()); + Assertions.assertEquals(1962331095, response.maintenanceWindow().schedule().weekly().intervalWeeks()); + Assertions.assertEquals(WeekDay.SATURDAY, response.maintenanceWindow().schedule().weekly().dayOfWeek()); + Assertions.assertEquals(1579880352, response.maintenanceWindow().schedule().absoluteMonthly().intervalMonths()); + Assertions.assertEquals(1797453594, response.maintenanceWindow().schedule().absoluteMonthly().dayOfMonth()); + Assertions.assertEquals(104465798, response.maintenanceWindow().schedule().relativeMonthly().intervalMonths()); + Assertions.assertEquals(Type.THIRD, response.maintenanceWindow().schedule().relativeMonthly().weekIndex()); + Assertions.assertEquals(WeekDay.MONDAY, response.maintenanceWindow().schedule().relativeMonthly().dayOfWeek()); + Assertions.assertEquals(2093406085, response.maintenanceWindow().durationHours()); + Assertions.assertEquals("qavbpdqmj", response.maintenanceWindow().utcOffset()); + Assertions.assertEquals("yyzglgouwtlmjjy", response.maintenanceWindow().startTime()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationsListByManagedClusterMockTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationsListByManagedClusterMockTests.java new file mode 100644 index 000000000000..a07bf404c3f0 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationsListByManagedClusterMockTests.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.containerservice.generated.ContainerServiceManager; +import com.azure.resourcemanager.containerservice.generated.models.MaintenanceConfiguration; +import com.azure.resourcemanager.containerservice.generated.models.Type; +import com.azure.resourcemanager.containerservice.generated.models.WeekDay; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class MaintenanceConfigurationsListByManagedClusterMockTests { + @Test + public void testListByManagedCluster() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"timeInWeek\":[{\"day\":\"Saturday\",\"hourSlots\":[641557673,827393653,1518626631,1404605261]},{\"day\":\"Saturday\",\"hourSlots\":[1193273500,338982677,241203841,1757872302]}],\"notAllowedTime\":[{\"start\":\"2021-08-02T05:31:30Z\",\"end\":\"2021-04-14T15:49:08Z\"},{\"start\":\"2021-01-02T05:26:14Z\",\"end\":\"2021-01-19T23:32:47Z\"},{\"start\":\"2021-07-25T05:46:11Z\",\"end\":\"2021-10-24T15:23:04Z\"}],\"maintenanceWindow\":{\"schedule\":{\"daily\":{\"intervalDays\":351115849},\"weekly\":{\"intervalWeeks\":1258635298,\"dayOfWeek\":\"Saturday\"},\"absoluteMonthly\":{\"intervalMonths\":1542191041,\"dayOfMonth\":1682370359},\"relativeMonthly\":{\"intervalMonths\":254570862,\"weekIndex\":\"First\",\"dayOfWeek\":\"Sunday\"}},\"durationHours\":47933696,\"utcOffset\":\"qxpxiwfcngjsaa\",\"startTime\":\"ixtmkzjvkviirhgf\",\"notAllowedDates\":[{},{},{}]}},\"id\":\"dpgra\",\"name\":\"zvzbglbyv\",\"type\":\"ctctbrxkjz\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ContainerServiceManager manager = ContainerServiceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.maintenanceConfigurations() + .listByManagedCluster("enx", "ulkpakd", com.azure.core.util.Context.NONE); + + Assertions.assertEquals(WeekDay.SATURDAY, response.iterator().next().timeInWeek().get(0).day()); + Assertions.assertEquals(641557673, response.iterator().next().timeInWeek().get(0).hourSlots().get(0)); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-02T05:31:30Z"), + response.iterator().next().notAllowedTime().get(0).start()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-14T15:49:08Z"), + response.iterator().next().notAllowedTime().get(0).end()); + Assertions.assertEquals(351115849, + response.iterator().next().maintenanceWindow().schedule().daily().intervalDays()); + Assertions.assertEquals(1258635298, + response.iterator().next().maintenanceWindow().schedule().weekly().intervalWeeks()); + Assertions.assertEquals(WeekDay.SATURDAY, + response.iterator().next().maintenanceWindow().schedule().weekly().dayOfWeek()); + Assertions.assertEquals(1542191041, + response.iterator().next().maintenanceWindow().schedule().absoluteMonthly().intervalMonths()); + Assertions.assertEquals(1682370359, + response.iterator().next().maintenanceWindow().schedule().absoluteMonthly().dayOfMonth()); + Assertions.assertEquals(254570862, + response.iterator().next().maintenanceWindow().schedule().relativeMonthly().intervalMonths()); + Assertions.assertEquals(Type.FIRST, + response.iterator().next().maintenanceWindow().schedule().relativeMonthly().weekIndex()); + Assertions.assertEquals(WeekDay.SUNDAY, + response.iterator().next().maintenanceWindow().schedule().relativeMonthly().dayOfWeek()); + Assertions.assertEquals(47933696, response.iterator().next().maintenanceWindow().durationHours()); + Assertions.assertEquals("qxpxiwfcngjsaa", response.iterator().next().maintenanceWindow().utcOffset()); + Assertions.assertEquals("ixtmkzjvkviirhgf", response.iterator().next().maintenanceWindow().startTime()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceWindowTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceWindowTests.java new file mode 100644 index 000000000000..a269fc0b531f --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceWindowTests.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.AbsoluteMonthlySchedule; +import com.azure.resourcemanager.containerservice.generated.models.DailySchedule; +import com.azure.resourcemanager.containerservice.generated.models.DateSpan; +import com.azure.resourcemanager.containerservice.generated.models.MaintenanceWindow; +import com.azure.resourcemanager.containerservice.generated.models.RelativeMonthlySchedule; +import com.azure.resourcemanager.containerservice.generated.models.Schedule; +import com.azure.resourcemanager.containerservice.generated.models.Type; +import com.azure.resourcemanager.containerservice.generated.models.WeekDay; +import com.azure.resourcemanager.containerservice.generated.models.WeeklySchedule; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class MaintenanceWindowTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MaintenanceWindow model = BinaryData.fromString( + "{\"schedule\":{\"daily\":{\"intervalDays\":1898497705},\"weekly\":{\"intervalWeeks\":757221546,\"dayOfWeek\":\"Saturday\"},\"absoluteMonthly\":{\"intervalMonths\":184918697,\"dayOfMonth\":318834407},\"relativeMonthly\":{\"intervalMonths\":649615996,\"weekIndex\":\"Second\",\"dayOfWeek\":\"Saturday\"}},\"durationHours\":1615725858,\"utcOffset\":\"igrjguufzdm\",\"startTime\":\"qtfihwhbotzinga\",\"notAllowedDates\":[{}]}") + .toObject(MaintenanceWindow.class); + Assertions.assertEquals(1898497705, model.schedule().daily().intervalDays()); + Assertions.assertEquals(757221546, model.schedule().weekly().intervalWeeks()); + Assertions.assertEquals(WeekDay.SATURDAY, model.schedule().weekly().dayOfWeek()); + Assertions.assertEquals(184918697, model.schedule().absoluteMonthly().intervalMonths()); + Assertions.assertEquals(318834407, model.schedule().absoluteMonthly().dayOfMonth()); + Assertions.assertEquals(649615996, model.schedule().relativeMonthly().intervalMonths()); + Assertions.assertEquals(Type.SECOND, model.schedule().relativeMonthly().weekIndex()); + Assertions.assertEquals(WeekDay.SATURDAY, model.schedule().relativeMonthly().dayOfWeek()); + Assertions.assertEquals(1615725858, model.durationHours()); + Assertions.assertEquals("igrjguufzdm", model.utcOffset()); + Assertions.assertEquals("qtfihwhbotzinga", model.startTime()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MaintenanceWindow model = new MaintenanceWindow() + .withSchedule(new Schedule().withDaily(new DailySchedule().withIntervalDays(1898497705)) + .withWeekly(new WeeklySchedule().withIntervalWeeks(757221546).withDayOfWeek(WeekDay.SATURDAY)) + .withAbsoluteMonthly( + new AbsoluteMonthlySchedule().withIntervalMonths(184918697).withDayOfMonth(318834407)) + .withRelativeMonthly(new RelativeMonthlySchedule().withIntervalMonths(649615996) + .withWeekIndex(Type.SECOND) + .withDayOfWeek(WeekDay.SATURDAY))) + .withDurationHours(1615725858) + .withUtcOffset("igrjguufzdm") + .withStartTime("qtfihwhbotzinga") + .withNotAllowedDates(Arrays.asList(new DateSpan())); + model = BinaryData.fromObject(model).toObject(MaintenanceWindow.class); + Assertions.assertEquals(1898497705, model.schedule().daily().intervalDays()); + Assertions.assertEquals(757221546, model.schedule().weekly().intervalWeeks()); + Assertions.assertEquals(WeekDay.SATURDAY, model.schedule().weekly().dayOfWeek()); + Assertions.assertEquals(184918697, model.schedule().absoluteMonthly().intervalMonths()); + Assertions.assertEquals(318834407, model.schedule().absoluteMonthly().dayOfMonth()); + Assertions.assertEquals(649615996, model.schedule().relativeMonthly().intervalMonths()); + Assertions.assertEquals(Type.SECOND, model.schedule().relativeMonthly().weekIndex()); + Assertions.assertEquals(WeekDay.SATURDAY, model.schedule().relativeMonthly().dayOfWeek()); + Assertions.assertEquals(1615725858, model.durationHours()); + Assertions.assertEquals("igrjguufzdm", model.utcOffset()); + Assertions.assertEquals("qtfihwhbotzinga", model.startTime()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterAIToolchainOperatorProfileTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterAIToolchainOperatorProfileTests.java new file mode 100644 index 000000000000..a531d3dab5f9 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterAIToolchainOperatorProfileTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAIToolchainOperatorProfile; +import org.junit.jupiter.api.Assertions; + +public final class ManagedClusterAIToolchainOperatorProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedClusterAIToolchainOperatorProfile model + = BinaryData.fromString("{\"enabled\":false}").toObject(ManagedClusterAIToolchainOperatorProfile.class); + Assertions.assertFalse(model.enabled()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedClusterAIToolchainOperatorProfile model + = new ManagedClusterAIToolchainOperatorProfile().withEnabled(false); + model = BinaryData.fromObject(model).toObject(ManagedClusterAIToolchainOperatorProfile.class); + Assertions.assertFalse(model.enabled()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterAccessProfileInnerTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterAccessProfileInnerTests.java new file mode 100644 index 000000000000..92401ebd8c20 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterAccessProfileInnerTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterAccessProfileInner; +import org.junit.jupiter.api.Assertions; + +public final class ManagedClusterAccessProfileInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedClusterAccessProfileInner model = BinaryData.fromString( + "{\"properties\":{},\"location\":\"uvriuhprwm\",\"tags\":{\"qbex\":\"xqtayriwwro\",\"nmefqsgzvahapj\":\"mcqibycnojv\",\"zlmwlxkvugfhz\":\"zhpvgqzcjrvxd\",\"hnnpr\":\"vawjvzunlu\"},\"id\":\"xipeilpjzuaejx\",\"name\":\"ultskzbbtdz\",\"type\":\"mv\"}") + .toObject(ManagedClusterAccessProfileInner.class); + Assertions.assertEquals("uvriuhprwm", model.location()); + Assertions.assertEquals("xqtayriwwro", model.tags().get("qbex")); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterAddonProfileIdentityTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterAddonProfileIdentityTests.java new file mode 100644 index 000000000000..ff5c82f1694c --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterAddonProfileIdentityTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAddonProfileIdentity; +import org.junit.jupiter.api.Assertions; + +public final class ManagedClusterAddonProfileIdentityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedClusterAddonProfileIdentity model + = BinaryData.fromString("{\"resourceId\":\"uigdtopbobjog\",\"clientId\":\"e\",\"objectId\":\"a\"}") + .toObject(ManagedClusterAddonProfileIdentity.class); + Assertions.assertEquals("uigdtopbobjog", model.resourceId()); + Assertions.assertEquals("e", model.clientId()); + Assertions.assertEquals("a", model.objectId()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterAddonProfileTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterAddonProfileTests.java new file mode 100644 index 000000000000..da4f96d04f37 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterAddonProfileTests.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAddonProfile; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class ManagedClusterAddonProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedClusterAddonProfile model = BinaryData.fromString( + "{\"enabled\":false,\"config\":{\"vuhrhcffcyddgl\":\"deicbtwnpzao\"},\"identity\":{\"resourceId\":\"hjq\",\"clientId\":\"pyeicxm\",\"objectId\":\"iwqvhkh\"}}") + .toObject(ManagedClusterAddonProfile.class); + Assertions.assertFalse(model.enabled()); + Assertions.assertEquals("deicbtwnpzao", model.config().get("vuhrhcffcyddgl")); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedClusterAddonProfile model + = new ManagedClusterAddonProfile().withEnabled(false).withConfig(mapOf("vuhrhcffcyddgl", "deicbtwnpzao")); + model = BinaryData.fromObject(model).toObject(ManagedClusterAddonProfile.class); + Assertions.assertFalse(model.enabled()); + Assertions.assertEquals("deicbtwnpzao", model.config().get("vuhrhcffcyddgl")); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterApiServerAccessProfileTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterApiServerAccessProfileTests.java new file mode 100644 index 000000000000..e0c842af1ab2 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterApiServerAccessProfileTests.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterApiServerAccessProfile; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ManagedClusterApiServerAccessProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedClusterApiServerAccessProfile model = BinaryData.fromString( + "{\"authorizedIPRanges\":[\"kbeype\",\"rmjmwvvjektc\"],\"enablePrivateCluster\":false,\"privateDNSZone\":\"hwlrsf\",\"enablePrivateClusterPublicFQDN\":false,\"disableRunCommand\":false,\"enableVnetIntegration\":true,\"subnetId\":\"dqgbiqylihkaetc\"}") + .toObject(ManagedClusterApiServerAccessProfile.class); + Assertions.assertEquals("kbeype", model.authorizedIPRanges().get(0)); + Assertions.assertFalse(model.enablePrivateCluster()); + Assertions.assertEquals("hwlrsf", model.privateDNSZone()); + Assertions.assertFalse(model.enablePrivateClusterPublicFQDN()); + Assertions.assertFalse(model.disableRunCommand()); + Assertions.assertTrue(model.enableVnetIntegration()); + Assertions.assertEquals("dqgbiqylihkaetc", model.subnetId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedClusterApiServerAccessProfile model + = new ManagedClusterApiServerAccessProfile().withAuthorizedIPRanges(Arrays.asList("kbeype", "rmjmwvvjektc")) + .withEnablePrivateCluster(false) + .withPrivateDNSZone("hwlrsf") + .withEnablePrivateClusterPublicFQDN(false) + .withDisableRunCommand(false) + .withEnableVnetIntegration(true) + .withSubnetId("dqgbiqylihkaetc"); + model = BinaryData.fromObject(model).toObject(ManagedClusterApiServerAccessProfile.class); + Assertions.assertEquals("kbeype", model.authorizedIPRanges().get(0)); + Assertions.assertFalse(model.enablePrivateCluster()); + Assertions.assertEquals("hwlrsf", model.privateDNSZone()); + Assertions.assertFalse(model.enablePrivateClusterPublicFQDN()); + Assertions.assertFalse(model.disableRunCommand()); + Assertions.assertTrue(model.enableVnetIntegration()); + Assertions.assertEquals("dqgbiqylihkaetc", model.subnetId()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterAutoUpgradeProfileTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterAutoUpgradeProfileTests.java new file mode 100644 index 000000000000..a56c5c155266 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterAutoUpgradeProfileTests.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAutoUpgradeProfile; +import com.azure.resourcemanager.containerservice.generated.models.NodeOSUpgradeChannel; +import com.azure.resourcemanager.containerservice.generated.models.UpgradeChannel; +import org.junit.jupiter.api.Assertions; + +public final class ManagedClusterAutoUpgradeProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedClusterAutoUpgradeProfile model + = BinaryData.fromString("{\"upgradeChannel\":\"rapid\",\"nodeOSUpgradeChannel\":\"NodeImage\"}") + .toObject(ManagedClusterAutoUpgradeProfile.class); + Assertions.assertEquals(UpgradeChannel.RAPID, model.upgradeChannel()); + Assertions.assertEquals(NodeOSUpgradeChannel.NODE_IMAGE, model.nodeOSUpgradeChannel()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedClusterAutoUpgradeProfile model + = new ManagedClusterAutoUpgradeProfile().withUpgradeChannel(UpgradeChannel.RAPID) + .withNodeOSUpgradeChannel(NodeOSUpgradeChannel.NODE_IMAGE); + model = BinaryData.fromObject(model).toObject(ManagedClusterAutoUpgradeProfile.class); + Assertions.assertEquals(UpgradeChannel.RAPID, model.upgradeChannel()); + Assertions.assertEquals(NodeOSUpgradeChannel.NODE_IMAGE, model.nodeOSUpgradeChannel()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterAzureMonitorProfileKubeStateMetricsTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterAzureMonitorProfileKubeStateMetricsTests.java new file mode 100644 index 000000000000..264c5c41dede --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterAzureMonitorProfileKubeStateMetricsTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAzureMonitorProfileKubeStateMetrics; +import org.junit.jupiter.api.Assertions; + +public final class ManagedClusterAzureMonitorProfileKubeStateMetricsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedClusterAzureMonitorProfileKubeStateMetrics model = BinaryData + .fromString("{\"metricLabelsAllowlist\":\"d\",\"metricAnnotationsAllowList\":\"avxbniwdjswztsdb\"}") + .toObject(ManagedClusterAzureMonitorProfileKubeStateMetrics.class); + Assertions.assertEquals("d", model.metricLabelsAllowlist()); + Assertions.assertEquals("avxbniwdjswztsdb", model.metricAnnotationsAllowList()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedClusterAzureMonitorProfileKubeStateMetrics model + = new ManagedClusterAzureMonitorProfileKubeStateMetrics().withMetricLabelsAllowlist("d") + .withMetricAnnotationsAllowList("avxbniwdjswztsdb"); + model = BinaryData.fromObject(model).toObject(ManagedClusterAzureMonitorProfileKubeStateMetrics.class); + Assertions.assertEquals("d", model.metricLabelsAllowlist()); + Assertions.assertEquals("avxbniwdjswztsdb", model.metricAnnotationsAllowList()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterAzureMonitorProfileMetricsTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterAzureMonitorProfileMetricsTests.java new file mode 100644 index 000000000000..207775725da0 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterAzureMonitorProfileMetricsTests.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAzureMonitorProfileKubeStateMetrics; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAzureMonitorProfileMetrics; +import org.junit.jupiter.api.Assertions; + +public final class ManagedClusterAzureMonitorProfileMetricsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedClusterAzureMonitorProfileMetrics model = BinaryData.fromString( + "{\"enabled\":false,\"kubeStateMetrics\":{\"metricLabelsAllowlist\":\"almuzyoxaepdkzja\",\"metricAnnotationsAllowList\":\"ux\"}}") + .toObject(ManagedClusterAzureMonitorProfileMetrics.class); + Assertions.assertFalse(model.enabled()); + Assertions.assertEquals("almuzyoxaepdkzja", model.kubeStateMetrics().metricLabelsAllowlist()); + Assertions.assertEquals("ux", model.kubeStateMetrics().metricAnnotationsAllowList()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedClusterAzureMonitorProfileMetrics model + = new ManagedClusterAzureMonitorProfileMetrics().withEnabled(false) + .withKubeStateMetrics(new ManagedClusterAzureMonitorProfileKubeStateMetrics() + .withMetricLabelsAllowlist("almuzyoxaepdkzja") + .withMetricAnnotationsAllowList("ux")); + model = BinaryData.fromObject(model).toObject(ManagedClusterAzureMonitorProfileMetrics.class); + Assertions.assertFalse(model.enabled()); + Assertions.assertEquals("almuzyoxaepdkzja", model.kubeStateMetrics().metricLabelsAllowlist()); + Assertions.assertEquals("ux", model.kubeStateMetrics().metricAnnotationsAllowList()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterAzureMonitorProfileTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterAzureMonitorProfileTests.java new file mode 100644 index 000000000000..68dc56c4c6ab --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterAzureMonitorProfileTests.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAzureMonitorProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAzureMonitorProfileKubeStateMetrics; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAzureMonitorProfileMetrics; +import org.junit.jupiter.api.Assertions; + +public final class ManagedClusterAzureMonitorProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedClusterAzureMonitorProfile model = BinaryData.fromString( + "{\"metrics\":{\"enabled\":false,\"kubeStateMetrics\":{\"metricLabelsAllowlist\":\"wbiexzfey\",\"metricAnnotationsAllowList\":\"axibxujw\"}}}") + .toObject(ManagedClusterAzureMonitorProfile.class); + Assertions.assertFalse(model.metrics().enabled()); + Assertions.assertEquals("wbiexzfey", model.metrics().kubeStateMetrics().metricLabelsAllowlist()); + Assertions.assertEquals("axibxujw", model.metrics().kubeStateMetrics().metricAnnotationsAllowList()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedClusterAzureMonitorProfile model + = new ManagedClusterAzureMonitorProfile() + .withMetrics( + new ManagedClusterAzureMonitorProfileMetrics().withEnabled(false) + .withKubeStateMetrics(new ManagedClusterAzureMonitorProfileKubeStateMetrics() + .withMetricLabelsAllowlist("wbiexzfey") + .withMetricAnnotationsAllowList("axibxujw"))); + model = BinaryData.fromObject(model).toObject(ManagedClusterAzureMonitorProfile.class); + Assertions.assertFalse(model.metrics().enabled()); + Assertions.assertEquals("wbiexzfey", model.metrics().kubeStateMetrics().metricLabelsAllowlist()); + Assertions.assertEquals("axibxujw", model.metrics().kubeStateMetrics().metricAnnotationsAllowList()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterBootstrapProfileTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterBootstrapProfileTests.java new file mode 100644 index 000000000000..1e237258aa6f --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterBootstrapProfileTests.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ArtifactSource; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterBootstrapProfile; +import org.junit.jupiter.api.Assertions; + +public final class ManagedClusterBootstrapProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedClusterBootstrapProfile model + = BinaryData.fromString("{\"artifactSource\":\"Direct\",\"containerRegistryId\":\"ef\"}") + .toObject(ManagedClusterBootstrapProfile.class); + Assertions.assertEquals(ArtifactSource.DIRECT, model.artifactSource()); + Assertions.assertEquals("ef", model.containerRegistryId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedClusterBootstrapProfile model + = new ManagedClusterBootstrapProfile().withArtifactSource(ArtifactSource.DIRECT) + .withContainerRegistryId("ef"); + model = BinaryData.fromObject(model).toObject(ManagedClusterBootstrapProfile.class); + Assertions.assertEquals(ArtifactSource.DIRECT, model.artifactSource()); + Assertions.assertEquals("ef", model.containerRegistryId()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterCostAnalysisTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterCostAnalysisTests.java new file mode 100644 index 000000000000..933b8275d20b --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterCostAnalysisTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterCostAnalysis; +import org.junit.jupiter.api.Assertions; + +public final class ManagedClusterCostAnalysisTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedClusterCostAnalysis model + = BinaryData.fromString("{\"enabled\":false}").toObject(ManagedClusterCostAnalysis.class); + Assertions.assertFalse(model.enabled()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedClusterCostAnalysis model = new ManagedClusterCostAnalysis().withEnabled(false); + model = BinaryData.fromObject(model).toObject(ManagedClusterCostAnalysis.class); + Assertions.assertFalse(model.enabled()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterHttpProxyConfigTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterHttpProxyConfigTests.java new file mode 100644 index 000000000000..d740dcbfe260 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterHttpProxyConfigTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterHttpProxyConfig; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ManagedClusterHttpProxyConfigTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedClusterHttpProxyConfig model = BinaryData.fromString( + "{\"httpProxy\":\"sncghkjeszz\",\"httpsProxy\":\"ijhtxf\",\"noProxy\":[\"bfs\"],\"trustedCa\":\"nehmpvecx\",\"enabled\":true}") + .toObject(ManagedClusterHttpProxyConfig.class); + Assertions.assertEquals("sncghkjeszz", model.httpProxy()); + Assertions.assertEquals("ijhtxf", model.httpsProxy()); + Assertions.assertEquals("bfs", model.noProxy().get(0)); + Assertions.assertEquals("nehmpvecx", model.trustedCa()); + Assertions.assertTrue(model.enabled()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedClusterHttpProxyConfig model = new ManagedClusterHttpProxyConfig().withHttpProxy("sncghkjeszz") + .withHttpsProxy("ijhtxf") + .withNoProxy(Arrays.asList("bfs")) + .withTrustedCa("nehmpvecx") + .withEnabled(true); + model = BinaryData.fromObject(model).toObject(ManagedClusterHttpProxyConfig.class); + Assertions.assertEquals("sncghkjeszz", model.httpProxy()); + Assertions.assertEquals("ijhtxf", model.httpsProxy()); + Assertions.assertEquals("bfs", model.noProxy().get(0)); + Assertions.assertEquals("nehmpvecx", model.trustedCa()); + Assertions.assertTrue(model.enabled()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterIdentityTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterIdentityTests.java new file mode 100644 index 000000000000..12f6cee2985d --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterIdentityTests.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.DelegatedResource; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterIdentity; +import com.azure.resourcemanager.containerservice.generated.models.ManagedServiceIdentityUserAssignedIdentitiesValue; +import com.azure.resourcemanager.containerservice.generated.models.ResourceIdentityType; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class ManagedClusterIdentityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedClusterIdentity model = BinaryData.fromString( + "{\"principalId\":\"oyrxvwfudwpzntxh\",\"tenantId\":\"hl\",\"type\":\"UserAssigned\",\"delegatedResources\":{\"maofmxagkv\":{\"resourceId\":\"kfrlhrxsbky\",\"tenantId\":\"ycanuzbpzkafku\",\"referralResource\":\"crnwbmeh\",\"location\":\"eyvjusrtslhspkde\"},\"rcrgvx\":{\"resourceId\":\"elmqk\",\"tenantId\":\"ahvljuaha\",\"referralResource\":\"hcdhmdual\",\"location\":\"xqpvfadmw\"},\"sowzxcugi\":{\"resourceId\":\"gomz\",\"tenantId\":\"misgwbnb\",\"referralResource\":\"ldawkzbaliourqha\",\"location\":\"uhashsfwx\"}},\"userAssignedIdentities\":{\"ecivyh\":{\"principalId\":\"xdje\",\"clientId\":\"pucwwfvovbvme\"},\"x\":{\"principalId\":\"euojgjrwju\",\"clientId\":\"otwmcdyt\"},\"skxfbk\":{\"principalId\":\"txnrjaw\",\"clientId\":\"wgxhn\"}}}") + .toObject(ManagedClusterIdentity.class); + Assertions.assertEquals(ResourceIdentityType.USER_ASSIGNED, model.type()); + Assertions.assertEquals("kfrlhrxsbky", model.delegatedResources().get("maofmxagkv").resourceId()); + Assertions.assertEquals("ycanuzbpzkafku", model.delegatedResources().get("maofmxagkv").tenantId()); + Assertions.assertEquals("crnwbmeh", model.delegatedResources().get("maofmxagkv").referralResource()); + Assertions.assertEquals("eyvjusrtslhspkde", model.delegatedResources().get("maofmxagkv").location()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedClusterIdentity model = new ManagedClusterIdentity().withType(ResourceIdentityType.USER_ASSIGNED) + .withDelegatedResources(mapOf("maofmxagkv", + new DelegatedResource().withResourceId("kfrlhrxsbky") + .withTenantId("ycanuzbpzkafku") + .withReferralResource("crnwbmeh") + .withLocation("eyvjusrtslhspkde"), + "rcrgvx", + new DelegatedResource().withResourceId("elmqk") + .withTenantId("ahvljuaha") + .withReferralResource("hcdhmdual") + .withLocation("xqpvfadmw"), + "sowzxcugi", + new DelegatedResource().withResourceId("gomz") + .withTenantId("misgwbnb") + .withReferralResource("ldawkzbaliourqha") + .withLocation("uhashsfwx"))) + .withUserAssignedIdentities(mapOf("ecivyh", new ManagedServiceIdentityUserAssignedIdentitiesValue(), "x", + new ManagedServiceIdentityUserAssignedIdentitiesValue(), "skxfbk", + new ManagedServiceIdentityUserAssignedIdentitiesValue())); + model = BinaryData.fromObject(model).toObject(ManagedClusterIdentity.class); + Assertions.assertEquals(ResourceIdentityType.USER_ASSIGNED, model.type()); + Assertions.assertEquals("kfrlhrxsbky", model.delegatedResources().get("maofmxagkv").resourceId()); + Assertions.assertEquals("ycanuzbpzkafku", model.delegatedResources().get("maofmxagkv").tenantId()); + Assertions.assertEquals("crnwbmeh", model.delegatedResources().get("maofmxagkv").referralResource()); + Assertions.assertEquals("eyvjusrtslhspkde", model.delegatedResources().get("maofmxagkv").location()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterIngressProfileNginxTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterIngressProfileNginxTests.java new file mode 100644 index 000000000000..d637350932e1 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterIngressProfileNginxTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterIngressProfileNginx; +import com.azure.resourcemanager.containerservice.generated.models.NginxIngressControllerType; +import org.junit.jupiter.api.Assertions; + +public final class ManagedClusterIngressProfileNginxTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedClusterIngressProfileNginx model + = BinaryData.fromString("{\"defaultIngressControllerType\":\"External\"}") + .toObject(ManagedClusterIngressProfileNginx.class); + Assertions.assertEquals(NginxIngressControllerType.EXTERNAL, model.defaultIngressControllerType()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedClusterIngressProfileNginx model = new ManagedClusterIngressProfileNginx() + .withDefaultIngressControllerType(NginxIngressControllerType.EXTERNAL); + model = BinaryData.fromObject(model).toObject(ManagedClusterIngressProfileNginx.class); + Assertions.assertEquals(NginxIngressControllerType.EXTERNAL, model.defaultIngressControllerType()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterIngressProfileTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterIngressProfileTests.java new file mode 100644 index 000000000000..6199e96244f4 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterIngressProfileTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterIngressProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterIngressProfileNginx; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterIngressProfileWebAppRouting; +import com.azure.resourcemanager.containerservice.generated.models.NginxIngressControllerType; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ManagedClusterIngressProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedClusterIngressProfile model = BinaryData.fromString( + "{\"webAppRouting\":{\"enabled\":true,\"dnsZoneResourceIds\":[\"vpnazzm\",\"jrunmpxtt\",\"bh\",\"bnlankxmyskpb\"],\"nginx\":{\"defaultIngressControllerType\":\"None\"},\"identity\":{\"resourceId\":\"cxy\",\"clientId\":\"y\",\"objectId\":\"rsyn\"}}}") + .toObject(ManagedClusterIngressProfile.class); + Assertions.assertTrue(model.webAppRouting().enabled()); + Assertions.assertEquals("vpnazzm", model.webAppRouting().dnsZoneResourceIds().get(0)); + Assertions.assertEquals(NginxIngressControllerType.NONE, + model.webAppRouting().nginx().defaultIngressControllerType()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedClusterIngressProfile model = new ManagedClusterIngressProfile() + .withWebAppRouting(new ManagedClusterIngressProfileWebAppRouting().withEnabled(true) + .withDnsZoneResourceIds(Arrays.asList("vpnazzm", "jrunmpxtt", "bh", "bnlankxmyskpb")) + .withNginx(new ManagedClusterIngressProfileNginx() + .withDefaultIngressControllerType(NginxIngressControllerType.NONE))); + model = BinaryData.fromObject(model).toObject(ManagedClusterIngressProfile.class); + Assertions.assertTrue(model.webAppRouting().enabled()); + Assertions.assertEquals("vpnazzm", model.webAppRouting().dnsZoneResourceIds().get(0)); + Assertions.assertEquals(NginxIngressControllerType.NONE, + model.webAppRouting().nginx().defaultIngressControllerType()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterIngressProfileWebAppRoutingTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterIngressProfileWebAppRoutingTests.java new file mode 100644 index 000000000000..8f7cf9be7eed --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterIngressProfileWebAppRoutingTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterIngressProfileNginx; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterIngressProfileWebAppRouting; +import com.azure.resourcemanager.containerservice.generated.models.NginxIngressControllerType; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ManagedClusterIngressProfileWebAppRoutingTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedClusterIngressProfileWebAppRouting model = BinaryData.fromString( + "{\"enabled\":true,\"dnsZoneResourceIds\":[\"by\",\"czfc\"],\"nginx\":{\"defaultIngressControllerType\":\"External\"},\"identity\":{\"resourceId\":\"babphlwrqlfk\",\"clientId\":\"thsu\",\"objectId\":\"cmnyyazttb\"}}") + .toObject(ManagedClusterIngressProfileWebAppRouting.class); + Assertions.assertTrue(model.enabled()); + Assertions.assertEquals("by", model.dnsZoneResourceIds().get(0)); + Assertions.assertEquals(NginxIngressControllerType.EXTERNAL, model.nginx().defaultIngressControllerType()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedClusterIngressProfileWebAppRouting model + = new ManagedClusterIngressProfileWebAppRouting().withEnabled(true) + .withDnsZoneResourceIds(Arrays.asList("by", "czfc")) + .withNginx(new ManagedClusterIngressProfileNginx() + .withDefaultIngressControllerType(NginxIngressControllerType.EXTERNAL)); + model = BinaryData.fromObject(model).toObject(ManagedClusterIngressProfileWebAppRouting.class); + Assertions.assertTrue(model.enabled()); + Assertions.assertEquals("by", model.dnsZoneResourceIds().get(0)); + Assertions.assertEquals(NginxIngressControllerType.EXTERNAL, model.nginx().defaultIngressControllerType()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterLoadBalancerProfileManagedOutboundIPsTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterLoadBalancerProfileManagedOutboundIPsTests.java new file mode 100644 index 000000000000..c58bed9b75a1 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterLoadBalancerProfileManagedOutboundIPsTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs; +import org.junit.jupiter.api.Assertions; + +public final class ManagedClusterLoadBalancerProfileManagedOutboundIPsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedClusterLoadBalancerProfileManagedOutboundIPs model + = BinaryData.fromString("{\"count\":207833423,\"countIPv6\":676639191}") + .toObject(ManagedClusterLoadBalancerProfileManagedOutboundIPs.class); + Assertions.assertEquals(207833423, model.count()); + Assertions.assertEquals(676639191, model.countIPv6()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedClusterLoadBalancerProfileManagedOutboundIPs model + = new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(207833423).withCountIPv6(676639191); + model = BinaryData.fromObject(model).toObject(ManagedClusterLoadBalancerProfileManagedOutboundIPs.class); + Assertions.assertEquals(207833423, model.count()); + Assertions.assertEquals(676639191, model.countIPv6()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterLoadBalancerProfileOutboundIPPrefixesTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterLoadBalancerProfileOutboundIPPrefixesTests.java new file mode 100644 index 000000000000..fd0606fef544 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterLoadBalancerProfileOutboundIPPrefixesTests.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes; +import com.azure.resourcemanager.containerservice.generated.models.ResourceReference; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ManagedClusterLoadBalancerProfileOutboundIPPrefixesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedClusterLoadBalancerProfileOutboundIPPrefixes model = BinaryData + .fromString("{\"publicIPPrefixes\":[{\"id\":\"xbczwtruwiqz\"},{\"id\":\"j\"},{\"id\":\"ovm\"}]}") + .toObject(ManagedClusterLoadBalancerProfileOutboundIPPrefixes.class); + Assertions.assertEquals("xbczwtruwiqz", model.publicIPPrefixes().get(0).id()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedClusterLoadBalancerProfileOutboundIPPrefixes model + = new ManagedClusterLoadBalancerProfileOutboundIPPrefixes() + .withPublicIPPrefixes(Arrays.asList(new ResourceReference().withId("xbczwtruwiqz"), + new ResourceReference().withId("j"), new ResourceReference().withId("ovm"))); + model = BinaryData.fromObject(model).toObject(ManagedClusterLoadBalancerProfileOutboundIPPrefixes.class); + Assertions.assertEquals("xbczwtruwiqz", model.publicIPPrefixes().get(0).id()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterLoadBalancerProfileOutboundIPsTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterLoadBalancerProfileOutboundIPsTests.java new file mode 100644 index 000000000000..f78aabc77bd2 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterLoadBalancerProfileOutboundIPsTests.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterLoadBalancerProfileOutboundIPs; +import com.azure.resourcemanager.containerservice.generated.models.ResourceReference; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ManagedClusterLoadBalancerProfileOutboundIPsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedClusterLoadBalancerProfileOutboundIPs model = BinaryData.fromString( + "{\"publicIPs\":[{\"id\":\"obpxjmflbvvn\"},{\"id\":\"rkcciwwzjuqk\"},{\"id\":\"sa\"},{\"id\":\"wkuofoskghsauu\"}]}") + .toObject(ManagedClusterLoadBalancerProfileOutboundIPs.class); + Assertions.assertEquals("obpxjmflbvvn", model.publicIPs().get(0).id()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedClusterLoadBalancerProfileOutboundIPs model + = new ManagedClusterLoadBalancerProfileOutboundIPs().withPublicIPs(Arrays.asList( + new ResourceReference().withId("obpxjmflbvvn"), new ResourceReference().withId("rkcciwwzjuqk"), + new ResourceReference().withId("sa"), new ResourceReference().withId("wkuofoskghsauu"))); + model = BinaryData.fromObject(model).toObject(ManagedClusterLoadBalancerProfileOutboundIPs.class); + Assertions.assertEquals("obpxjmflbvvn", model.publicIPs().get(0).id()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterLoadBalancerProfileTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterLoadBalancerProfileTests.java new file mode 100644 index 000000000000..8b3968ccc8fd --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterLoadBalancerProfileTests.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.BackendPoolType; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterLoadBalancerProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterLoadBalancerProfileOutboundIPs; +import com.azure.resourcemanager.containerservice.generated.models.ResourceReference; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ManagedClusterLoadBalancerProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedClusterLoadBalancerProfile model = BinaryData.fromString( + "{\"managedOutboundIPs\":{\"count\":2101228547,\"countIPv6\":2062075015},\"outboundIPPrefixes\":{\"publicIPPrefixes\":[{\"id\":\"jmcmatuokthfu\"},{\"id\":\"aodsfcpkv\"},{\"id\":\"dpuozmyz\"},{\"id\":\"agfuaxbezyiu\"}]},\"outboundIPs\":{\"publicIPs\":[{\"id\":\"hrdxwzywqsmbs\"},{\"id\":\"exim\"},{\"id\":\"yocf\"},{\"id\":\"ksymd\"}]},\"effectiveOutboundIPs\":[{\"id\":\"kiiuxhqyudxor\"},{\"id\":\"nbpoczvyifqrvkdv\"},{\"id\":\"llr\"}],\"allocatedOutboundPorts\":31465947,\"idleTimeoutInMinutes\":146352395,\"enableMultipleStandardLoadBalancers\":false,\"backendPoolType\":\"NodeIP\"}") + .toObject(ManagedClusterLoadBalancerProfile.class); + Assertions.assertEquals(2101228547, model.managedOutboundIPs().count()); + Assertions.assertEquals(2062075015, model.managedOutboundIPs().countIPv6()); + Assertions.assertEquals("jmcmatuokthfu", model.outboundIPPrefixes().publicIPPrefixes().get(0).id()); + Assertions.assertEquals("hrdxwzywqsmbs", model.outboundIPs().publicIPs().get(0).id()); + Assertions.assertEquals(31465947, model.allocatedOutboundPorts()); + Assertions.assertEquals(146352395, model.idleTimeoutInMinutes()); + Assertions.assertFalse(model.enableMultipleStandardLoadBalancers()); + Assertions.assertEquals(BackendPoolType.NODE_IP, model.backendPoolType()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedClusterLoadBalancerProfile model = new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2101228547) + .withCountIPv6(2062075015)) + .withOutboundIPPrefixes( + new ManagedClusterLoadBalancerProfileOutboundIPPrefixes().withPublicIPPrefixes(Arrays.asList( + new ResourceReference().withId("jmcmatuokthfu"), new ResourceReference().withId("aodsfcpkv"), + new ResourceReference().withId("dpuozmyz"), new ResourceReference().withId("agfuaxbezyiu")))) + .withOutboundIPs(new ManagedClusterLoadBalancerProfileOutboundIPs().withPublicIPs( + Arrays.asList(new ResourceReference().withId("hrdxwzywqsmbs"), new ResourceReference().withId("exim"), + new ResourceReference().withId("yocf"), new ResourceReference().withId("ksymd")))) + .withAllocatedOutboundPorts(31465947) + .withIdleTimeoutInMinutes(146352395) + .withEnableMultipleStandardLoadBalancers(false) + .withBackendPoolType(BackendPoolType.NODE_IP); + model = BinaryData.fromObject(model).toObject(ManagedClusterLoadBalancerProfile.class); + Assertions.assertEquals(2101228547, model.managedOutboundIPs().count()); + Assertions.assertEquals(2062075015, model.managedOutboundIPs().countIPv6()); + Assertions.assertEquals("jmcmatuokthfu", model.outboundIPPrefixes().publicIPPrefixes().get(0).id()); + Assertions.assertEquals("hrdxwzywqsmbs", model.outboundIPs().publicIPs().get(0).id()); + Assertions.assertEquals(31465947, model.allocatedOutboundPorts()); + Assertions.assertEquals(146352395, model.idleTimeoutInMinutes()); + Assertions.assertFalse(model.enableMultipleStandardLoadBalancers()); + Assertions.assertEquals(BackendPoolType.NODE_IP, model.backendPoolType()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterManagedOutboundIPProfileTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterManagedOutboundIPProfileTests.java new file mode 100644 index 000000000000..1bc048ae1e3c --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterManagedOutboundIPProfileTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterManagedOutboundIPProfile; +import org.junit.jupiter.api.Assertions; + +public final class ManagedClusterManagedOutboundIPProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedClusterManagedOutboundIPProfile model + = BinaryData.fromString("{\"count\":1425243209}").toObject(ManagedClusterManagedOutboundIPProfile.class); + Assertions.assertEquals(1425243209, model.count()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedClusterManagedOutboundIPProfile model + = new ManagedClusterManagedOutboundIPProfile().withCount(1425243209); + model = BinaryData.fromObject(model).toObject(ManagedClusterManagedOutboundIPProfile.class); + Assertions.assertEquals(1425243209, model.count()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterMetricsProfileTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterMetricsProfileTests.java new file mode 100644 index 000000000000..f6af6d390fbe --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterMetricsProfileTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterCostAnalysis; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterMetricsProfile; +import org.junit.jupiter.api.Assertions; + +public final class ManagedClusterMetricsProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedClusterMetricsProfile model = BinaryData.fromString("{\"costAnalysis\":{\"enabled\":true}}") + .toObject(ManagedClusterMetricsProfile.class); + Assertions.assertTrue(model.costAnalysis().enabled()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedClusterMetricsProfile model + = new ManagedClusterMetricsProfile().withCostAnalysis(new ManagedClusterCostAnalysis().withEnabled(true)); + model = BinaryData.fromObject(model).toObject(ManagedClusterMetricsProfile.class); + Assertions.assertTrue(model.costAnalysis().enabled()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterNATGatewayProfileTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterNATGatewayProfileTests.java new file mode 100644 index 000000000000..ed0a334490e7 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterNATGatewayProfileTests.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterManagedOutboundIPProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterNATGatewayProfile; +import org.junit.jupiter.api.Assertions; + +public final class ManagedClusterNATGatewayProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedClusterNATGatewayProfile model = BinaryData.fromString( + "{\"managedOutboundIPProfile\":{\"count\":988080930},\"effectiveOutboundIPs\":[{\"id\":\"eduugi\"},{\"id\":\"jrrfbyaosve\"},{\"id\":\"sonpclhocohs\"},{\"id\":\"ev\"}],\"idleTimeoutInMinutes\":1452843037}") + .toObject(ManagedClusterNATGatewayProfile.class); + Assertions.assertEquals(988080930, model.managedOutboundIPProfile().count()); + Assertions.assertEquals(1452843037, model.idleTimeoutInMinutes()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedClusterNATGatewayProfile model = new ManagedClusterNATGatewayProfile() + .withManagedOutboundIPProfile(new ManagedClusterManagedOutboundIPProfile().withCount(988080930)) + .withIdleTimeoutInMinutes(1452843037); + model = BinaryData.fromObject(model).toObject(ManagedClusterNATGatewayProfile.class); + Assertions.assertEquals(988080930, model.managedOutboundIPProfile().count()); + Assertions.assertEquals(1452843037, model.idleTimeoutInMinutes()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterNodeProvisioningProfileTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterNodeProvisioningProfileTests.java new file mode 100644 index 000000000000..ffde57a09b6e --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterNodeProvisioningProfileTests.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterNodeProvisioningProfile; +import com.azure.resourcemanager.containerservice.generated.models.NodeProvisioningDefaultNodePools; +import com.azure.resourcemanager.containerservice.generated.models.NodeProvisioningMode; +import org.junit.jupiter.api.Assertions; + +public final class ManagedClusterNodeProvisioningProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedClusterNodeProvisioningProfile model + = BinaryData.fromString("{\"mode\":\"Auto\",\"defaultNodePools\":\"Auto\"}") + .toObject(ManagedClusterNodeProvisioningProfile.class); + Assertions.assertEquals(NodeProvisioningMode.AUTO, model.mode()); + Assertions.assertEquals(NodeProvisioningDefaultNodePools.AUTO, model.defaultNodePools()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedClusterNodeProvisioningProfile model + = new ManagedClusterNodeProvisioningProfile().withMode(NodeProvisioningMode.AUTO) + .withDefaultNodePools(NodeProvisioningDefaultNodePools.AUTO); + model = BinaryData.fromObject(model).toObject(ManagedClusterNodeProvisioningProfile.class); + Assertions.assertEquals(NodeProvisioningMode.AUTO, model.mode()); + Assertions.assertEquals(NodeProvisioningDefaultNodePools.AUTO, model.defaultNodePools()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterNodeResourceGroupProfileTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterNodeResourceGroupProfileTests.java new file mode 100644 index 000000000000..b3e2bb3eea23 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterNodeResourceGroupProfileTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterNodeResourceGroupProfile; +import com.azure.resourcemanager.containerservice.generated.models.RestrictionLevel; +import org.junit.jupiter.api.Assertions; + +public final class ManagedClusterNodeResourceGroupProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedClusterNodeResourceGroupProfile model = BinaryData.fromString("{\"restrictionLevel\":\"Unrestricted\"}") + .toObject(ManagedClusterNodeResourceGroupProfile.class); + Assertions.assertEquals(RestrictionLevel.UNRESTRICTED, model.restrictionLevel()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedClusterNodeResourceGroupProfile model + = new ManagedClusterNodeResourceGroupProfile().withRestrictionLevel(RestrictionLevel.UNRESTRICTED); + model = BinaryData.fromObject(model).toObject(ManagedClusterNodeResourceGroupProfile.class); + Assertions.assertEquals(RestrictionLevel.UNRESTRICTED, model.restrictionLevel()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterOIDCIssuerProfileTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterOIDCIssuerProfileTests.java new file mode 100644 index 000000000000..60071d417f22 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterOIDCIssuerProfileTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterOIDCIssuerProfile; +import org.junit.jupiter.api.Assertions; + +public final class ManagedClusterOIDCIssuerProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedClusterOIDCIssuerProfile model + = BinaryData.fromString("{\"issuerURL\":\"rxnjeaseipheofl\",\"enabled\":false}") + .toObject(ManagedClusterOIDCIssuerProfile.class); + Assertions.assertFalse(model.enabled()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedClusterOIDCIssuerProfile model = new ManagedClusterOIDCIssuerProfile().withEnabled(false); + model = BinaryData.fromObject(model).toObject(ManagedClusterOIDCIssuerProfile.class); + Assertions.assertFalse(model.enabled()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterPodIdentityExceptionTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterPodIdentityExceptionTests.java new file mode 100644 index 000000000000..7e328a171408 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterPodIdentityExceptionTests.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterPodIdentityException; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class ManagedClusterPodIdentityExceptionTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedClusterPodIdentityException model = BinaryData + .fromString("{\"name\":\"isnjampmngnz\",\"namespace\":\"c\",\"podLabels\":{\"vpk\":\"qwoochcbon\"}}") + .toObject(ManagedClusterPodIdentityException.class); + Assertions.assertEquals("isnjampmngnz", model.name()); + Assertions.assertEquals("c", model.namespace()); + Assertions.assertEquals("qwoochcbon", model.podLabels().get("vpk")); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedClusterPodIdentityException model = new ManagedClusterPodIdentityException().withName("isnjampmngnz") + .withNamespace("c") + .withPodLabels(mapOf("vpk", "qwoochcbon")); + model = BinaryData.fromObject(model).toObject(ManagedClusterPodIdentityException.class); + Assertions.assertEquals("isnjampmngnz", model.name()); + Assertions.assertEquals("c", model.namespace()); + Assertions.assertEquals("qwoochcbon", model.podLabels().get("vpk")); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterPoolUpgradeProfileTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterPoolUpgradeProfileTests.java new file mode 100644 index 000000000000..d273f20003a7 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterPoolUpgradeProfileTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterPoolUpgradeProfile; +import com.azure.resourcemanager.containerservice.generated.models.OSType; +import org.junit.jupiter.api.Assertions; + +public final class ManagedClusterPoolUpgradeProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedClusterPoolUpgradeProfile model = BinaryData.fromString( + "{\"kubernetesVersion\":\"cpwi\",\"name\":\"vqtmnub\",\"osType\":\"Linux\",\"upgrades\":[{\"kubernetesVersion\":\"ksmond\",\"isPreview\":true}]}") + .toObject(ManagedClusterPoolUpgradeProfile.class); + Assertions.assertEquals("cpwi", model.kubernetesVersion()); + Assertions.assertEquals("vqtmnub", model.name()); + Assertions.assertEquals(OSType.LINUX, model.osType()); + Assertions.assertEquals("ksmond", model.upgrades().get(0).kubernetesVersion()); + Assertions.assertTrue(model.upgrades().get(0).isPreview()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterPoolUpgradeProfileUpgradesItemTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterPoolUpgradeProfileUpgradesItemTests.java new file mode 100644 index 000000000000..8919f5def598 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterPoolUpgradeProfileUpgradesItemTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterPoolUpgradeProfileUpgradesItem; +import org.junit.jupiter.api.Assertions; + +public final class ManagedClusterPoolUpgradeProfileUpgradesItemTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedClusterPoolUpgradeProfileUpgradesItem model + = BinaryData.fromString("{\"kubernetesVersion\":\"xvy\",\"isPreview\":false}") + .toObject(ManagedClusterPoolUpgradeProfileUpgradesItem.class); + Assertions.assertEquals("xvy", model.kubernetesVersion()); + Assertions.assertFalse(model.isPreview()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterPropertiesAutoScalerProfileTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterPropertiesAutoScalerProfileTests.java new file mode 100644 index 000000000000..de5cbcebcd77 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterPropertiesAutoScalerProfileTests.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.Expander; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterPropertiesAutoScalerProfile; +import org.junit.jupiter.api.Assertions; + +public final class ManagedClusterPropertiesAutoScalerProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedClusterPropertiesAutoScalerProfile model = BinaryData.fromString( + "{\"balance-similar-node-groups\":\"azyxoegukg\",\"daemonset-eviction-for-empty-nodes\":false,\"daemonset-eviction-for-occupied-nodes\":true,\"ignore-daemonsets-utilization\":false,\"expander\":\"most-pods\",\"max-empty-bulk-delete\":\"vqzntypmrbpizcdr\",\"max-graceful-termination-sec\":\"sdpydnfyhxdeoejz\",\"max-node-provision-time\":\"w\",\"max-total-unready-percentage\":\"sjttgzfbish\",\"new-pod-scale-up-delay\":\"khaj\",\"ok-total-unready-count\":\"yeamdphagalpb\",\"scan-interval\":\"wgipwhono\",\"scale-down-delay-after-add\":\"gshwankixz\",\"scale-down-delay-after-delete\":\"njeputtmrywn\",\"scale-down-delay-after-failure\":\"oqftiyqzrnkcq\",\"scale-down-unneeded-time\":\"xlwhzlsicoh\",\"scale-down-unready-time\":\"qnwvlrya\",\"scale-down-utilization-threshold\":\"hheunmmqhgyx\",\"skip-nodes-with-local-storage\":\"onocukok\",\"skip-nodes-with-system-pods\":\"axuconuq\"}") + .toObject(ManagedClusterPropertiesAutoScalerProfile.class); + Assertions.assertEquals("azyxoegukg", model.balanceSimilarNodeGroups()); + Assertions.assertFalse(model.daemonsetEvictionForEmptyNodes()); + Assertions.assertTrue(model.daemonsetEvictionForOccupiedNodes()); + Assertions.assertFalse(model.ignoreDaemonsetsUtilization()); + Assertions.assertEquals(Expander.MOST_PODS, model.expander()); + Assertions.assertEquals("vqzntypmrbpizcdr", model.maxEmptyBulkDelete()); + Assertions.assertEquals("sdpydnfyhxdeoejz", model.maxGracefulTerminationSec()); + Assertions.assertEquals("w", model.maxNodeProvisionTime()); + Assertions.assertEquals("sjttgzfbish", model.maxTotalUnreadyPercentage()); + Assertions.assertEquals("khaj", model.newPodScaleUpDelay()); + Assertions.assertEquals("yeamdphagalpb", model.okTotalUnreadyCount()); + Assertions.assertEquals("wgipwhono", model.scanInterval()); + Assertions.assertEquals("gshwankixz", model.scaleDownDelayAfterAdd()); + Assertions.assertEquals("njeputtmrywn", model.scaleDownDelayAfterDelete()); + Assertions.assertEquals("oqftiyqzrnkcq", model.scaleDownDelayAfterFailure()); + Assertions.assertEquals("xlwhzlsicoh", model.scaleDownUnneededTime()); + Assertions.assertEquals("qnwvlrya", model.scaleDownUnreadyTime()); + Assertions.assertEquals("hheunmmqhgyx", model.scaleDownUtilizationThreshold()); + Assertions.assertEquals("onocukok", model.skipNodesWithLocalStorage()); + Assertions.assertEquals("axuconuq", model.skipNodesWithSystemPods()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedClusterPropertiesAutoScalerProfile model + = new ManagedClusterPropertiesAutoScalerProfile().withBalanceSimilarNodeGroups("azyxoegukg") + .withDaemonsetEvictionForEmptyNodes(false) + .withDaemonsetEvictionForOccupiedNodes(true) + .withIgnoreDaemonsetsUtilization(false) + .withExpander(Expander.MOST_PODS) + .withMaxEmptyBulkDelete("vqzntypmrbpizcdr") + .withMaxGracefulTerminationSec("sdpydnfyhxdeoejz") + .withMaxNodeProvisionTime("w") + .withMaxTotalUnreadyPercentage("sjttgzfbish") + .withNewPodScaleUpDelay("khaj") + .withOkTotalUnreadyCount("yeamdphagalpb") + .withScanInterval("wgipwhono") + .withScaleDownDelayAfterAdd("gshwankixz") + .withScaleDownDelayAfterDelete("njeputtmrywn") + .withScaleDownDelayAfterFailure("oqftiyqzrnkcq") + .withScaleDownUnneededTime("xlwhzlsicoh") + .withScaleDownUnreadyTime("qnwvlrya") + .withScaleDownUtilizationThreshold("hheunmmqhgyx") + .withSkipNodesWithLocalStorage("onocukok") + .withSkipNodesWithSystemPods("axuconuq"); + model = BinaryData.fromObject(model).toObject(ManagedClusterPropertiesAutoScalerProfile.class); + Assertions.assertEquals("azyxoegukg", model.balanceSimilarNodeGroups()); + Assertions.assertFalse(model.daemonsetEvictionForEmptyNodes()); + Assertions.assertTrue(model.daemonsetEvictionForOccupiedNodes()); + Assertions.assertFalse(model.ignoreDaemonsetsUtilization()); + Assertions.assertEquals(Expander.MOST_PODS, model.expander()); + Assertions.assertEquals("vqzntypmrbpizcdr", model.maxEmptyBulkDelete()); + Assertions.assertEquals("sdpydnfyhxdeoejz", model.maxGracefulTerminationSec()); + Assertions.assertEquals("w", model.maxNodeProvisionTime()); + Assertions.assertEquals("sjttgzfbish", model.maxTotalUnreadyPercentage()); + Assertions.assertEquals("khaj", model.newPodScaleUpDelay()); + Assertions.assertEquals("yeamdphagalpb", model.okTotalUnreadyCount()); + Assertions.assertEquals("wgipwhono", model.scanInterval()); + Assertions.assertEquals("gshwankixz", model.scaleDownDelayAfterAdd()); + Assertions.assertEquals("njeputtmrywn", model.scaleDownDelayAfterDelete()); + Assertions.assertEquals("oqftiyqzrnkcq", model.scaleDownDelayAfterFailure()); + Assertions.assertEquals("xlwhzlsicoh", model.scaleDownUnneededTime()); + Assertions.assertEquals("qnwvlrya", model.scaleDownUnreadyTime()); + Assertions.assertEquals("hheunmmqhgyx", model.scaleDownUtilizationThreshold()); + Assertions.assertEquals("onocukok", model.skipNodesWithLocalStorage()); + Assertions.assertEquals("axuconuq", model.skipNodesWithSystemPods()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterSKUTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterSKUTests.java new file mode 100644 index 000000000000..d66ec227d1c8 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterSKUTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSKU; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSKUName; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSKUTier; +import org.junit.jupiter.api.Assertions; + +public final class ManagedClusterSKUTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedClusterSKU model + = BinaryData.fromString("{\"name\":\"Automatic\",\"tier\":\"Premium\"}").toObject(ManagedClusterSKU.class); + Assertions.assertEquals(ManagedClusterSKUName.AUTOMATIC, model.name()); + Assertions.assertEquals(ManagedClusterSKUTier.PREMIUM, model.tier()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedClusterSKU model + = new ManagedClusterSKU().withName(ManagedClusterSKUName.AUTOMATIC).withTier(ManagedClusterSKUTier.PREMIUM); + model = BinaryData.fromObject(model).toObject(ManagedClusterSKU.class); + Assertions.assertEquals(ManagedClusterSKUName.AUTOMATIC, model.name()); + Assertions.assertEquals(ManagedClusterSKUTier.PREMIUM, model.tier()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterSecurityProfileDefenderSecurityMonitoringTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterSecurityProfileDefenderSecurityMonitoringTests.java new file mode 100644 index 000000000000..b80cdf9a0e13 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterSecurityProfileDefenderSecurityMonitoringTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSecurityProfileDefenderSecurityMonitoring; +import org.junit.jupiter.api.Assertions; + +public final class ManagedClusterSecurityProfileDefenderSecurityMonitoringTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedClusterSecurityProfileDefenderSecurityMonitoring model = BinaryData.fromString("{\"enabled\":true}") + .toObject(ManagedClusterSecurityProfileDefenderSecurityMonitoring.class); + Assertions.assertTrue(model.enabled()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedClusterSecurityProfileDefenderSecurityMonitoring model + = new ManagedClusterSecurityProfileDefenderSecurityMonitoring().withEnabled(true); + model = BinaryData.fromObject(model).toObject(ManagedClusterSecurityProfileDefenderSecurityMonitoring.class); + Assertions.assertTrue(model.enabled()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterSecurityProfileDefenderTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterSecurityProfileDefenderTests.java new file mode 100644 index 000000000000..78e5ce860c2e --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterSecurityProfileDefenderTests.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSecurityProfileDefender; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSecurityProfileDefenderSecurityMonitoring; +import org.junit.jupiter.api.Assertions; + +public final class ManagedClusterSecurityProfileDefenderTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedClusterSecurityProfileDefender model = BinaryData + .fromString( + "{\"logAnalyticsWorkspaceResourceId\":\"spnqzahmgkb\",\"securityMonitoring\":{\"enabled\":false}}") + .toObject(ManagedClusterSecurityProfileDefender.class); + Assertions.assertEquals("spnqzahmgkb", model.logAnalyticsWorkspaceResourceId()); + Assertions.assertFalse(model.securityMonitoring().enabled()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedClusterSecurityProfileDefender model = new ManagedClusterSecurityProfileDefender() + .withLogAnalyticsWorkspaceResourceId("spnqzahmgkb") + .withSecurityMonitoring(new ManagedClusterSecurityProfileDefenderSecurityMonitoring().withEnabled(false)); + model = BinaryData.fromObject(model).toObject(ManagedClusterSecurityProfileDefender.class); + Assertions.assertEquals("spnqzahmgkb", model.logAnalyticsWorkspaceResourceId()); + Assertions.assertFalse(model.securityMonitoring().enabled()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterSecurityProfileImageCleanerTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterSecurityProfileImageCleanerTests.java new file mode 100644 index 000000000000..74aa6b88fdc6 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterSecurityProfileImageCleanerTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSecurityProfileImageCleaner; +import org.junit.jupiter.api.Assertions; + +public final class ManagedClusterSecurityProfileImageCleanerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedClusterSecurityProfileImageCleaner model + = BinaryData.fromString("{\"enabled\":false,\"intervalHours\":2048114314}") + .toObject(ManagedClusterSecurityProfileImageCleaner.class); + Assertions.assertFalse(model.enabled()); + Assertions.assertEquals(2048114314, model.intervalHours()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedClusterSecurityProfileImageCleaner model + = new ManagedClusterSecurityProfileImageCleaner().withEnabled(false).withIntervalHours(2048114314); + model = BinaryData.fromObject(model).toObject(ManagedClusterSecurityProfileImageCleaner.class); + Assertions.assertFalse(model.enabled()); + Assertions.assertEquals(2048114314, model.intervalHours()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterSecurityProfileWorkloadIdentityTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterSecurityProfileWorkloadIdentityTests.java new file mode 100644 index 000000000000..7a3ad6838a6a --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterSecurityProfileWorkloadIdentityTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSecurityProfileWorkloadIdentity; +import org.junit.jupiter.api.Assertions; + +public final class ManagedClusterSecurityProfileWorkloadIdentityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedClusterSecurityProfileWorkloadIdentity model = BinaryData.fromString("{\"enabled\":false}") + .toObject(ManagedClusterSecurityProfileWorkloadIdentity.class); + Assertions.assertFalse(model.enabled()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedClusterSecurityProfileWorkloadIdentity model + = new ManagedClusterSecurityProfileWorkloadIdentity().withEnabled(false); + model = BinaryData.fromObject(model).toObject(ManagedClusterSecurityProfileWorkloadIdentity.class); + Assertions.assertFalse(model.enabled()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterStaticEgressGatewayProfileTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterStaticEgressGatewayProfileTests.java new file mode 100644 index 000000000000..71c9522c95f5 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterStaticEgressGatewayProfileTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterStaticEgressGatewayProfile; +import org.junit.jupiter.api.Assertions; + +public final class ManagedClusterStaticEgressGatewayProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedClusterStaticEgressGatewayProfile model + = BinaryData.fromString("{\"enabled\":true}").toObject(ManagedClusterStaticEgressGatewayProfile.class); + Assertions.assertTrue(model.enabled()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedClusterStaticEgressGatewayProfile model + = new ManagedClusterStaticEgressGatewayProfile().withEnabled(true); + model = BinaryData.fromObject(model).toObject(ManagedClusterStaticEgressGatewayProfile.class); + Assertions.assertTrue(model.enabled()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterStorageProfileBlobCSIDriverTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterStorageProfileBlobCSIDriverTests.java new file mode 100644 index 000000000000..bd8c324f32e4 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterStorageProfileBlobCSIDriverTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterStorageProfileBlobCSIDriver; +import org.junit.jupiter.api.Assertions; + +public final class ManagedClusterStorageProfileBlobCSIDriverTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedClusterStorageProfileBlobCSIDriver model + = BinaryData.fromString("{\"enabled\":false}").toObject(ManagedClusterStorageProfileBlobCSIDriver.class); + Assertions.assertFalse(model.enabled()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedClusterStorageProfileBlobCSIDriver model + = new ManagedClusterStorageProfileBlobCSIDriver().withEnabled(false); + model = BinaryData.fromObject(model).toObject(ManagedClusterStorageProfileBlobCSIDriver.class); + Assertions.assertFalse(model.enabled()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterStorageProfileDiskCSIDriverTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterStorageProfileDiskCSIDriverTests.java new file mode 100644 index 000000000000..c3d668d5158a --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterStorageProfileDiskCSIDriverTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterStorageProfileDiskCSIDriver; +import org.junit.jupiter.api.Assertions; + +public final class ManagedClusterStorageProfileDiskCSIDriverTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedClusterStorageProfileDiskCSIDriver model + = BinaryData.fromString("{\"enabled\":false}").toObject(ManagedClusterStorageProfileDiskCSIDriver.class); + Assertions.assertFalse(model.enabled()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedClusterStorageProfileDiskCSIDriver model + = new ManagedClusterStorageProfileDiskCSIDriver().withEnabled(false); + model = BinaryData.fromObject(model).toObject(ManagedClusterStorageProfileDiskCSIDriver.class); + Assertions.assertFalse(model.enabled()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterStorageProfileFileCSIDriverTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterStorageProfileFileCSIDriverTests.java new file mode 100644 index 000000000000..758835d46150 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterStorageProfileFileCSIDriverTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterStorageProfileFileCSIDriver; +import org.junit.jupiter.api.Assertions; + +public final class ManagedClusterStorageProfileFileCSIDriverTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedClusterStorageProfileFileCSIDriver model + = BinaryData.fromString("{\"enabled\":true}").toObject(ManagedClusterStorageProfileFileCSIDriver.class); + Assertions.assertTrue(model.enabled()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedClusterStorageProfileFileCSIDriver model + = new ManagedClusterStorageProfileFileCSIDriver().withEnabled(true); + model = BinaryData.fromObject(model).toObject(ManagedClusterStorageProfileFileCSIDriver.class); + Assertions.assertTrue(model.enabled()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterStorageProfileSnapshotControllerTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterStorageProfileSnapshotControllerTests.java new file mode 100644 index 000000000000..5452bbfed4c6 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterStorageProfileSnapshotControllerTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterStorageProfileSnapshotController; +import org.junit.jupiter.api.Assertions; + +public final class ManagedClusterStorageProfileSnapshotControllerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedClusterStorageProfileSnapshotController model = BinaryData.fromString("{\"enabled\":true}") + .toObject(ManagedClusterStorageProfileSnapshotController.class); + Assertions.assertTrue(model.enabled()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedClusterStorageProfileSnapshotController model + = new ManagedClusterStorageProfileSnapshotController().withEnabled(true); + model = BinaryData.fromObject(model).toObject(ManagedClusterStorageProfileSnapshotController.class); + Assertions.assertTrue(model.enabled()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterStorageProfileTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterStorageProfileTests.java new file mode 100644 index 000000000000..f322391bae43 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterStorageProfileTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterStorageProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterStorageProfileBlobCSIDriver; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterStorageProfileDiskCSIDriver; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterStorageProfileFileCSIDriver; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterStorageProfileSnapshotController; +import org.junit.jupiter.api.Assertions; + +public final class ManagedClusterStorageProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedClusterStorageProfile model = BinaryData.fromString( + "{\"diskCSIDriver\":{\"enabled\":false},\"fileCSIDriver\":{\"enabled\":true},\"snapshotController\":{\"enabled\":true},\"blobCSIDriver\":{\"enabled\":true}}") + .toObject(ManagedClusterStorageProfile.class); + Assertions.assertFalse(model.diskCSIDriver().enabled()); + Assertions.assertTrue(model.fileCSIDriver().enabled()); + Assertions.assertTrue(model.snapshotController().enabled()); + Assertions.assertTrue(model.blobCSIDriver().enabled()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedClusterStorageProfile model = new ManagedClusterStorageProfile() + .withDiskCSIDriver(new ManagedClusterStorageProfileDiskCSIDriver().withEnabled(false)) + .withFileCSIDriver(new ManagedClusterStorageProfileFileCSIDriver().withEnabled(true)) + .withSnapshotController(new ManagedClusterStorageProfileSnapshotController().withEnabled(true)) + .withBlobCSIDriver(new ManagedClusterStorageProfileBlobCSIDriver().withEnabled(true)); + model = BinaryData.fromObject(model).toObject(ManagedClusterStorageProfile.class); + Assertions.assertFalse(model.diskCSIDriver().enabled()); + Assertions.assertTrue(model.fileCSIDriver().enabled()); + Assertions.assertTrue(model.snapshotController().enabled()); + Assertions.assertTrue(model.blobCSIDriver().enabled()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterUpgradeProfileInnerTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterUpgradeProfileInnerTests.java new file mode 100644 index 000000000000..d3cb5d4eb13b --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterUpgradeProfileInnerTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterUpgradeProfileInner; +import com.azure.resourcemanager.containerservice.generated.models.OSType; +import org.junit.jupiter.api.Assertions; + +public final class ManagedClusterUpgradeProfileInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedClusterUpgradeProfileInner model = BinaryData.fromString( + "{\"properties\":{\"controlPlaneProfile\":{\"kubernetesVersion\":\"seotgqrllt\",\"name\":\"wlauwzizxbmpg\",\"osType\":\"Windows\",\"upgrades\":[{\"kubernetesVersion\":\"zmuvpbttdumorppx\",\"isPreview\":false},{\"kubernetesVersion\":\"zbtbhj\",\"isPreview\":false},{\"kubernetesVersion\":\"fgohdneuelfphs\",\"isPreview\":true}]},\"agentPoolProfiles\":[{\"kubernetesVersion\":\"ozfikdowwq\",\"name\":\"v\",\"osType\":\"Linux\",\"upgrades\":[{\"kubernetesVersion\":\"vithh\",\"isPreview\":false},{\"kubernetesVersion\":\"osggbhc\",\"isPreview\":false}]}]},\"id\":\"dsjnka\",\"name\":\"jutiiswacff\",\"type\":\"dkzzewkfvhqcrail\"}") + .toObject(ManagedClusterUpgradeProfileInner.class); + Assertions.assertEquals("seotgqrllt", model.controlPlaneProfile().kubernetesVersion()); + Assertions.assertEquals("wlauwzizxbmpg", model.controlPlaneProfile().name()); + Assertions.assertEquals(OSType.WINDOWS, model.controlPlaneProfile().osType()); + Assertions.assertEquals("zmuvpbttdumorppx", model.controlPlaneProfile().upgrades().get(0).kubernetesVersion()); + Assertions.assertFalse(model.controlPlaneProfile().upgrades().get(0).isPreview()); + Assertions.assertEquals("ozfikdowwq", model.agentPoolProfiles().get(0).kubernetesVersion()); + Assertions.assertEquals("v", model.agentPoolProfiles().get(0).name()); + Assertions.assertEquals(OSType.LINUX, model.agentPoolProfiles().get(0).osType()); + Assertions.assertEquals("vithh", model.agentPoolProfiles().get(0).upgrades().get(0).kubernetesVersion()); + Assertions.assertFalse(model.agentPoolProfiles().get(0).upgrades().get(0).isPreview()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterUpgradeProfilePropertiesTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterUpgradeProfilePropertiesTests.java new file mode 100644 index 000000000000..e8c6857313c1 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterUpgradeProfilePropertiesTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterUpgradeProfileProperties; +import com.azure.resourcemanager.containerservice.generated.models.OSType; +import org.junit.jupiter.api.Assertions; + +public final class ManagedClusterUpgradeProfilePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedClusterUpgradeProfileProperties model = BinaryData.fromString( + "{\"controlPlaneProfile\":{\"kubernetesVersion\":\"pnppfuf\",\"name\":\"wdmhdlxyjrxs\",\"osType\":\"Windows\",\"upgrades\":[{\"kubernetesVersion\":\"nihgwqapnedg\",\"isPreview\":true},{\"kubernetesVersion\":\"kcvqvpke\",\"isPreview\":true}]},\"agentPoolProfiles\":[{\"kubernetesVersion\":\"drhvoodsotbo\",\"name\":\"dopcjwvnh\",\"osType\":\"Linux\",\"upgrades\":[{\"kubernetesVersion\":\"gx\",\"isPreview\":true},{\"kubernetesVersion\":\"lpmutwuoegrpkhj\",\"isPreview\":false},{\"kubernetesVersion\":\"qsluicp\",\"isPreview\":false}]},{\"kubernetesVersion\":\"kzzlvmbmpaxmodf\",\"name\":\"efyw\",\"osType\":\"Linux\",\"upgrades\":[{\"kubernetesVersion\":\"mwyhr\",\"isPreview\":false},{\"kubernetesVersion\":\"ft\",\"isPreview\":false}]}]}") + .toObject(ManagedClusterUpgradeProfileProperties.class); + Assertions.assertEquals("pnppfuf", model.controlPlaneProfile().kubernetesVersion()); + Assertions.assertEquals("wdmhdlxyjrxs", model.controlPlaneProfile().name()); + Assertions.assertEquals(OSType.WINDOWS, model.controlPlaneProfile().osType()); + Assertions.assertEquals("nihgwqapnedg", model.controlPlaneProfile().upgrades().get(0).kubernetesVersion()); + Assertions.assertTrue(model.controlPlaneProfile().upgrades().get(0).isPreview()); + Assertions.assertEquals("drhvoodsotbo", model.agentPoolProfiles().get(0).kubernetesVersion()); + Assertions.assertEquals("dopcjwvnh", model.agentPoolProfiles().get(0).name()); + Assertions.assertEquals(OSType.LINUX, model.agentPoolProfiles().get(0).osType()); + Assertions.assertEquals("gx", model.agentPoolProfiles().get(0).upgrades().get(0).kubernetesVersion()); + Assertions.assertTrue(model.agentPoolProfiles().get(0).upgrades().get(0).isPreview()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterWorkloadAutoScalerProfileKedaTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterWorkloadAutoScalerProfileKedaTests.java new file mode 100644 index 000000000000..43496a5383c8 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterWorkloadAutoScalerProfileKedaTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterWorkloadAutoScalerProfileKeda; +import org.junit.jupiter.api.Assertions; + +public final class ManagedClusterWorkloadAutoScalerProfileKedaTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedClusterWorkloadAutoScalerProfileKeda model + = BinaryData.fromString("{\"enabled\":true}").toObject(ManagedClusterWorkloadAutoScalerProfileKeda.class); + Assertions.assertTrue(model.enabled()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedClusterWorkloadAutoScalerProfileKeda model + = new ManagedClusterWorkloadAutoScalerProfileKeda().withEnabled(true); + model = BinaryData.fromObject(model).toObject(ManagedClusterWorkloadAutoScalerProfileKeda.class); + Assertions.assertTrue(model.enabled()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterWorkloadAutoScalerProfileTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterWorkloadAutoScalerProfileTests.java new file mode 100644 index 000000000000..f3113383868d --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterWorkloadAutoScalerProfileTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterWorkloadAutoScalerProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterWorkloadAutoScalerProfileKeda; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler; +import org.junit.jupiter.api.Assertions; + +public final class ManagedClusterWorkloadAutoScalerProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedClusterWorkloadAutoScalerProfile model + = BinaryData.fromString("{\"keda\":{\"enabled\":true},\"verticalPodAutoscaler\":{\"enabled\":false}}") + .toObject(ManagedClusterWorkloadAutoScalerProfile.class); + Assertions.assertTrue(model.keda().enabled()); + Assertions.assertFalse(model.verticalPodAutoscaler().enabled()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedClusterWorkloadAutoScalerProfile model = new ManagedClusterWorkloadAutoScalerProfile() + .withKeda(new ManagedClusterWorkloadAutoScalerProfileKeda().withEnabled(true)) + .withVerticalPodAutoscaler( + new ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler().withEnabled(false)); + model = BinaryData.fromObject(model).toObject(ManagedClusterWorkloadAutoScalerProfile.class); + Assertions.assertTrue(model.keda().enabled()); + Assertions.assertFalse(model.verticalPodAutoscaler().enabled()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscalerTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscalerTests.java new file mode 100644 index 000000000000..6f62125464af --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscalerTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler; +import org.junit.jupiter.api.Assertions; + +public final class ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscalerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler model = BinaryData.fromString("{\"enabled\":true}") + .toObject(ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler.class); + Assertions.assertTrue(model.enabled()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler model + = new ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler().withEnabled(true); + model + = BinaryData.fromObject(model).toObject(ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler.class); + Assertions.assertTrue(model.enabled()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetAccessProfileWithResponseMockTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetAccessProfileWithResponseMockTests.java new file mode 100644 index 000000000000..cae164fb4c36 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetAccessProfileWithResponseMockTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.containerservice.generated.ContainerServiceManager; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAccessProfile; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ManagedClustersGetAccessProfileWithResponseMockTests { + @Test + public void testGetAccessProfileWithResponse() throws Exception { + String responseStr + = "{\"properties\":{},\"location\":\"luan\",\"tags\":{\"z\":\"fxeeebtijvacvbm\",\"wxacevehj\":\"qqxlajr\",\"aoqltfaey\":\"uyxoaf\"},\"id\":\"inmfgvxirp\",\"name\":\"hriypoqeyhlqhy\",\"type\":\"prlpy\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ContainerServiceManager manager = ContainerServiceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + ManagedClusterAccessProfile response = manager.managedClusters() + .getAccessProfileWithResponse("fczbgom", "gbeglqgleo", "i", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("luan", response.location()); + Assertions.assertEquals("fxeeebtijvacvbm", response.tags().get("z")); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetMeshRevisionProfileWithResponseMockTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetMeshRevisionProfileWithResponseMockTests.java new file mode 100644 index 000000000000..d6bc40656416 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetMeshRevisionProfileWithResponseMockTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.containerservice.generated.ContainerServiceManager; +import com.azure.resourcemanager.containerservice.generated.models.MeshRevisionProfile; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ManagedClustersGetMeshRevisionProfileWithResponseMockTests { + @Test + public void testGetMeshRevisionProfileWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"meshRevisions\":[{\"revision\":\"yxonsupe\",\"upgrades\":[\"zqn\",\"cvsql\"],\"compatibleWith\":[{},{}]}]},\"id\":\"ibg\",\"name\":\"xgnxfyqonmpqoxwd\",\"type\":\"fdbxiqxeiiqbim\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ContainerServiceManager manager = ContainerServiceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + MeshRevisionProfile response = manager.managedClusters() + .getMeshRevisionProfileWithResponse("ryuzcbmqqv", "mv", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("yxonsupe", response.properties().meshRevisions().get(0).revision()); + Assertions.assertEquals("zqn", response.properties().meshRevisions().get(0).upgrades().get(0)); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetMeshUpgradeProfileWithResponseMockTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetMeshUpgradeProfileWithResponseMockTests.java new file mode 100644 index 000000000000..177ca5738be2 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetMeshUpgradeProfileWithResponseMockTests.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.containerservice.generated.ContainerServiceManager; +import com.azure.resourcemanager.containerservice.generated.models.MeshUpgradeProfile; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ManagedClustersGetMeshUpgradeProfileWithResponseMockTests { + @Test + public void testGetMeshUpgradeProfileWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"revision\":\"wfansnvpdi\",\"upgrades\":[\"kostbzbki\",\"buqny\",\"phzfylsgcrp\",\"bcunezzceze\"],\"compatibleWith\":[{\"name\":\"fwlwxjwetnps\",\"versions\":[\"lafzvaylptr\",\"qqwzt\",\"mwqkchcxwaxf\"]}]},\"id\":\"zjkjexfdeqv\",\"name\":\"psylkkshkbffmbmx\",\"type\":\"jrgywwpgjxsn\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ContainerServiceManager manager = ContainerServiceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + MeshUpgradeProfile response = manager.managedClusters() + .getMeshUpgradeProfileWithResponse("rylniofrzg", "zjedmstkvnlv", "bcuiiz", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("wfansnvpdi", response.properties().revision()); + Assertions.assertEquals("kostbzbki", response.properties().upgrades().get(0)); + Assertions.assertEquals("fwlwxjwetnps", response.properties().compatibleWith().get(0).name()); + Assertions.assertEquals("lafzvaylptr", response.properties().compatibleWith().get(0).versions().get(0)); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetUpgradeProfileWithResponseMockTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetUpgradeProfileWithResponseMockTests.java new file mode 100644 index 000000000000..0dc8f1ad637a --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetUpgradeProfileWithResponseMockTests.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.containerservice.generated.ContainerServiceManager; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterUpgradeProfile; +import com.azure.resourcemanager.containerservice.generated.models.OSType; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ManagedClustersGetUpgradeProfileWithResponseMockTests { + @Test + public void testGetUpgradeProfileWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"controlPlaneProfile\":{\"kubernetesVersion\":\"znmmaxrizkzobgo\",\"name\":\"lhslnelxieixyn\",\"osType\":\"Windows\",\"upgrades\":[{\"kubernetesVersion\":\"wcrojphslhcaw\",\"isPreview\":true},{\"kubernetesVersion\":\"fdwfmvigorqj\",\"isPreview\":false},{\"kubernetesVersion\":\"h\",\"isPreview\":false},{\"kubernetesVersion\":\"kafhonqj\",\"isPreview\":false}]},\"agentPoolProfiles\":[{\"kubernetesVersion\":\"ckpzvcpopmxeln\",\"name\":\"ltyjedexxmlfmk\",\"osType\":\"Windows\",\"upgrades\":[{},{}]},{\"kubernetesVersion\":\"zuawxtzxpuamwa\",\"name\":\"xrvxcushsphai\",\"osType\":\"Windows\",\"upgrades\":[{},{},{}]}]},\"id\":\"sflvgsgzwywakoih\",\"name\":\"nsmjbl\",\"type\":\"ljhlnymzotq\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ContainerServiceManager manager = ContainerServiceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + ManagedClusterUpgradeProfile response = manager.managedClusters() + .getUpgradeProfileWithResponse("oov", "idsxwaabzmifry", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("znmmaxrizkzobgo", response.controlPlaneProfile().kubernetesVersion()); + Assertions.assertEquals("lhslnelxieixyn", response.controlPlaneProfile().name()); + Assertions.assertEquals(OSType.WINDOWS, response.controlPlaneProfile().osType()); + Assertions.assertEquals("wcrojphslhcaw", response.controlPlaneProfile().upgrades().get(0).kubernetesVersion()); + Assertions.assertTrue(response.controlPlaneProfile().upgrades().get(0).isPreview()); + Assertions.assertEquals("ckpzvcpopmxeln", response.agentPoolProfiles().get(0).kubernetesVersion()); + Assertions.assertEquals("ltyjedexxmlfmk", response.agentPoolProfiles().get(0).name()); + Assertions.assertEquals(OSType.WINDOWS, response.agentPoolProfiles().get(0).osType()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListClusterAdminCredentialsWithResponseMockTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListClusterAdminCredentialsWithResponseMockTests.java new file mode 100644 index 000000000000..b31b785a45b9 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListClusterAdminCredentialsWithResponseMockTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.containerservice.generated.ContainerServiceManager; +import com.azure.resourcemanager.containerservice.generated.models.CredentialResults; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ManagedClustersListClusterAdminCredentialsWithResponseMockTests { + @Test + public void testListClusterAdminCredentialsWithResponse() throws Exception { + String responseStr = "{\"kubeconfigs\":[{\"name\":\"g\"},{\"name\":\"cmavmqfoudorhcg\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ContainerServiceManager manager = ContainerServiceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + CredentialResults response = manager.managedClusters() + .listClusterAdminCredentialsWithResponse("nuciqdsmexiit", "fuxtyasiibmiybnn", "stgnl", + com.azure.core.util.Context.NONE) + .getValue(); + + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListClusterMonitoringUserCredentialsWithResponMockTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListClusterMonitoringUserCredentialsWithResponMockTests.java new file mode 100644 index 000000000000..bbc22760c407 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListClusterMonitoringUserCredentialsWithResponMockTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.containerservice.generated.ContainerServiceManager; +import com.azure.resourcemanager.containerservice.generated.models.CredentialResults; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ManagedClustersListClusterMonitoringUserCredentialsWithResponMockTests { + @Test + public void testListClusterMonitoringUserCredentialsWithResponse() throws Exception { + String responseStr = "{\"kubeconfigs\":[{\"name\":\"hsdtmc\"},{\"name\":\"ufcohdxbz\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ContainerServiceManager manager = ContainerServiceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + CredentialResults response = manager.managedClusters() + .listClusterMonitoringUserCredentialsWithResponse("tpvopvpbdb", "qgqqihedsvqwthmk", "ibcysihsgqc", + com.azure.core.util.Context.NONE) + .getValue(); + + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListClusterUserCredentialsWithResponseMockTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListClusterUserCredentialsWithResponseMockTests.java new file mode 100644 index 000000000000..56690356c13d --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListClusterUserCredentialsWithResponseMockTests.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.containerservice.generated.ContainerServiceManager; +import com.azure.resourcemanager.containerservice.generated.models.CredentialResults; +import com.azure.resourcemanager.containerservice.generated.models.Format; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ManagedClustersListClusterUserCredentialsWithResponseMockTests { + @Test + public void testListClusterUserCredentialsWithResponse() throws Exception { + String responseStr = "{\"kubeconfigs\":[{\"name\":\"ftpmdtzfjltfv\"},{\"name\":\"yj\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ContainerServiceManager manager = ContainerServiceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + CredentialResults response = manager.managedClusters() + .listClusterUserCredentialsWithResponse("prot", "ypundmbxhugc", "jkavl", Format.AZURE, + com.azure.core.util.Context.NONE) + .getValue(); + + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListKubernetesVersionsWithResponseMockTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListKubernetesVersionsWithResponseMockTests.java new file mode 100644 index 000000000000..631d639a9dad --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListKubernetesVersionsWithResponseMockTests.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.containerservice.generated.ContainerServiceManager; +import com.azure.resourcemanager.containerservice.generated.models.KubernetesSupportPlan; +import com.azure.resourcemanager.containerservice.generated.models.KubernetesVersionListResult; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ManagedClustersListKubernetesVersionsWithResponseMockTests { + @Test + public void testListKubernetesVersionsWithResponse() throws Exception { + String responseStr + = "{\"values\":[{\"version\":\"o\",\"capabilities\":{\"supportPlan\":[\"AKSLongTermSupport\",\"KubernetesOfficial\",\"AKSLongTermSupport\",\"KubernetesOfficial\"]},\"isDefault\":true,\"isPreview\":true,\"patchVersions\":{\"uxlxqzvners\":{\"upgrades\":[\"lnghgshejjtbxqmu\"]},\"fuhok\":{\"upgrades\":[\"ucrwnami\",\"ze\",\"rqbsmswziq\"]}}},{\"version\":\"uswhvhczznvfbycj\",\"capabilities\":{\"supportPlan\":[\"KubernetesOfficial\",\"KubernetesOfficial\",\"KubernetesOfficial\"]},\"isDefault\":false,\"isPreview\":true,\"patchVersions\":{\"pelnjetag\":{\"upgrades\":[\"hndvnoamldsehao\",\"djh\",\"flzokxco\"]},\"tft\":{\"upgrades\":[\"xo\"]},\"jxgrytfmp\":{\"upgrades\":[\"npbs\",\"vefloccsrmozihmi\",\"g\",\"wtxxpkyjcx\"]},\"ztrksxwpndf\":{\"upgrades\":[\"ilrmcaykggnox\"]}}}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ContainerServiceManager manager = ContainerServiceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + KubernetesVersionListResult response = manager.managedClusters() + .listKubernetesVersionsWithResponse("rds", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("o", response.values().get(0).version()); + Assertions.assertEquals(KubernetesSupportPlan.AKSLONG_TERM_SUPPORT, + response.values().get(0).capabilities().supportPlan().get(0)); + Assertions.assertTrue(response.values().get(0).isDefault()); + Assertions.assertTrue(response.values().get(0).isPreview()); + Assertions.assertEquals("lnghgshejjtbxqmu", + response.values().get(0).patchVersions().get("uxlxqzvners").upgrades().get(0)); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListMeshRevisionProfilesMockTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListMeshRevisionProfilesMockTests.java new file mode 100644 index 000000000000..d2e5b8f5882e --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListMeshRevisionProfilesMockTests.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.containerservice.generated.ContainerServiceManager; +import com.azure.resourcemanager.containerservice.generated.models.MeshRevisionProfile; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ManagedClustersListMeshRevisionProfilesMockTests { + @Test + public void testListMeshRevisionProfiles() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"meshRevisions\":[{\"revision\":\"qpofvwbc\",\"upgrades\":[\"mbnkb\",\"vqvxk\"],\"compatibleWith\":[{},{},{},{}]},{\"revision\":\"ihebwtsw\",\"upgrades\":[\"wfmdurage\",\"izvcjfe\",\"isdju\",\"ggbqi\"],\"compatibleWith\":[{},{},{}]}]},\"id\":\"bsazgakg\",\"name\":\"cyrcmjdmspo\",\"type\":\"apvu\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ContainerServiceManager manager = ContainerServiceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.managedClusters().listMeshRevisionProfiles("tmwwi", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("qpofvwbc", response.iterator().next().properties().meshRevisions().get(0).revision()); + Assertions.assertEquals("mbnkb", + response.iterator().next().properties().meshRevisions().get(0).upgrades().get(0)); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListMeshUpgradeProfilesMockTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListMeshUpgradeProfilesMockTests.java new file mode 100644 index 000000000000..105bb5739f7e --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListMeshUpgradeProfilesMockTests.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.containerservice.generated.ContainerServiceManager; +import com.azure.resourcemanager.containerservice.generated.models.MeshUpgradeProfile; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ManagedClustersListMeshUpgradeProfilesMockTests { + @Test + public void testListMeshUpgradeProfiles() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"revision\":\"taqutdewem\",\"upgrades\":[\"vru\",\"nz\",\"jgehkf\"],\"compatibleWith\":[{\"name\":\"tixo\",\"versions\":[\"qyinl\",\"qepqwhixmon\",\"tshi\"]}]},\"id\":\"gvelfc\",\"name\":\"du\",\"type\":\"cb\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ContainerServiceManager manager = ContainerServiceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.managedClusters().listMeshUpgradeProfiles("tf", "jgicgaao", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("taqutdewem", response.iterator().next().properties().revision()); + Assertions.assertEquals("vru", response.iterator().next().properties().upgrades().get(0)); + Assertions.assertEquals("tixo", response.iterator().next().properties().compatibleWith().get(0).name()); + Assertions.assertEquals("qyinl", + response.iterator().next().properties().compatibleWith().get(0).versions().get(0)); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListOutboundNetworkDependenciesEndpointsMockTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListOutboundNetworkDependenciesEndpointsMockTests.java new file mode 100644 index 000000000000..e623ef7af0e9 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListOutboundNetworkDependenciesEndpointsMockTests.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.containerservice.generated.ContainerServiceManager; +import com.azure.resourcemanager.containerservice.generated.models.OutboundEnvironmentEndpoint; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ManagedClustersListOutboundNetworkDependenciesEndpointsMockTests { + @Test + public void testListOutboundNetworkDependenciesEndpoints() throws Exception { + String responseStr + = "{\"value\":[{\"category\":\"ewjwiuubw\",\"endpoints\":[{\"domainName\":\"fapaqtfer\",\"endpointDetails\":[{\"ipAddress\":\"x\",\"port\":1238092125,\"protocol\":\"xap\",\"description\":\"og\"},{\"ipAddress\":\"nobpudcdabtqwpw\",\"port\":713564205,\"protocol\":\"zasqbucljgkyexao\",\"description\":\"yaipidsda\"},{\"ipAddress\":\"tx\",\"port\":634071043,\"protocol\":\"mfqwa\",\"description\":\"nqnm\"},{\"ipAddress\":\"ngz\",\"port\":449577891,\"protocol\":\"tb\",\"description\":\"gny\"}]},{\"domainName\":\"sf\",\"endpointDetails\":[{\"ipAddress\":\"uik\",\"port\":1836112683,\"protocol\":\"qglcfhmlrqryxynq\",\"description\":\"rd\"},{\"ipAddress\":\"ovw\",\"port\":569967866,\"protocol\":\"tgoe\",\"description\":\"bbabp\"},{\"ipAddress\":\"vf\",\"port\":2128983530,\"protocol\":\"ntjlr\",\"description\":\"jkskyr\"}]}]}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ContainerServiceManager manager = ContainerServiceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.managedClusters() + .listOutboundNetworkDependenciesEndpoints("bzpcpiljhahzvec", "ndbnwieh", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("ewjwiuubw", response.iterator().next().category()); + Assertions.assertEquals("fapaqtfer", response.iterator().next().endpoints().get(0).domainName()); + Assertions.assertEquals("x", + response.iterator().next().endpoints().get(0).endpointDetails().get(0).ipAddress()); + Assertions.assertEquals(1238092125, + response.iterator().next().endpoints().get(0).endpointDetails().get(0).port()); + Assertions.assertEquals("xap", + response.iterator().next().endpoints().get(0).endpointDetails().get(0).protocol()); + Assertions.assertEquals("og", + response.iterator().next().endpoints().get(0).endpointDetails().get(0).description()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedNamespaceInnerTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedNamespaceInnerTests.java new file mode 100644 index 000000000000..d38e80cd2396 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedNamespaceInnerTests.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedNamespaceInner; +import com.azure.resourcemanager.containerservice.generated.models.AdoptionPolicy; +import com.azure.resourcemanager.containerservice.generated.models.DeletePolicy; +import com.azure.resourcemanager.containerservice.generated.models.NamespaceProperties; +import com.azure.resourcemanager.containerservice.generated.models.NetworkPolicies; +import com.azure.resourcemanager.containerservice.generated.models.PolicyRule; +import com.azure.resourcemanager.containerservice.generated.models.ResourceQuota; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class ManagedNamespaceInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedNamespaceInner model = BinaryData.fromString( + "{\"properties\":{\"provisioningState\":\"Creating\",\"labels\":{\"lo\":\"kxw\",\"vuzlm\":\"bq\"},\"annotations\":{\"noigbrnjwmwk\":\"lfktgplcrpwjxe\"},\"portalFqdn\":\"bsazejjoqka\",\"defaultResourceQuota\":{\"cpuRequest\":\"sxtta\",\"cpuLimit\":\"zxnfaaz\",\"memoryRequest\":\"dtnkdmkq\",\"memoryLimit\":\"lwuenvrkp\"},\"defaultNetworkPolicy\":{\"ingress\":\"DenyAll\",\"egress\":\"AllowSameNamespace\"},\"adoptionPolicy\":\"IfIdentical\",\"deletePolicy\":\"Delete\"},\"tags\":{\"wfff\":\"ysjkixqtnqttez\",\"mjihyeozphv\":\"akpjpqqmtedlt\",\"p\":\"auyqncygupkv\",\"totxhojujb\":\"dscwxqupevzhf\"},\"location\":\"elmcuvhixbjxyfw\",\"eTag\":\"lrcoolsttpki\",\"id\":\"kbnujr\",\"name\":\"wvtylbfpncurdo\",\"type\":\"wiithtywub\"}") + .toObject(ManagedNamespaceInner.class); + Assertions.assertEquals("kxw", model.properties().labels().get("lo")); + Assertions.assertEquals("lfktgplcrpwjxe", model.properties().annotations().get("noigbrnjwmwk")); + Assertions.assertEquals("sxtta", model.properties().defaultResourceQuota().cpuRequest()); + Assertions.assertEquals("zxnfaaz", model.properties().defaultResourceQuota().cpuLimit()); + Assertions.assertEquals("dtnkdmkq", model.properties().defaultResourceQuota().memoryRequest()); + Assertions.assertEquals("lwuenvrkp", model.properties().defaultResourceQuota().memoryLimit()); + Assertions.assertEquals(PolicyRule.DENY_ALL, model.properties().defaultNetworkPolicy().ingress()); + Assertions.assertEquals(PolicyRule.ALLOW_SAME_NAMESPACE, model.properties().defaultNetworkPolicy().egress()); + Assertions.assertEquals(AdoptionPolicy.IF_IDENTICAL, model.properties().adoptionPolicy()); + Assertions.assertEquals(DeletePolicy.DELETE, model.properties().deletePolicy()); + Assertions.assertEquals("ysjkixqtnqttez", model.tags().get("wfff")); + Assertions.assertEquals("elmcuvhixbjxyfw", model.location()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedNamespaceInner model = new ManagedNamespaceInner() + .withProperties(new NamespaceProperties().withLabels(mapOf("lo", "kxw", "vuzlm", "bq")) + .withAnnotations(mapOf("noigbrnjwmwk", "lfktgplcrpwjxe")) + .withDefaultResourceQuota(new ResourceQuota().withCpuRequest("sxtta") + .withCpuLimit("zxnfaaz") + .withMemoryRequest("dtnkdmkq") + .withMemoryLimit("lwuenvrkp")) + .withDefaultNetworkPolicy( + new NetworkPolicies().withIngress(PolicyRule.DENY_ALL).withEgress(PolicyRule.ALLOW_SAME_NAMESPACE)) + .withAdoptionPolicy(AdoptionPolicy.IF_IDENTICAL) + .withDeletePolicy(DeletePolicy.DELETE)) + .withTags(mapOf("wfff", "ysjkixqtnqttez", "mjihyeozphv", "akpjpqqmtedlt", "p", "auyqncygupkv", "totxhojujb", + "dscwxqupevzhf")) + .withLocation("elmcuvhixbjxyfw"); + model = BinaryData.fromObject(model).toObject(ManagedNamespaceInner.class); + Assertions.assertEquals("kxw", model.properties().labels().get("lo")); + Assertions.assertEquals("lfktgplcrpwjxe", model.properties().annotations().get("noigbrnjwmwk")); + Assertions.assertEquals("sxtta", model.properties().defaultResourceQuota().cpuRequest()); + Assertions.assertEquals("zxnfaaz", model.properties().defaultResourceQuota().cpuLimit()); + Assertions.assertEquals("dtnkdmkq", model.properties().defaultResourceQuota().memoryRequest()); + Assertions.assertEquals("lwuenvrkp", model.properties().defaultResourceQuota().memoryLimit()); + Assertions.assertEquals(PolicyRule.DENY_ALL, model.properties().defaultNetworkPolicy().ingress()); + Assertions.assertEquals(PolicyRule.ALLOW_SAME_NAMESPACE, model.properties().defaultNetworkPolicy().egress()); + Assertions.assertEquals(AdoptionPolicy.IF_IDENTICAL, model.properties().adoptionPolicy()); + Assertions.assertEquals(DeletePolicy.DELETE, model.properties().deletePolicy()); + Assertions.assertEquals("ysjkixqtnqttez", model.tags().get("wfff")); + Assertions.assertEquals("elmcuvhixbjxyfw", model.location()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedNamespaceListResultTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedNamespaceListResultTests.java new file mode 100644 index 000000000000..637640dc6a66 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedNamespaceListResultTests.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.implementation.models.ManagedNamespaceListResult; +import com.azure.resourcemanager.containerservice.generated.models.AdoptionPolicy; +import com.azure.resourcemanager.containerservice.generated.models.DeletePolicy; +import com.azure.resourcemanager.containerservice.generated.models.PolicyRule; +import org.junit.jupiter.api.Assertions; + +public final class ManagedNamespaceListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedNamespaceListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\",\"labels\":{\"awnopqgikyzirtxd\":\"ycnunvjsrtk\",\"ioilqukrydxtq\":\"uxzejntpsew\",\"ghhavgrvkffo\":\"ieoxorggufhyaomt\",\"mv\":\"jzhpjbibgjmfx\"},\"annotations\":{\"nbkfezzxscy\":\"uyovw\",\"vzzbtdcq\":\"wzdgirujbzbo\",\"dshf\":\"pniyujviyl\",\"fmwncotmrfh\":\"snrbgyefrymsgao\"},\"portalFqdn\":\"ctymoxoftp\",\"defaultResourceQuota\":{\"cpuRequest\":\"wycz\",\"cpuLimit\":\"xacpqjli\",\"memoryRequest\":\"yuspskas\",\"memoryLimit\":\"lmfwdgzx\"},\"defaultNetworkPolicy\":{\"ingress\":\"AllowAll\",\"egress\":\"DenyAll\"},\"adoptionPolicy\":\"Always\",\"deletePolicy\":\"Delete\"},\"tags\":{\"risjnhnytxifqjz\":\"uzvx\",\"lw\":\"xmrhu\"},\"location\":\"esutrgjupauutpw\",\"eTag\":\"hihejqgwzpnfqn\",\"id\":\"ypsxjvfoim\",\"name\":\"kslircizjxvydfc\",\"type\":\"acvlhv\"},{\"properties\":{\"provisioningState\":\"Succeeded\",\"labels\":{\"iw\":\"umrtwnawjsl\"},\"annotations\":{\"ph\":\"gcyztsfmznbae\",\"pxehuwrykqga\":\"hqnrn\",\"vkhbejdznx\":\"fmviklby\",\"lvtno\":\"vdsrhnjiv\"},\"portalFqdn\":\"fzg\",\"defaultResourceQuota\":{\"cpuRequest\":\"dftuljltduce\",\"cpuLimit\":\"tmczuomejwcwwqi\",\"memoryRequest\":\"nssxmojmsvpk\",\"memoryLimit\":\"rvkwc\"},\"defaultNetworkPolicy\":{\"ingress\":\"AllowAll\",\"egress\":\"AllowAll\"},\"adoptionPolicy\":\"Never\",\"deletePolicy\":\"Keep\"},\"tags\":{\"hmkxmaehvbb\":\"eydbsd\"},\"location\":\"ripltf\",\"eTag\":\"tbaxk\",\"id\":\"ywrckp\",\"name\":\"kl\",\"type\":\"hpluodpvruudlg\"},{\"properties\":{\"provisioningState\":\"Canceled\",\"labels\":{\"dxeclzedqbcvh\":\"stgktst\",\"dqkdlwwqfbu\":\"lhpl\"},\"annotations\":{\"lmbtxhwgfwsrt\":\"xtrqjfs\",\"kh\":\"wcoezbrhub\"},\"portalFqdn\":\"ygo\",\"defaultResourceQuota\":{\"cpuRequest\":\"kqfqjbvl\",\"cpuLimit\":\"rfmluiqtq\",\"memoryRequest\":\"avyvnqqyba\",\"memoryLimit\":\"euayjkqabqgzsles\"},\"defaultNetworkPolicy\":{\"ingress\":\"DenyAll\",\"egress\":\"AllowAll\"},\"adoptionPolicy\":\"IfIdentical\",\"deletePolicy\":\"Keep\"},\"tags\":{\"bquwrbehw\":\"djc\"},\"location\":\"o\",\"eTag\":\"uffkmrqemvvh\",\"id\":\"tdrjfutacoebj\",\"name\":\"ewzcjznmwcp\",\"type\":\"guaadraufactkahz\"}],\"nextLink\":\"ajjziuxxpshne\"}") + .toObject(ManagedNamespaceListResult.class); + Assertions.assertEquals("ycnunvjsrtk", model.value().get(0).properties().labels().get("awnopqgikyzirtxd")); + Assertions.assertEquals("uyovw", model.value().get(0).properties().annotations().get("nbkfezzxscy")); + Assertions.assertEquals("wycz", model.value().get(0).properties().defaultResourceQuota().cpuRequest()); + Assertions.assertEquals("xacpqjli", model.value().get(0).properties().defaultResourceQuota().cpuLimit()); + Assertions.assertEquals("yuspskas", model.value().get(0).properties().defaultResourceQuota().memoryRequest()); + Assertions.assertEquals("lmfwdgzx", model.value().get(0).properties().defaultResourceQuota().memoryLimit()); + Assertions.assertEquals(PolicyRule.ALLOW_ALL, + model.value().get(0).properties().defaultNetworkPolicy().ingress()); + Assertions.assertEquals(PolicyRule.DENY_ALL, model.value().get(0).properties().defaultNetworkPolicy().egress()); + Assertions.assertEquals(AdoptionPolicy.ALWAYS, model.value().get(0).properties().adoptionPolicy()); + Assertions.assertEquals(DeletePolicy.DELETE, model.value().get(0).properties().deletePolicy()); + Assertions.assertEquals("uzvx", model.value().get(0).tags().get("risjnhnytxifqjz")); + Assertions.assertEquals("esutrgjupauutpw", model.value().get(0).location()); + Assertions.assertEquals("ajjziuxxpshne", model.nextLink()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedNamespacesCreateOrUpdateMockTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedNamespacesCreateOrUpdateMockTests.java new file mode 100644 index 000000000000..2a98f357cef7 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedNamespacesCreateOrUpdateMockTests.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.containerservice.generated.ContainerServiceManager; +import com.azure.resourcemanager.containerservice.generated.models.AdoptionPolicy; +import com.azure.resourcemanager.containerservice.generated.models.DeletePolicy; +import com.azure.resourcemanager.containerservice.generated.models.ManagedNamespace; +import com.azure.resourcemanager.containerservice.generated.models.NamespaceProperties; +import com.azure.resourcemanager.containerservice.generated.models.NetworkPolicies; +import com.azure.resourcemanager.containerservice.generated.models.PolicyRule; +import com.azure.resourcemanager.containerservice.generated.models.ResourceQuota; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ManagedNamespacesCreateOrUpdateMockTests { + @Test + public void testCreateOrUpdate() throws Exception { + String responseStr + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"labels\":{\"amz\":\"uflqbctq\",\"qzeqyjleziunjxdf\":\"rwd\",\"qa\":\"antkwcegyamlbns\"},\"annotations\":{\"ooqjagmditgueio\":\"vpilg\",\"tdtpdelqacslmo\":\"kjbsah\",\"xofvcjk\":\"oebn\"},\"portalFqdn\":\"irazftxejwabmd\",\"defaultResourceQuota\":{\"cpuRequest\":\"mvcopexcmjurbuhh\",\"cpuLimit\":\"yqltqsro\",\"memoryRequest\":\"uwkffdjktsysid\",\"memoryLimit\":\"c\"},\"defaultNetworkPolicy\":{\"ingress\":\"DenyAll\",\"egress\":\"AllowAll\"},\"adoptionPolicy\":\"Always\",\"deletePolicy\":\"Keep\"},\"tags\":{\"sharujtj\":\"usqogsfikayia\",\"qhjpenuygbqe\":\"qxfzyjqttvwk\",\"guaucmfdjwnla\":\"qekewvnqvcd\"},\"location\":\"un\",\"eTag\":\"ikczvvitacgxmf\",\"id\":\"serxht\",\"name\":\"soxhlwntsjgqr\",\"type\":\"xypruuuy\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ContainerServiceManager manager = ContainerServiceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + ManagedNamespace response = manager.managedNamespaces() + .define("urmlmuo") + .withExistingManagedCluster("coc", "fjgtixrjvzuy") + .withRegion("qehgpd") + .withTags(mapOf("hwpusxj", "jlxuz")) + .withProperties(new NamespaceProperties().withLabels(mapOf("pngajin", "iropionszon")) + .withAnnotations(mapOf("xlzhcoxovnekh", "jawrtmjfjmyc", "jxtxrdc", "nlusfnrd")) + .withDefaultResourceQuota(new ResourceQuota().withCpuRequest("lvyjtcvuwkas") + .withCpuLimit("iesfuug") + .withMemoryRequest("uqfecj") + .withMemoryLimit("ygtuhx")) + .withDefaultNetworkPolicy(new NetworkPolicies().withIngress(PolicyRule.ALLOW_SAME_NAMESPACE) + .withEgress(PolicyRule.ALLOW_SAME_NAMESPACE)) + .withAdoptionPolicy(AdoptionPolicy.IF_IDENTICAL) + .withDeletePolicy(DeletePolicy.KEEP)) + .create(); + + Assertions.assertEquals("uflqbctq", response.properties().labels().get("amz")); + Assertions.assertEquals("vpilg", response.properties().annotations().get("ooqjagmditgueio")); + Assertions.assertEquals("mvcopexcmjurbuhh", response.properties().defaultResourceQuota().cpuRequest()); + Assertions.assertEquals("yqltqsro", response.properties().defaultResourceQuota().cpuLimit()); + Assertions.assertEquals("uwkffdjktsysid", response.properties().defaultResourceQuota().memoryRequest()); + Assertions.assertEquals("c", response.properties().defaultResourceQuota().memoryLimit()); + Assertions.assertEquals(PolicyRule.DENY_ALL, response.properties().defaultNetworkPolicy().ingress()); + Assertions.assertEquals(PolicyRule.ALLOW_ALL, response.properties().defaultNetworkPolicy().egress()); + Assertions.assertEquals(AdoptionPolicy.ALWAYS, response.properties().adoptionPolicy()); + Assertions.assertEquals(DeletePolicy.KEEP, response.properties().deletePolicy()); + Assertions.assertEquals("usqogsfikayia", response.tags().get("sharujtj")); + Assertions.assertEquals("un", response.location()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedNamespacesGetWithResponseMockTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedNamespacesGetWithResponseMockTests.java new file mode 100644 index 000000000000..058dd55f35ef --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedNamespacesGetWithResponseMockTests.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.containerservice.generated.ContainerServiceManager; +import com.azure.resourcemanager.containerservice.generated.models.AdoptionPolicy; +import com.azure.resourcemanager.containerservice.generated.models.DeletePolicy; +import com.azure.resourcemanager.containerservice.generated.models.ManagedNamespace; +import com.azure.resourcemanager.containerservice.generated.models.PolicyRule; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ManagedNamespacesGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"provisioningState\":\"Updating\",\"labels\":{\"kqmhhaowjr\":\"gqjxgpnrhgovfgp\",\"kfvxcnq\":\"zvuporqzdfuydz\",\"vkhlggdhbemz\":\"xqpswok\"},\"annotations\":{\"wiwtglxxhl\":\"sz\",\"gjsxv\":\"fpgpicrmnzhrgm\",\"qgvriibakcla\":\"qcbfrmbodths\"},\"portalFqdn\":\"fr\",\"defaultResourceQuota\":{\"cpuRequest\":\"usx\",\"cpuLimit\":\"zlwvsgmwohqfz\",\"memoryRequest\":\"vux\",\"memoryLimit\":\"kjsvthnwpzteko\"},\"defaultNetworkPolicy\":{\"ingress\":\"AllowSameNamespace\",\"egress\":\"AllowAll\"},\"adoptionPolicy\":\"Always\",\"deletePolicy\":\"Delete\"},\"tags\":{\"nykzcugswvxwlm\":\"ucfotangcf\"},\"location\":\"wmvtxnjm\",\"eTag\":\"cuqudtcvclxy\",\"id\":\"dkvgfabuiyjibuzp\",\"name\":\"dugneiknp\",\"type\":\"oxgjiuqhibt\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ContainerServiceManager manager = ContainerServiceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + ManagedNamespace response = manager.managedNamespaces() + .getWithResponse("niypfpubcpzg", "xtiv", "j", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("gqjxgpnrhgovfgp", response.properties().labels().get("kqmhhaowjr")); + Assertions.assertEquals("sz", response.properties().annotations().get("wiwtglxxhl")); + Assertions.assertEquals("usx", response.properties().defaultResourceQuota().cpuRequest()); + Assertions.assertEquals("zlwvsgmwohqfz", response.properties().defaultResourceQuota().cpuLimit()); + Assertions.assertEquals("vux", response.properties().defaultResourceQuota().memoryRequest()); + Assertions.assertEquals("kjsvthnwpzteko", response.properties().defaultResourceQuota().memoryLimit()); + Assertions.assertEquals(PolicyRule.ALLOW_SAME_NAMESPACE, + response.properties().defaultNetworkPolicy().ingress()); + Assertions.assertEquals(PolicyRule.ALLOW_ALL, response.properties().defaultNetworkPolicy().egress()); + Assertions.assertEquals(AdoptionPolicy.ALWAYS, response.properties().adoptionPolicy()); + Assertions.assertEquals(DeletePolicy.DELETE, response.properties().deletePolicy()); + Assertions.assertEquals("ucfotangcf", response.tags().get("nykzcugswvxwlm")); + Assertions.assertEquals("wmvtxnjm", response.location()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedNamespacesListByManagedClusterMockTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedNamespacesListByManagedClusterMockTests.java new file mode 100644 index 000000000000..a97c0bc7814f --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedNamespacesListByManagedClusterMockTests.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.containerservice.generated.ContainerServiceManager; +import com.azure.resourcemanager.containerservice.generated.models.AdoptionPolicy; +import com.azure.resourcemanager.containerservice.generated.models.DeletePolicy; +import com.azure.resourcemanager.containerservice.generated.models.ManagedNamespace; +import com.azure.resourcemanager.containerservice.generated.models.PolicyRule; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ManagedNamespacesListByManagedClusterMockTests { + @Test + public void testListByManagedCluster() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Canceled\",\"labels\":{\"kmqp\":\"ewpktvqy\"},\"annotations\":{\"oxoebqi\":\"hlfbcgwgc\",\"ujqlafcbahh\":\"jipnwj\"},\"portalFqdn\":\"pofoi\",\"defaultResourceQuota\":{\"cpuRequest\":\"p\",\"cpuLimit\":\"lkmkkholvdndvi\",\"memoryRequest\":\"ogphuartvtiu\",\"memoryLimit\":\"efchn\"},\"defaultNetworkPolicy\":{\"ingress\":\"AllowAll\",\"egress\":\"AllowSameNamespace\"},\"adoptionPolicy\":\"IfIdentical\",\"deletePolicy\":\"Delete\"},\"tags\":{\"oxffif\":\"irwrwe\",\"ozqvbubqmam\":\"xwrsnew\",\"taboidvmf\":\"sycxhxzgaz\"},\"location\":\"ppu\",\"eTag\":\"w\",\"id\":\"pdfgkmtdherngbt\",\"name\":\"juahokqto\",\"type\":\"kauxof\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ContainerServiceManager manager = ContainerServiceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.managedNamespaces().listByManagedCluster("z", "pqwjedm", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("ewpktvqy", response.iterator().next().properties().labels().get("kmqp")); + Assertions.assertEquals("hlfbcgwgc", response.iterator().next().properties().annotations().get("oxoebqi")); + Assertions.assertEquals("p", response.iterator().next().properties().defaultResourceQuota().cpuRequest()); + Assertions.assertEquals("lkmkkholvdndvi", + response.iterator().next().properties().defaultResourceQuota().cpuLimit()); + Assertions.assertEquals("ogphuartvtiu", + response.iterator().next().properties().defaultResourceQuota().memoryRequest()); + Assertions.assertEquals("efchn", response.iterator().next().properties().defaultResourceQuota().memoryLimit()); + Assertions.assertEquals(PolicyRule.ALLOW_ALL, + response.iterator().next().properties().defaultNetworkPolicy().ingress()); + Assertions.assertEquals(PolicyRule.ALLOW_SAME_NAMESPACE, + response.iterator().next().properties().defaultNetworkPolicy().egress()); + Assertions.assertEquals(AdoptionPolicy.IF_IDENTICAL, response.iterator().next().properties().adoptionPolicy()); + Assertions.assertEquals(DeletePolicy.DELETE, response.iterator().next().properties().deletePolicy()); + Assertions.assertEquals("irwrwe", response.iterator().next().tags().get("oxffif")); + Assertions.assertEquals("ppu", response.iterator().next().location()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedNamespacesListCredentialWithResponseMockTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedNamespacesListCredentialWithResponseMockTests.java new file mode 100644 index 000000000000..98058c7991c0 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedNamespacesListCredentialWithResponseMockTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.containerservice.generated.ContainerServiceManager; +import com.azure.resourcemanager.containerservice.generated.models.CredentialResults; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ManagedNamespacesListCredentialWithResponseMockTests { + @Test + public void testListCredentialWithResponse() throws Exception { + String responseStr = "{\"kubeconfigs\":[{\"name\":\"efy\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ContainerServiceManager manager = ContainerServiceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + CredentialResults response = manager.managedNamespaces() + .listCredentialWithResponse("hfphwpnulaiywze", "ywhslwkojpllndnp", "wrpqafgfugsnnf", + com.azure.core.util.Context.NONE) + .getValue(); + + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedServiceIdentityUserAssignedIdentitiesValueTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedServiceIdentityUserAssignedIdentitiesValueTests.java new file mode 100644 index 000000000000..88726c1f01fe --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedServiceIdentityUserAssignedIdentitiesValueTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ManagedServiceIdentityUserAssignedIdentitiesValue; + +public final class ManagedServiceIdentityUserAssignedIdentitiesValueTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedServiceIdentityUserAssignedIdentitiesValue model + = BinaryData.fromString("{\"principalId\":\"lve\",\"clientId\":\"lupj\"}") + .toObject(ManagedServiceIdentityUserAssignedIdentitiesValue.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedServiceIdentityUserAssignedIdentitiesValue model + = new ManagedServiceIdentityUserAssignedIdentitiesValue(); + model = BinaryData.fromObject(model).toObject(ManagedServiceIdentityUserAssignedIdentitiesValue.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManualScaleProfileTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManualScaleProfileTests.java new file mode 100644 index 000000000000..b9d33619933a --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ManualScaleProfileTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ManualScaleProfile; +import org.junit.jupiter.api.Assertions; + +public final class ManualScaleProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManualScaleProfile model + = BinaryData.fromString("{\"size\":\"ihnhun\",\"count\":1154149650}").toObject(ManualScaleProfile.class); + Assertions.assertEquals("ihnhun", model.size()); + Assertions.assertEquals(1154149650, model.count()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManualScaleProfile model = new ManualScaleProfile().withSize("ihnhun").withCount(1154149650); + model = BinaryData.fromObject(model).toObject(ManualScaleProfile.class); + Assertions.assertEquals("ihnhun", model.size()); + Assertions.assertEquals(1154149650, model.count()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MeshRevisionProfileInnerTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MeshRevisionProfileInnerTests.java new file mode 100644 index 000000000000..58fa13b3689f --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MeshRevisionProfileInnerTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.fluent.models.MeshRevisionProfileInner; +import org.junit.jupiter.api.Assertions; + +public final class MeshRevisionProfileInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MeshRevisionProfileInner model = BinaryData.fromString( + "{\"properties\":{\"meshRevisions\":[{\"revision\":\"kwhojvpaj\",\"upgrades\":[\"ysmocmbqfqvmkcxo\",\"apvhelxprgly\"],\"compatibleWith\":[{\"name\":\"ckcb\",\"versions\":[\"jrjxgciqibrhosx\",\"dqrhzoymib\",\"rq\",\"ibahwflus\"]}]},{\"revision\":\"tmhrkwofyyvoqacp\",\"upgrades\":[\"pbtg\",\"wbwo\",\"nwashrtd\"],\"compatibleWith\":[{\"name\":\"qxwbpokulpiu\",\"versions\":[\"asipqiio\",\"yuq\"]},{\"name\":\"pqlpq\",\"versions\":[\"iuqgbdbutauv\",\"btkuwhh\"]},{\"name\":\"ykojoxafnndlpic\",\"versions\":[\"ymkcdyhb\"]},{\"name\":\"kpw\",\"versions\":[\"q\",\"ovvqfovljxywsu\",\"syrsndsytgadgvra\"]}]}]},\"id\":\"en\",\"name\":\"qnzarrwl\",\"type\":\"uu\"}") + .toObject(MeshRevisionProfileInner.class); + Assertions.assertEquals("kwhojvpaj", model.properties().meshRevisions().get(0).revision()); + Assertions.assertEquals("ysmocmbqfqvmkcxo", model.properties().meshRevisions().get(0).upgrades().get(0)); + Assertions.assertEquals("ckcb", model.properties().meshRevisions().get(0).compatibleWith().get(0).name()); + Assertions.assertEquals("jrjxgciqibrhosx", + model.properties().meshRevisions().get(0).compatibleWith().get(0).versions().get(0)); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MeshRevisionProfileListTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MeshRevisionProfileListTests.java new file mode 100644 index 000000000000..22cc79f36194 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MeshRevisionProfileListTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.implementation.models.MeshRevisionProfileList; +import org.junit.jupiter.api.Assertions; + +public final class MeshRevisionProfileListTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MeshRevisionProfileList model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"meshRevisions\":[{\"revision\":\"vimjwos\",\"upgrades\":[\"itc\"],\"compatibleWith\":[{},{},{}]}]},\"id\":\"k\",\"name\":\"qumiek\",\"type\":\"ez\"}],\"nextLink\":\"khly\"}") + .toObject(MeshRevisionProfileList.class); + Assertions.assertEquals("vimjwos", model.value().get(0).properties().meshRevisions().get(0).revision()); + Assertions.assertEquals("itc", model.value().get(0).properties().meshRevisions().get(0).upgrades().get(0)); + Assertions.assertEquals("khly", model.nextLink()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MeshRevisionProfilePropertiesTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MeshRevisionProfilePropertiesTests.java new file mode 100644 index 000000000000..fb49cac063a9 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MeshRevisionProfilePropertiesTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.MeshRevisionProfileProperties; +import org.junit.jupiter.api.Assertions; + +public final class MeshRevisionProfilePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MeshRevisionProfileProperties model = BinaryData.fromString( + "{\"meshRevisions\":[{\"revision\":\"kacewiipfp\",\"upgrades\":[\"ibwwiftohqkv\"],\"compatibleWith\":[{\"name\":\"sgplsakn\",\"versions\":[\"synljphuopxodl\",\"iyntorzihle\",\"sjswsrms\"]},{\"name\":\"zrpzb\",\"versions\":[\"kqqzqioxiysu\",\"i\",\"ynkedyatrwyhqmib\",\"yhwitsmypyynpcdp\"]},{\"name\":\"nzgmwznmabik\",\"versions\":[\"rgjhxb\",\"dtlwwrlkd\",\"tncvokot\"]},{\"name\":\"xdy\",\"versions\":[\"y\",\"cogjltdtbn\",\"hadoocrk\",\"cikhnv\"]}]}]}") + .toObject(MeshRevisionProfileProperties.class); + Assertions.assertEquals("kacewiipfp", model.meshRevisions().get(0).revision()); + Assertions.assertEquals("ibwwiftohqkv", model.meshRevisions().get(0).upgrades().get(0)); + Assertions.assertEquals("sgplsakn", model.meshRevisions().get(0).compatibleWith().get(0).name()); + Assertions.assertEquals("synljphuopxodl", + model.meshRevisions().get(0).compatibleWith().get(0).versions().get(0)); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MeshRevisionTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MeshRevisionTests.java new file mode 100644 index 000000000000..a4866eb55cdd --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MeshRevisionTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.MeshRevision; +import org.junit.jupiter.api.Assertions; + +public final class MeshRevisionTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MeshRevision model = BinaryData.fromString( + "{\"revision\":\"mqg\",\"upgrades\":[\"u\",\"zikywgg\"],\"compatibleWith\":[{\"name\":\"la\",\"versions\":[\"lwuip\",\"ccjzkzivgvv\"]},{\"name\":\"ayrhyrnx\",\"versions\":[\"eedndrdvstkwqqtc\",\"ealmfmtdaaygdvwv\",\"piohgwxrtfu\"]},{\"name\":\"epxgyqagvr\",\"versions\":[\"pkukghi\",\"dblx\",\"wi\",\"fnjhfjxwmszkkfo\"]},{\"name\":\"eyfkzikfja\",\"versions\":[\"a\",\"vxwc\",\"elpcirelsfeaenwa\"]}]}") + .toObject(MeshRevision.class); + Assertions.assertEquals("mqg", model.revision()); + Assertions.assertEquals("u", model.upgrades().get(0)); + Assertions.assertEquals("la", model.compatibleWith().get(0).name()); + Assertions.assertEquals("lwuip", model.compatibleWith().get(0).versions().get(0)); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MeshUpgradeProfileInnerTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MeshUpgradeProfileInnerTests.java new file mode 100644 index 000000000000..1c068fb916e2 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MeshUpgradeProfileInnerTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.fluent.models.MeshUpgradeProfileInner; +import org.junit.jupiter.api.Assertions; + +public final class MeshUpgradeProfileInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MeshUpgradeProfileInner model = BinaryData.fromString( + "{\"properties\":{\"revision\":\"dgqggebdu\",\"upgrades\":[\"aeqidbqfatpxll\"],\"compatibleWith\":[{\"name\":\"jmoadsuv\",\"versions\":[\"ywdmjsjqbjh\"]},{\"name\":\"x\",\"versions\":[\"lyc\",\"duhpk\",\"kgymareqnajxqug\",\"hky\"]},{\"name\":\"beddgssofw\",\"versions\":[\"qal\",\"rmnjijpx\",\"cqqudf\",\"byxbaaabjy\"]},{\"name\":\"yffimrzrtuzqogs\",\"versions\":[\"evfdnwnwm\",\"wzsyyceuzs\"]}]},\"id\":\"bjudpfrxtrthzv\",\"name\":\"ytdw\",\"type\":\"qbrqubpaxhexiili\"}") + .toObject(MeshUpgradeProfileInner.class); + Assertions.assertEquals("dgqggebdu", model.properties().revision()); + Assertions.assertEquals("aeqidbqfatpxll", model.properties().upgrades().get(0)); + Assertions.assertEquals("jmoadsuv", model.properties().compatibleWith().get(0).name()); + Assertions.assertEquals("ywdmjsjqbjh", model.properties().compatibleWith().get(0).versions().get(0)); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MeshUpgradeProfileListTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MeshUpgradeProfileListTests.java new file mode 100644 index 000000000000..ab3e1bd54e75 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MeshUpgradeProfileListTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.implementation.models.MeshUpgradeProfileList; +import org.junit.jupiter.api.Assertions; + +public final class MeshUpgradeProfileListTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MeshUpgradeProfileList model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"revision\":\"f\",\"upgrades\":[\"foakgg\",\"fpagaowpulp\"],\"compatibleWith\":[{\"name\":\"lsyxkqjnsjervt\",\"versions\":[\"xsdszuempsb\",\"kfzbeyvpnqicvi\"]}]},\"id\":\"kjj\",\"name\":\"dxrbuukzcle\",\"type\":\"yhmlwpaztzp\"},{\"properties\":{\"revision\":\"cckwyfzqwhxxbu\",\"upgrades\":[\"xzfe\"],\"compatibleWith\":[{\"name\":\"priolx\",\"versions\":[\"altol\",\"ncwsob\",\"wcsdbnwdcfhucq\"]}]},\"id\":\"fuvglsbjjca\",\"name\":\"vxb\",\"type\":\"t\"},{\"properties\":{\"revision\":\"utncorm\",\"upgrades\":[\"qtvcofudflvkgj\",\"bgdknnqv\"],\"compatibleWith\":[{\"name\":\"qntorudsgsahmkyc\",\"versions\":[\"uwjuetaeburuvdmo\",\"s\",\"zlxwabmqoefkifr\"]},{\"name\":\"puqujmqlgkfbtn\",\"versions\":[\"ongbjcnt\",\"jitcjedftwwaez\"]}]},\"id\":\"jvdcpzfoqouic\",\"name\":\"bxarzgszufoxci\",\"type\":\"opidoamciodh\"},{\"properties\":{\"revision\":\"zxkhnzbonlwnto\",\"upgrades\":[\"kdwbwhkszz\",\"mrv\"],\"compatibleWith\":[{\"name\":\"vbtqgsfraoyzk\",\"versions\":[\"tlmngu\"]},{\"name\":\"wqaldsyu\",\"versions\":[\"merqfobwyznkb\",\"kutwpf\",\"pagmhrskdsnf\",\"sd\"]},{\"name\":\"kgtdlmkkze\",\"versions\":[\"hewpusdsttwv\"]}]},\"id\":\"vbbejdcng\",\"name\":\"qmoa\",\"type\":\"ufgmjzrwrdg\"}],\"nextLink\":\"wae\"}") + .toObject(MeshUpgradeProfileList.class); + Assertions.assertEquals("f", model.value().get(0).properties().revision()); + Assertions.assertEquals("foakgg", model.value().get(0).properties().upgrades().get(0)); + Assertions.assertEquals("lsyxkqjnsjervt", model.value().get(0).properties().compatibleWith().get(0).name()); + Assertions.assertEquals("xsdszuempsb", + model.value().get(0).properties().compatibleWith().get(0).versions().get(0)); + Assertions.assertEquals("wae", model.nextLink()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MeshUpgradeProfilePropertiesTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MeshUpgradeProfilePropertiesTests.java new file mode 100644 index 000000000000..48fb3f705ed7 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/MeshUpgradeProfilePropertiesTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.MeshUpgradeProfileProperties; +import org.junit.jupiter.api.Assertions; + +public final class MeshUpgradeProfilePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MeshUpgradeProfileProperties model = BinaryData.fromString( + "{\"revision\":\"dtiirqt\",\"upgrades\":[\"axoruzfgsquy\",\"xrxxlep\",\"ramxjezwlwnw\"],\"compatibleWith\":[{\"name\":\"cvydypatdoo\",\"versions\":[\"kniod\",\"oo\"]},{\"name\":\"wnujhemmsbvdk\",\"versions\":[\"dtjinfw\",\"lfltka\"]}]}") + .toObject(MeshUpgradeProfileProperties.class); + Assertions.assertEquals("dtiirqt", model.revision()); + Assertions.assertEquals("axoruzfgsquy", model.upgrades().get(0)); + Assertions.assertEquals("cvydypatdoo", model.compatibleWith().get(0).name()); + Assertions.assertEquals("kniod", model.compatibleWith().get(0).versions().get(0)); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/NamespacePropertiesTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/NamespacePropertiesTests.java new file mode 100644 index 000000000000..5d297e5cce2b --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/NamespacePropertiesTests.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.AdoptionPolicy; +import com.azure.resourcemanager.containerservice.generated.models.DeletePolicy; +import com.azure.resourcemanager.containerservice.generated.models.NamespaceProperties; +import com.azure.resourcemanager.containerservice.generated.models.NetworkPolicies; +import com.azure.resourcemanager.containerservice.generated.models.PolicyRule; +import com.azure.resourcemanager.containerservice.generated.models.ResourceQuota; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class NamespacePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + NamespaceProperties model = BinaryData.fromString( + "{\"provisioningState\":\"Updating\",\"labels\":{\"wjchrdg\":\"wqknfdn\"},\"annotations\":{\"ctondz\":\"xum\",\"tov\":\"luudfdlwggytsb\",\"irgne\":\"tgseinqfiufxqkn\"},\"portalFqdn\":\"twqmsniffcdmqnr\",\"defaultResourceQuota\":{\"cpuRequest\":\"pij\",\"cpuLimit\":\"rxfrddhc\",\"memoryRequest\":\"tizzronasxif\",\"memoryLimit\":\"zq\"},\"defaultNetworkPolicy\":{\"ingress\":\"DenyAll\",\"egress\":\"AllowSameNamespace\"},\"adoptionPolicy\":\"Always\",\"deletePolicy\":\"Delete\"}") + .toObject(NamespaceProperties.class); + Assertions.assertEquals("wqknfdn", model.labels().get("wjchrdg")); + Assertions.assertEquals("xum", model.annotations().get("ctondz")); + Assertions.assertEquals("pij", model.defaultResourceQuota().cpuRequest()); + Assertions.assertEquals("rxfrddhc", model.defaultResourceQuota().cpuLimit()); + Assertions.assertEquals("tizzronasxif", model.defaultResourceQuota().memoryRequest()); + Assertions.assertEquals("zq", model.defaultResourceQuota().memoryLimit()); + Assertions.assertEquals(PolicyRule.DENY_ALL, model.defaultNetworkPolicy().ingress()); + Assertions.assertEquals(PolicyRule.ALLOW_SAME_NAMESPACE, model.defaultNetworkPolicy().egress()); + Assertions.assertEquals(AdoptionPolicy.ALWAYS, model.adoptionPolicy()); + Assertions.assertEquals(DeletePolicy.DELETE, model.deletePolicy()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + NamespaceProperties model = new NamespaceProperties().withLabels(mapOf("wjchrdg", "wqknfdn")) + .withAnnotations(mapOf("ctondz", "xum", "tov", "luudfdlwggytsb", "irgne", "tgseinqfiufxqkn")) + .withDefaultResourceQuota(new ResourceQuota().withCpuRequest("pij") + .withCpuLimit("rxfrddhc") + .withMemoryRequest("tizzronasxif") + .withMemoryLimit("zq")) + .withDefaultNetworkPolicy( + new NetworkPolicies().withIngress(PolicyRule.DENY_ALL).withEgress(PolicyRule.ALLOW_SAME_NAMESPACE)) + .withAdoptionPolicy(AdoptionPolicy.ALWAYS) + .withDeletePolicy(DeletePolicy.DELETE); + model = BinaryData.fromObject(model).toObject(NamespaceProperties.class); + Assertions.assertEquals("wqknfdn", model.labels().get("wjchrdg")); + Assertions.assertEquals("xum", model.annotations().get("ctondz")); + Assertions.assertEquals("pij", model.defaultResourceQuota().cpuRequest()); + Assertions.assertEquals("rxfrddhc", model.defaultResourceQuota().cpuLimit()); + Assertions.assertEquals("tizzronasxif", model.defaultResourceQuota().memoryRequest()); + Assertions.assertEquals("zq", model.defaultResourceQuota().memoryLimit()); + Assertions.assertEquals(PolicyRule.DENY_ALL, model.defaultNetworkPolicy().ingress()); + Assertions.assertEquals(PolicyRule.ALLOW_SAME_NAMESPACE, model.defaultNetworkPolicy().egress()); + Assertions.assertEquals(AdoptionPolicy.ALWAYS, model.adoptionPolicy()); + Assertions.assertEquals(DeletePolicy.DELETE, model.deletePolicy()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/NetworkPoliciesTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/NetworkPoliciesTests.java new file mode 100644 index 000000000000..8693c30b13d3 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/NetworkPoliciesTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.NetworkPolicies; +import com.azure.resourcemanager.containerservice.generated.models.PolicyRule; +import org.junit.jupiter.api.Assertions; + +public final class NetworkPoliciesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + NetworkPolicies model = BinaryData.fromString("{\"ingress\":\"AllowAll\",\"egress\":\"AllowAll\"}") + .toObject(NetworkPolicies.class); + Assertions.assertEquals(PolicyRule.ALLOW_ALL, model.ingress()); + Assertions.assertEquals(PolicyRule.ALLOW_ALL, model.egress()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + NetworkPolicies model + = new NetworkPolicies().withIngress(PolicyRule.ALLOW_ALL).withEgress(PolicyRule.ALLOW_ALL); + model = BinaryData.fromObject(model).toObject(NetworkPolicies.class); + Assertions.assertEquals(PolicyRule.ALLOW_ALL, model.ingress()); + Assertions.assertEquals(PolicyRule.ALLOW_ALL, model.egress()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/OperationListResultTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/OperationListResultTests.java new file mode 100644 index 000000000000..7ce215745637 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/OperationListResultTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.implementation.models.OperationListResult; +import org.junit.jupiter.api.Assertions; + +public final class OperationListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationListResult model = BinaryData.fromString( + "{\"value\":[{\"origin\":\"nhnzeyqxt\",\"name\":\"fzqlqhycavod\",\"display\":{\"operation\":\"dbeesmie\",\"resource\":\"lrariaawiu\",\"description\":\"ydwqfbylyrf\",\"provider\":\"agt\"}}],\"nextLink\":\"jocqwogfnzjvusf\"}") + .toObject(OperationListResult.class); + Assertions.assertEquals("jocqwogfnzjvusf", model.nextLink()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/OperationValueDisplayTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/OperationValueDisplayTests.java new file mode 100644 index 000000000000..14e862e0333b --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/OperationValueDisplayTests.java @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.fluent.models.OperationValueDisplay; + +public final class OperationValueDisplayTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationValueDisplay model = BinaryData + .fromString( + "{\"operation\":\"qtz\",\"resource\":\"rgnowcjhfgm\",\"description\":\"cact\",\"provider\":\"wotey\"}") + .toObject(OperationValueDisplay.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/OperationValueInnerTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/OperationValueInnerTests.java new file mode 100644 index 000000000000..21d9157e6469 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/OperationValueInnerTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.fluent.models.OperationValueInner; + +public final class OperationValueInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationValueInner model = BinaryData.fromString( + "{\"origin\":\"dmozu\",\"name\":\"lfsbtkadpysow\",\"display\":{\"operation\":\"gkbugrjqct\",\"resource\":\"cmisofie\",\"description\":\"efojyqdhcupl\",\"provider\":\"lcwkhihihlhz\"}}") + .toObject(OperationValueInner.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/OperationsListMockTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/OperationsListMockTests.java new file mode 100644 index 000000000000..e24a368ff5d2 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/OperationsListMockTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.containerservice.generated.ContainerServiceManager; +import com.azure.resourcemanager.containerservice.generated.models.OperationValue; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class OperationsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"origin\":\"ktgj\",\"name\":\"gguxhemlwyw\",\"display\":{\"operation\":\"czg\",\"resource\":\"ukklelss\",\"description\":\"lycsxz\",\"provider\":\"ksrl\"}}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ContainerServiceManager manager = ContainerServiceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/OutboundEnvironmentEndpointCollectionTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/OutboundEnvironmentEndpointCollectionTests.java new file mode 100644 index 000000000000..79a3d246ec1d --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/OutboundEnvironmentEndpointCollectionTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.implementation.models.OutboundEnvironmentEndpointCollection; +import org.junit.jupiter.api.Assertions; + +public final class OutboundEnvironmentEndpointCollectionTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OutboundEnvironmentEndpointCollection model = BinaryData.fromString( + "{\"value\":[{\"category\":\"xknalaulppg\",\"endpoints\":[{\"domainName\":\"napnyiropuhpigv\",\"endpointDetails\":[{},{},{},{}]},{\"domainName\":\"gqgitxmedjvcsl\",\"endpointDetails\":[{},{}]},{\"domainName\":\"wncwzzhxgktrmg\",\"endpointDetails\":[{},{},{}]},{\"domainName\":\"pkteo\",\"endpointDetails\":[{},{}]}]},{\"category\":\"pt\",\"endpoints\":[{\"domainName\":\"pfqbuaceopzf\",\"endpointDetails\":[{},{}]},{\"domainName\":\"uaopppcqeq\",\"endpointDetails\":[{},{},{},{}]}]},{\"category\":\"dahzxctobg\",\"endpoints\":[{\"domainName\":\"oizpostmgrcfbun\",\"endpointDetails\":[{},{},{},{}]},{\"domainName\":\"jhhkxbp\",\"endpointDetails\":[{},{},{},{}]},{\"domainName\":\"jhxxjyn\",\"endpointDetails\":[{},{}]}]},{\"category\":\"vkr\",\"endpoints\":[{\"domainName\":\"xqzvszjfa\",\"endpointDetails\":[{}]},{\"domainName\":\"dxxiv\",\"endpointDetails\":[{},{},{}]},{\"domainName\":\"cqaqtdoqmcbx\",\"endpointDetails\":[{},{}]}]}],\"nextLink\":\"yslqbhsfx\"}") + .toObject(OutboundEnvironmentEndpointCollection.class); + Assertions.assertEquals("xknalaulppg", model.value().get(0).category()); + Assertions.assertEquals("napnyiropuhpigv", model.value().get(0).endpoints().get(0).domainName()); + Assertions.assertEquals("yslqbhsfx", model.nextLink()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/OutboundEnvironmentEndpointInnerTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/OutboundEnvironmentEndpointInnerTests.java new file mode 100644 index 000000000000..bfdfbadbf691 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/OutboundEnvironmentEndpointInnerTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.fluent.models.OutboundEnvironmentEndpointInner; +import org.junit.jupiter.api.Assertions; + +public final class OutboundEnvironmentEndpointInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OutboundEnvironmentEndpointInner model = BinaryData.fromString( + "{\"category\":\"lyt\",\"endpoints\":[{\"domainName\":\"pe\",\"endpointDetails\":[{\"ipAddress\":\"bkrvrnsvshqj\",\"port\":475216783,\"protocol\":\"rsbfovasrruvw\",\"description\":\"sqfsubcgjbirxb\"},{\"ipAddress\":\"bsrfbj\",\"port\":837542479,\"protocol\":\"ssotftpv\",\"description\":\"bexilzznfqqnv\"},{\"ipAddress\":\"mqtaruoujmkcjh\",\"port\":1420775781,\"protocol\":\"jrybnwjewgdrjer\",\"description\":\"aen\"}]},{\"domainName\":\"eh\",\"endpointDetails\":[{\"ipAddress\":\"ygmi\",\"port\":1448466618,\"protocol\":\"zdnds\",\"description\":\"nayqi\"}]},{\"domainName\":\"nduhavhqlkthum\",\"endpointDetails\":[{\"ipAddress\":\"bgycduiertgccym\",\"port\":50940581,\"protocol\":\"psslqlfmm\",\"description\":\"bbglzpswiydmc\"},{\"ipAddress\":\"hzdxssadbzm\",\"port\":487755858,\"protocol\":\"znud\",\"description\":\"dvxzbncblylpst\"},{\"ipAddress\":\"hh\",\"port\":1188392360,\"protocol\":\"dzu\",\"description\":\"rsc\"},{\"ipAddress\":\"t\",\"port\":1008975068,\"protocol\":\"iwjmygtdssls\",\"description\":\"mweriofzpy\"}]}]}") + .toObject(OutboundEnvironmentEndpointInner.class); + Assertions.assertEquals("lyt", model.category()); + Assertions.assertEquals("pe", model.endpoints().get(0).domainName()); + Assertions.assertEquals("bkrvrnsvshqj", model.endpoints().get(0).endpointDetails().get(0).ipAddress()); + Assertions.assertEquals(475216783, model.endpoints().get(0).endpointDetails().get(0).port()); + Assertions.assertEquals("rsbfovasrruvw", model.endpoints().get(0).endpointDetails().get(0).protocol()); + Assertions.assertEquals("sqfsubcgjbirxb", model.endpoints().get(0).endpointDetails().get(0).description()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PortRangeTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PortRangeTests.java new file mode 100644 index 000000000000..c8abc4a4d67e --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PortRangeTests.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.PortRange; +import com.azure.resourcemanager.containerservice.generated.models.Protocol; +import org.junit.jupiter.api.Assertions; + +public final class PortRangeTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PortRange model + = BinaryData.fromString("{\"portStart\":1792293314,\"portEnd\":1962979170,\"protocol\":\"TCP\"}") + .toObject(PortRange.class); + Assertions.assertEquals(1792293314, model.portStart()); + Assertions.assertEquals(1962979170, model.portEnd()); + Assertions.assertEquals(Protocol.TCP, model.protocol()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PortRange model = new PortRange().withPortStart(1792293314).withPortEnd(1962979170).withProtocol(Protocol.TCP); + model = BinaryData.fromObject(model).toObject(PortRange.class); + Assertions.assertEquals(1792293314, model.portStart()); + Assertions.assertEquals(1962979170, model.portEnd()); + Assertions.assertEquals(Protocol.TCP, model.protocol()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionInnerTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionInnerTests.java new file mode 100644 index 000000000000..9a3fb31d67e4 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionInnerTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.containerservice.generated.models.ConnectionStatus; +import com.azure.resourcemanager.containerservice.generated.models.PrivateEndpoint; +import com.azure.resourcemanager.containerservice.generated.models.PrivateLinkServiceConnectionState; +import org.junit.jupiter.api.Assertions; + +public final class PrivateEndpointConnectionInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateEndpointConnectionInner model = BinaryData.fromString( + "{\"properties\":{\"provisioningState\":\"Creating\",\"privateEndpoint\":{\"id\":\"avu\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"joxoism\"}},\"id\":\"sbpimlq\",\"name\":\"ljxkcgxxlx\",\"type\":\"ffgcvizqz\"}") + .toObject(PrivateEndpointConnectionInner.class); + Assertions.assertEquals("avu", model.privateEndpoint().id()); + Assertions.assertEquals(ConnectionStatus.REJECTED, model.privateLinkServiceConnectionState().status()); + Assertions.assertEquals("joxoism", model.privateLinkServiceConnectionState().description()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PrivateEndpointConnectionInner model + = new PrivateEndpointConnectionInner().withPrivateEndpoint(new PrivateEndpoint().withId("avu")) + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState().withStatus(ConnectionStatus.REJECTED) + .withDescription("joxoism")); + model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionInner.class); + Assertions.assertEquals("avu", model.privateEndpoint().id()); + Assertions.assertEquals(ConnectionStatus.REJECTED, model.privateLinkServiceConnectionState().status()); + Assertions.assertEquals("joxoism", model.privateLinkServiceConnectionState().description()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionListResultInnerTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionListResultInnerTests.java new file mode 100644 index 000000000000..bbd34627f62e --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionListResultInnerTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateEndpointConnectionListResultInner; +import com.azure.resourcemanager.containerservice.generated.models.ConnectionStatus; +import org.junit.jupiter.api.Assertions; + +public final class PrivateEndpointConnectionListResultInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateEndpointConnectionListResultInner model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"provisioningState\":\"Deleting\",\"privateEndpoint\":{\"id\":\"ctxtgzukxi\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"tg\"}},\"id\":\"q\",\"name\":\"hrnxrxc\",\"type\":\"juisavokqdzf\"}]}") + .toObject(PrivateEndpointConnectionListResultInner.class); + Assertions.assertEquals("ctxtgzukxi", model.value().get(0).privateEndpoint().id()); + Assertions.assertEquals(ConnectionStatus.PENDING, + model.value().get(0).privateLinkServiceConnectionState().status()); + Assertions.assertEquals("tg", model.value().get(0).privateLinkServiceConnectionState().description()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionPropertiesTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionPropertiesTests.java new file mode 100644 index 000000000000..84ca26672647 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionPropertiesTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateEndpointConnectionProperties; +import com.azure.resourcemanager.containerservice.generated.models.ConnectionStatus; +import com.azure.resourcemanager.containerservice.generated.models.PrivateEndpoint; +import com.azure.resourcemanager.containerservice.generated.models.PrivateLinkServiceConnectionState; +import org.junit.jupiter.api.Assertions; + +public final class PrivateEndpointConnectionPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateEndpointConnectionProperties model = BinaryData.fromString( + "{\"provisioningState\":\"Succeeded\",\"privateEndpoint\":{\"id\":\"lyoupfgfbkju\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"gkfmins\"}}") + .toObject(PrivateEndpointConnectionProperties.class); + Assertions.assertEquals("lyoupfgfbkju", model.privateEndpoint().id()); + Assertions.assertEquals(ConnectionStatus.PENDING, model.privateLinkServiceConnectionState().status()); + Assertions.assertEquals("gkfmins", model.privateLinkServiceConnectionState().description()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PrivateEndpointConnectionProperties model = new PrivateEndpointConnectionProperties() + .withPrivateEndpoint(new PrivateEndpoint().withId("lyoupfgfbkju")) + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState().withStatus(ConnectionStatus.PENDING) + .withDescription("gkfmins")); + model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionProperties.class); + Assertions.assertEquals("lyoupfgfbkju", model.privateEndpoint().id()); + Assertions.assertEquals(ConnectionStatus.PENDING, model.privateLinkServiceConnectionState().status()); + Assertions.assertEquals("gkfmins", model.privateLinkServiceConnectionState().description()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionsDeleteMockTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionsDeleteMockTests.java new file mode 100644 index 000000000000..a4c139963012 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionsDeleteMockTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.containerservice.generated.ContainerServiceManager; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class PrivateEndpointConnectionsDeleteMockTests { + @Test + public void testDelete() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ContainerServiceManager manager = ContainerServiceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.privateEndpointConnections().delete("vwe", "oxoyyukp", "aimmoiroqb", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java new file mode 100644 index 000000000000..2250d1854fcf --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.containerservice.generated.ContainerServiceManager; +import com.azure.resourcemanager.containerservice.generated.models.ConnectionStatus; +import com.azure.resourcemanager.containerservice.generated.models.PrivateEndpointConnection; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class PrivateEndpointConnectionsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"privateEndpoint\":{\"id\":\"ct\"},\"privateLinkServiceConnectionState\":{\"status\":\"Disconnected\",\"description\":\"tddmf\"}},\"id\":\"uytxzvtznapxban\",\"name\":\"o\",\"type\":\"voxczytpr\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ContainerServiceManager manager = ContainerServiceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PrivateEndpointConnection response = manager.privateEndpointConnections() + .getWithResponse("ymc", "ngnbdxxew", "ninvudbchaqdt", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("ct", response.privateEndpoint().id()); + Assertions.assertEquals(ConnectionStatus.DISCONNECTED, response.privateLinkServiceConnectionState().status()); + Assertions.assertEquals("tddmf", response.privateLinkServiceConnectionState().description()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionsListWithResponseMockTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionsListWithResponseMockTests.java new file mode 100644 index 000000000000..0371bbe2c07b --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionsListWithResponseMockTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.containerservice.generated.ContainerServiceManager; +import com.azure.resourcemanager.containerservice.generated.models.ConnectionStatus; +import com.azure.resourcemanager.containerservice.generated.models.PrivateEndpointConnectionListResult; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class PrivateEndpointConnectionsListWithResponseMockTests { + @Test + public void testListWithResponse() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Canceled\",\"privateEndpoint\":{\"id\":\"dbwnu\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"xkumasjcaac\"}},\"id\":\"mmcpug\",\"name\":\"ehqepvufhbzehe\",\"type\":\"hoqhnl\"},{\"properties\":{\"provisioningState\":\"Creating\",\"privateEndpoint\":{\"id\":\"xeaclgsc\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"mkrsrrmoucsofl\"}},\"id\":\"uviyfcaabeo\",\"name\":\"hbhlvbm\",\"type\":\"uqibsxtkcu\"},{\"properties\":{\"provisioningState\":\"Canceled\",\"privateEndpoint\":{\"id\":\"rfsiowlkjxn\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"gf\"}},\"id\":\"mhqykizmdksa\",\"name\":\"afclu\",\"type\":\"v\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ContainerServiceManager manager = ContainerServiceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PrivateEndpointConnectionListResult response = manager.privateEndpointConnections() + .listWithResponse("shbraga", "yyrmfsvbp", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("dbwnu", response.value().get(0).privateEndpoint().id()); + Assertions.assertEquals(ConnectionStatus.APPROVED, + response.value().get(0).privateLinkServiceConnectionState().status()); + Assertions.assertEquals("xkumasjcaac", + response.value().get(0).privateLinkServiceConnectionState().description()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionsUpdateWithResponseMockTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionsUpdateWithResponseMockTests.java new file mode 100644 index 000000000000..81e46baec896 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionsUpdateWithResponseMockTests.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.containerservice.generated.ContainerServiceManager; +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.containerservice.generated.models.ConnectionStatus; +import com.azure.resourcemanager.containerservice.generated.models.PrivateEndpoint; +import com.azure.resourcemanager.containerservice.generated.models.PrivateEndpointConnection; +import com.azure.resourcemanager.containerservice.generated.models.PrivateLinkServiceConnectionState; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class PrivateEndpointConnectionsUpdateWithResponseMockTests { + @Test + public void testUpdateWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"privateEndpoint\":{\"id\":\"awpcbbnzqcykn\"},\"privateLinkServiceConnectionState\":{\"status\":\"Disconnected\",\"description\":\"fyuicdh\"}},\"id\":\"dyb\",\"name\":\"wgbdvibidmhmwffp\",\"type\":\"fmuvapckccr\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ContainerServiceManager manager = ContainerServiceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PrivateEndpointConnection response = manager.privateEndpointConnections() + .updateWithResponse("nwvroevytlyokrr", "o", "uxvnsasbcrymodi", + new PrivateEndpointConnectionInner().withPrivateEndpoint(new PrivateEndpoint().withId("bdxnaz")) + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState().withStatus(ConnectionStatus.PENDING) + .withDescription("lmv")), + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("awpcbbnzqcykn", response.privateEndpoint().id()); + Assertions.assertEquals(ConnectionStatus.DISCONNECTED, response.privateLinkServiceConnectionState().status()); + Assertions.assertEquals("fyuicdh", response.privateLinkServiceConnectionState().description()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointTests.java new file mode 100644 index 000000000000..509459e1aa78 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.PrivateEndpoint; +import org.junit.jupiter.api.Assertions; + +public final class PrivateEndpointTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateEndpoint model = BinaryData.fromString("{\"id\":\"wzf\"}").toObject(PrivateEndpoint.class); + Assertions.assertEquals("wzf", model.id()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PrivateEndpoint model = new PrivateEndpoint().withId("wzf"); + model = BinaryData.fromObject(model).toObject(PrivateEndpoint.class); + Assertions.assertEquals("wzf", model.id()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateLinkResourceInnerTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateLinkResourceInnerTests.java new file mode 100644 index 000000000000..094ea75f8df3 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateLinkResourceInnerTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateLinkResourceInner; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class PrivateLinkResourceInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateLinkResourceInner model = BinaryData.fromString( + "{\"id\":\"vfcivfsnkymuc\",\"name\":\"hjfbebrjcxe\",\"type\":\"uwutttxfvjrbi\",\"groupId\":\"hxepcyvahfnlj\",\"requiredMembers\":[\"xjvuujqgidokg\"],\"privateLinkServiceID\":\"jyoxgvclt\"}") + .toObject(PrivateLinkResourceInner.class); + Assertions.assertEquals("vfcivfsnkymuc", model.id()); + Assertions.assertEquals("hjfbebrjcxe", model.name()); + Assertions.assertEquals("uwutttxfvjrbi", model.type()); + Assertions.assertEquals("hxepcyvahfnlj", model.groupId()); + Assertions.assertEquals("xjvuujqgidokg", model.requiredMembers().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PrivateLinkResourceInner model = new PrivateLinkResourceInner().withId("vfcivfsnkymuc") + .withName("hjfbebrjcxe") + .withType("uwutttxfvjrbi") + .withGroupId("hxepcyvahfnlj") + .withRequiredMembers(Arrays.asList("xjvuujqgidokg")); + model = BinaryData.fromObject(model).toObject(PrivateLinkResourceInner.class); + Assertions.assertEquals("vfcivfsnkymuc", model.id()); + Assertions.assertEquals("hjfbebrjcxe", model.name()); + Assertions.assertEquals("uwutttxfvjrbi", model.type()); + Assertions.assertEquals("hxepcyvahfnlj", model.groupId()); + Assertions.assertEquals("xjvuujqgidokg", model.requiredMembers().get(0)); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateLinkResourcesListResultInnerTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateLinkResourcesListResultInnerTests.java new file mode 100644 index 000000000000..b12115d4fbd0 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateLinkResourcesListResultInnerTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateLinkResourcesListResultInner; +import org.junit.jupiter.api.Assertions; + +public final class PrivateLinkResourcesListResultInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateLinkResourcesListResultInner model = BinaryData.fromString( + "{\"value\":[{\"id\":\"uqovekqvgqouwif\",\"name\":\"pjwyiv\",\"type\":\"kfxcvhrfs\",\"groupId\":\"uagrttikteusqc\",\"requiredMembers\":[\"yklxubyjaffmmfbl\",\"qcuubgqibrta\"],\"privateLinkServiceID\":\"etttwgdslqxihhr\"},{\"id\":\"oi\",\"name\":\"seypxiutcxapz\",\"type\":\"rpetogebjoxsl\",\"groupId\":\"nhl\",\"requiredMembers\":[\"q\",\"kkzjcjbtrga\",\"hvv\"],\"privateLinkServiceID\":\"rxjjstoqbeitpk\"},{\"id\":\"tmo\",\"name\":\"klf\",\"type\":\"dgfcwqmp\",\"groupId\":\"aqxzhemjyho\",\"requiredMembers\":[\"swtwkozzwc\",\"lkb\",\"wpfaj\"],\"privateLinkServiceID\":\"wltlwtjjguktalh\"},{\"id\":\"vkcdmxzr\",\"name\":\"aimlnwiaaom\",\"type\":\"weazul\",\"groupId\":\"ethwwnpjhlfz\",\"requiredMembers\":[\"ch\",\"ahfbous\"],\"privateLinkServiceID\":\"epgfew\"}]}") + .toObject(PrivateLinkResourcesListResultInner.class); + Assertions.assertEquals("uqovekqvgqouwif", model.value().get(0).id()); + Assertions.assertEquals("pjwyiv", model.value().get(0).name()); + Assertions.assertEquals("kfxcvhrfs", model.value().get(0).type()); + Assertions.assertEquals("uagrttikteusqc", model.value().get(0).groupId()); + Assertions.assertEquals("yklxubyjaffmmfbl", model.value().get(0).requiredMembers().get(0)); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateLinkResourcesListWithResponseMockTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateLinkResourcesListWithResponseMockTests.java new file mode 100644 index 000000000000..f8800ac91db5 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateLinkResourcesListWithResponseMockTests.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.containerservice.generated.ContainerServiceManager; +import com.azure.resourcemanager.containerservice.generated.models.PrivateLinkResourcesListResult; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class PrivateLinkResourcesListWithResponseMockTests { + @Test + public void testListWithResponse() throws Exception { + String responseStr + = "{\"value\":[{\"id\":\"owx\",\"name\":\"piudeugfsxzecpa\",\"type\":\"kufykhvu\",\"groupId\":\"epmrut\",\"requiredMembers\":[\"baobn\",\"lujdjltymkmv\",\"uihywart\",\"pphkixkykxds\"],\"privateLinkServiceID\":\"pemmucfxhik\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ContainerServiceManager manager = ContainerServiceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PrivateLinkResourcesListResult response = manager.privateLinkResources() + .listWithResponse("mdesqp", "pvmjcdoewbid", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("owx", response.value().get(0).id()); + Assertions.assertEquals("piudeugfsxzecpa", response.value().get(0).name()); + Assertions.assertEquals("kufykhvu", response.value().get(0).type()); + Assertions.assertEquals("epmrut", response.value().get(0).groupId()); + Assertions.assertEquals("baobn", response.value().get(0).requiredMembers().get(0)); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateLinkServiceConnectionStateTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateLinkServiceConnectionStateTests.java new file mode 100644 index 000000000000..366cd6470609 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateLinkServiceConnectionStateTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ConnectionStatus; +import com.azure.resourcemanager.containerservice.generated.models.PrivateLinkServiceConnectionState; +import org.junit.jupiter.api.Assertions; + +public final class PrivateLinkServiceConnectionStateTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateLinkServiceConnectionState model + = BinaryData.fromString("{\"status\":\"Rejected\",\"description\":\"t\"}") + .toObject(PrivateLinkServiceConnectionState.class); + Assertions.assertEquals(ConnectionStatus.REJECTED, model.status()); + Assertions.assertEquals("t", model.description()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PrivateLinkServiceConnectionState model + = new PrivateLinkServiceConnectionState().withStatus(ConnectionStatus.REJECTED).withDescription("t"); + model = BinaryData.fromObject(model).toObject(PrivateLinkServiceConnectionState.class); + Assertions.assertEquals(ConnectionStatus.REJECTED, model.status()); + Assertions.assertEquals("t", model.description()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/RelativeMonthlyScheduleTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/RelativeMonthlyScheduleTests.java new file mode 100644 index 000000000000..330a8e4f0ce7 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/RelativeMonthlyScheduleTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.RelativeMonthlySchedule; +import com.azure.resourcemanager.containerservice.generated.models.Type; +import com.azure.resourcemanager.containerservice.generated.models.WeekDay; +import org.junit.jupiter.api.Assertions; + +public final class RelativeMonthlyScheduleTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RelativeMonthlySchedule model + = BinaryData.fromString("{\"intervalMonths\":1182689505,\"weekIndex\":\"Last\",\"dayOfWeek\":\"Thursday\"}") + .toObject(RelativeMonthlySchedule.class); + Assertions.assertEquals(1182689505, model.intervalMonths()); + Assertions.assertEquals(Type.LAST, model.weekIndex()); + Assertions.assertEquals(WeekDay.THURSDAY, model.dayOfWeek()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RelativeMonthlySchedule model = new RelativeMonthlySchedule().withIntervalMonths(1182689505) + .withWeekIndex(Type.LAST) + .withDayOfWeek(WeekDay.THURSDAY); + model = BinaryData.fromObject(model).toObject(RelativeMonthlySchedule.class); + Assertions.assertEquals(1182689505, model.intervalMonths()); + Assertions.assertEquals(Type.LAST, model.weekIndex()); + Assertions.assertEquals(WeekDay.THURSDAY, model.dayOfWeek()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ResolvePrivateLinkServiceIdsPOSTWithResponseMockTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ResolvePrivateLinkServiceIdsPOSTWithResponseMockTests.java new file mode 100644 index 000000000000..ab474ab26877 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ResolvePrivateLinkServiceIdsPOSTWithResponseMockTests.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.containerservice.generated.ContainerServiceManager; +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.containerservice.generated.models.PrivateLinkResource; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ResolvePrivateLinkServiceIdsPOSTWithResponseMockTests { + @Test + public void testPOSTWithResponse() throws Exception { + String responseStr + = "{\"id\":\"fypiv\",\"name\":\"bbjpmcubkmif\",\"type\":\"xkubvphavpmhbrbq\",\"groupId\":\"govpbbtte\",\"requiredMembers\":[\"knssqyzqed\",\"kdfrdbiqmrjgeihf\",\"lg\",\"wfiwzcxmj\"],\"privateLinkServiceID\":\"yephmgtvljvrcmyf\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ContainerServiceManager manager = ContainerServiceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PrivateLinkResource response = manager.resolvePrivateLinkServiceIds() + .pOSTWithResponse("flrmymyi", "cqlh", + new PrivateLinkResourceInner().withId("s") + .withName("lmiiiovg") + .withType("gxuugqkctotio") + .withGroupId("xteqdptjgwdtg") + .withRequiredMembers(Arrays.asList("anblwphqlkccu", "gygqwah", "iul", "gniiprglvaw")), + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("fypiv", response.id()); + Assertions.assertEquals("bbjpmcubkmif", response.name()); + Assertions.assertEquals("xkubvphavpmhbrbq", response.type()); + Assertions.assertEquals("govpbbtte", response.groupId()); + Assertions.assertEquals("knssqyzqed", response.requiredMembers().get(0)); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ResourceQuotaTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ResourceQuotaTests.java new file mode 100644 index 000000000000..7fe711bd9dd8 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ResourceQuotaTests.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ResourceQuota; +import org.junit.jupiter.api.Assertions; + +public final class ResourceQuotaTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ResourceQuota model = BinaryData.fromString( + "{\"cpuRequest\":\"czhonnxkr\",\"cpuLimit\":\"nyhmossxkkgthr\",\"memoryRequest\":\"hxjbdhqxvc\",\"memoryLimit\":\"frpdsofbshrns\"}") + .toObject(ResourceQuota.class); + Assertions.assertEquals("czhonnxkr", model.cpuRequest()); + Assertions.assertEquals("nyhmossxkkgthr", model.cpuLimit()); + Assertions.assertEquals("hxjbdhqxvc", model.memoryRequest()); + Assertions.assertEquals("frpdsofbshrns", model.memoryLimit()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ResourceQuota model = new ResourceQuota().withCpuRequest("czhonnxkr") + .withCpuLimit("nyhmossxkkgthr") + .withMemoryRequest("hxjbdhqxvc") + .withMemoryLimit("frpdsofbshrns"); + model = BinaryData.fromObject(model).toObject(ResourceQuota.class); + Assertions.assertEquals("czhonnxkr", model.cpuRequest()); + Assertions.assertEquals("nyhmossxkkgthr", model.cpuLimit()); + Assertions.assertEquals("hxjbdhqxvc", model.memoryRequest()); + Assertions.assertEquals("frpdsofbshrns", model.memoryLimit()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ResourceReferenceTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ResourceReferenceTests.java new file mode 100644 index 000000000000..e9cc3400d878 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ResourceReferenceTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ResourceReference; +import org.junit.jupiter.api.Assertions; + +public final class ResourceReferenceTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ResourceReference model = BinaryData.fromString("{\"id\":\"kacspkw\"}").toObject(ResourceReference.class); + Assertions.assertEquals("kacspkw", model.id()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ResourceReference model = new ResourceReference().withId("kacspkw"); + model = BinaryData.fromObject(model).toObject(ResourceReference.class); + Assertions.assertEquals("kacspkw", model.id()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ScaleProfileTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ScaleProfileTests.java new file mode 100644 index 000000000000..63f71cfaac0b --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ScaleProfileTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ManualScaleProfile; +import com.azure.resourcemanager.containerservice.generated.models.ScaleProfile; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ScaleProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ScaleProfile model = BinaryData.fromString("{\"manual\":[{\"size\":\"v\",\"count\":1323562973}]}") + .toObject(ScaleProfile.class); + Assertions.assertEquals("v", model.manual().get(0).size()); + Assertions.assertEquals(1323562973, model.manual().get(0).count()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ScaleProfile model = new ScaleProfile() + .withManual(Arrays.asList(new ManualScaleProfile().withSize("v").withCount(1323562973))); + model = BinaryData.fromObject(model).toObject(ScaleProfile.class); + Assertions.assertEquals("v", model.manual().get(0).size()); + Assertions.assertEquals(1323562973, model.manual().get(0).count()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ScheduleTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ScheduleTests.java new file mode 100644 index 000000000000..bddf5c605d17 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/ScheduleTests.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.AbsoluteMonthlySchedule; +import com.azure.resourcemanager.containerservice.generated.models.DailySchedule; +import com.azure.resourcemanager.containerservice.generated.models.RelativeMonthlySchedule; +import com.azure.resourcemanager.containerservice.generated.models.Schedule; +import com.azure.resourcemanager.containerservice.generated.models.Type; +import com.azure.resourcemanager.containerservice.generated.models.WeekDay; +import com.azure.resourcemanager.containerservice.generated.models.WeeklySchedule; +import org.junit.jupiter.api.Assertions; + +public final class ScheduleTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + Schedule model = BinaryData.fromString( + "{\"daily\":{\"intervalDays\":313573135},\"weekly\":{\"intervalWeeks\":897249136,\"dayOfWeek\":\"Friday\"},\"absoluteMonthly\":{\"intervalMonths\":1174017685,\"dayOfMonth\":1534302042},\"relativeMonthly\":{\"intervalMonths\":1909225535,\"weekIndex\":\"Third\",\"dayOfWeek\":\"Saturday\"}}") + .toObject(Schedule.class); + Assertions.assertEquals(313573135, model.daily().intervalDays()); + Assertions.assertEquals(897249136, model.weekly().intervalWeeks()); + Assertions.assertEquals(WeekDay.FRIDAY, model.weekly().dayOfWeek()); + Assertions.assertEquals(1174017685, model.absoluteMonthly().intervalMonths()); + Assertions.assertEquals(1534302042, model.absoluteMonthly().dayOfMonth()); + Assertions.assertEquals(1909225535, model.relativeMonthly().intervalMonths()); + Assertions.assertEquals(Type.THIRD, model.relativeMonthly().weekIndex()); + Assertions.assertEquals(WeekDay.SATURDAY, model.relativeMonthly().dayOfWeek()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + Schedule model = new Schedule().withDaily(new DailySchedule().withIntervalDays(313573135)) + .withWeekly(new WeeklySchedule().withIntervalWeeks(897249136).withDayOfWeek(WeekDay.FRIDAY)) + .withAbsoluteMonthly( + new AbsoluteMonthlySchedule().withIntervalMonths(1174017685).withDayOfMonth(1534302042)) + .withRelativeMonthly(new RelativeMonthlySchedule().withIntervalMonths(1909225535) + .withWeekIndex(Type.THIRD) + .withDayOfWeek(WeekDay.SATURDAY)); + model = BinaryData.fromObject(model).toObject(Schedule.class); + Assertions.assertEquals(313573135, model.daily().intervalDays()); + Assertions.assertEquals(897249136, model.weekly().intervalWeeks()); + Assertions.assertEquals(WeekDay.FRIDAY, model.weekly().dayOfWeek()); + Assertions.assertEquals(1174017685, model.absoluteMonthly().intervalMonths()); + Assertions.assertEquals(1534302042, model.absoluteMonthly().dayOfMonth()); + Assertions.assertEquals(1909225535, model.relativeMonthly().intervalMonths()); + Assertions.assertEquals(Type.THIRD, model.relativeMonthly().weekIndex()); + Assertions.assertEquals(WeekDay.SATURDAY, model.relativeMonthly().dayOfWeek()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotInnerTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotInnerTests.java new file mode 100644 index 000000000000..eb6a4671b8ef --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotInnerTests.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.fluent.models.SnapshotInner; +import com.azure.resourcemanager.containerservice.generated.models.CreationData; +import com.azure.resourcemanager.containerservice.generated.models.SnapshotType; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class SnapshotInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SnapshotInner model = BinaryData.fromString( + "{\"properties\":{\"creationData\":{\"sourceResourceId\":\"vjlfrqtt\"},\"snapshotType\":\"NodePool\",\"kubernetesVersion\":\"katnwxyi\",\"nodeImageVersion\":\"id\",\"osType\":\"Windows\",\"osSku\":\"Windows2019\",\"vmSize\":\"vscx\",\"enableFIPS\":false},\"location\":\"igovi\",\"tags\":{\"uruocbgo\":\"kpmloa\"},\"id\":\"rb\",\"name\":\"eoybfhjxakvvjgs\",\"type\":\"ordilmywwtkgkxny\"}") + .toObject(SnapshotInner.class); + Assertions.assertEquals("igovi", model.location()); + Assertions.assertEquals("kpmloa", model.tags().get("uruocbgo")); + Assertions.assertEquals("vjlfrqtt", model.creationData().sourceResourceId()); + Assertions.assertEquals(SnapshotType.NODE_POOL, model.snapshotType()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SnapshotInner model = new SnapshotInner().withLocation("igovi") + .withTags(mapOf("uruocbgo", "kpmloa")) + .withCreationData(new CreationData().withSourceResourceId("vjlfrqtt")) + .withSnapshotType(SnapshotType.NODE_POOL); + model = BinaryData.fromObject(model).toObject(SnapshotInner.class); + Assertions.assertEquals("igovi", model.location()); + Assertions.assertEquals("kpmloa", model.tags().get("uruocbgo")); + Assertions.assertEquals("vjlfrqtt", model.creationData().sourceResourceId()); + Assertions.assertEquals(SnapshotType.NODE_POOL, model.snapshotType()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotListResultTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotListResultTests.java new file mode 100644 index 000000000000..016e5df9af62 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotListResultTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.implementation.models.SnapshotListResult; +import com.azure.resourcemanager.containerservice.generated.models.SnapshotType; +import org.junit.jupiter.api.Assertions; + +public final class SnapshotListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SnapshotListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"creationData\":{\"sourceResourceId\":\"xgwjplmagstcyoh\"},\"snapshotType\":\"NodePool\",\"kubernetesVersion\":\"rkdbdgiogsjkmnwq\",\"nodeImageVersion\":\"obaiyhddviaceg\",\"osType\":\"Linux\",\"osSku\":\"Ubuntu2204\",\"vmSize\":\"pmvmemfnczdwvv\",\"enableFIPS\":true},\"location\":\"lllchpodb\",\"tags\":{\"hfuk\":\"wrd\",\"fcvlerch\":\"vsjcswsmystuluqy\",\"xsspuunnoxyhk\":\"qbmfpjbabwidf\",\"ddrihpf\":\"g\"},\"id\":\"oqcaaewdaomdj\",\"name\":\"l\",\"type\":\"jxxkzbrmsgei\"},{\"properties\":{\"creationData\":{\"sourceResourceId\":\"kzkdncjdxonbz\"},\"snapshotType\":\"NodePool\",\"kubernetesVersion\":\"ulapzwyrp\",\"nodeImageVersion\":\"gtqxep\",\"osType\":\"Linux\",\"osSku\":\"AzureLinux3\",\"vmSize\":\"ajlyjtlvofqzhv\",\"enableFIPS\":false},\"location\":\"yfm\",\"tags\":{\"fzwiivwzjbhyz\":\"xrkjpvdw\",\"mbtrnegvmnvu\":\"xjrk\"},\"id\":\"eqvldspast\",\"name\":\"bkkd\",\"type\":\"flvestmjlxrrilo\"},{\"properties\":{\"creationData\":{\"sourceResourceId\":\"ewchpxlktwku\"},\"snapshotType\":\"NodePool\",\"kubernetesVersion\":\"slevufuztc\",\"nodeImageVersion\":\"yhjtqedcgzu\",\"osType\":\"Linux\",\"osSku\":\"AzureLinux\",\"vmSize\":\"z\",\"enableFIPS\":true},\"location\":\"vpglydz\",\"tags\":{\"yutnwytpzdmov\":\"vqeevtoep\",\"aawzqadfl\":\"vf\",\"riglaec\":\"z\",\"kpvzmlq\":\"ndtic\"},\"id\":\"mldgxobfirc\",\"name\":\"npkc\",\"type\":\"ayzri\"},{\"properties\":{\"creationData\":{\"sourceResourceId\":\"awfvjlboxqvkjl\"},\"snapshotType\":\"NodePool\",\"kubernetesVersion\":\"mdy\",\"nodeImageVersion\":\"dwdigumb\",\"osType\":\"Windows\",\"osSku\":\"Windows2022\",\"vmSize\":\"zptjazysd\",\"enableFIPS\":false},\"location\":\"wwvaiqyuvvfonk\",\"tags\":{\"auy\":\"qyikvy\",\"y\":\"vluwmncsttij\"},\"id\":\"vpo\",\"name\":\"krsgsgb\",\"type\":\"huzqgn\"}],\"nextLink\":\"gkynscliqh\"}") + .toObject(SnapshotListResult.class); + Assertions.assertEquals("lllchpodb", model.value().get(0).location()); + Assertions.assertEquals("wrd", model.value().get(0).tags().get("hfuk")); + Assertions.assertEquals("xgwjplmagstcyoh", model.value().get(0).creationData().sourceResourceId()); + Assertions.assertEquals(SnapshotType.NODE_POOL, model.value().get(0).snapshotType()); + Assertions.assertEquals("gkynscliqh", model.nextLink()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotPropertiesTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotPropertiesTests.java new file mode 100644 index 000000000000..94d4a71fd62d --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotPropertiesTests.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.fluent.models.SnapshotProperties; +import com.azure.resourcemanager.containerservice.generated.models.CreationData; +import com.azure.resourcemanager.containerservice.generated.models.SnapshotType; +import org.junit.jupiter.api.Assertions; + +public final class SnapshotPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SnapshotProperties model = BinaryData.fromString( + "{\"creationData\":{\"sourceResourceId\":\"b\"},\"snapshotType\":\"NodePool\",\"kubernetesVersion\":\"dtj\",\"nodeImageVersion\":\"wbcihxuuwh\",\"osType\":\"Linux\",\"osSku\":\"AzureLinux3\",\"vmSize\":\"ybvpay\",\"enableFIPS\":true}") + .toObject(SnapshotProperties.class); + Assertions.assertEquals("b", model.creationData().sourceResourceId()); + Assertions.assertEquals(SnapshotType.NODE_POOL, model.snapshotType()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SnapshotProperties model + = new SnapshotProperties().withCreationData(new CreationData().withSourceResourceId("b")) + .withSnapshotType(SnapshotType.NODE_POOL); + model = BinaryData.fromObject(model).toObject(SnapshotProperties.class); + Assertions.assertEquals("b", model.creationData().sourceResourceId()); + Assertions.assertEquals(SnapshotType.NODE_POOL, model.snapshotType()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsCreateOrUpdateWithResponseMockTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsCreateOrUpdateWithResponseMockTests.java new file mode 100644 index 000000000000..66fac2df5bea --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsCreateOrUpdateWithResponseMockTests.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.containerservice.generated.ContainerServiceManager; +import com.azure.resourcemanager.containerservice.generated.models.CreationData; +import com.azure.resourcemanager.containerservice.generated.models.Snapshot; +import com.azure.resourcemanager.containerservice.generated.models.SnapshotType; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class SnapshotsCreateOrUpdateWithResponseMockTests { + @Test + public void testCreateOrUpdateWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"creationData\":{\"sourceResourceId\":\"c\"},\"snapshotType\":\"NodePool\",\"kubernetesVersion\":\"zzhz\",\"nodeImageVersion\":\"xetlgydlhqv\",\"osType\":\"Windows\",\"osSku\":\"Windows2019\",\"vmSize\":\"b\",\"enableFIPS\":false},\"location\":\"geaar\",\"tags\":{\"ulidwc\":\"ekglklb\",\"nfhjirwgdnqzbr\":\"vmzegj\",\"igsxcdgljplk\":\"kspzhzmtksjcit\"},\"id\":\"ua\",\"name\":\"htomflrytswfp\",\"type\":\"mdgycxn\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ContainerServiceManager manager = ContainerServiceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + Snapshot response = manager.snapshots() + .define("lawjmjsmwrok") + .withRegion("qzr") + .withExistingResourceGroup("pcrrk") + .withTags(mapOf("vl", "gdphtvdula")) + .withCreationData(new CreationData().withSourceResourceId("zzzwy")) + .withSnapshotType(SnapshotType.NODE_POOL) + .create(); + + Assertions.assertEquals("geaar", response.location()); + Assertions.assertEquals("ekglklb", response.tags().get("ulidwc")); + Assertions.assertEquals("c", response.creationData().sourceResourceId()); + Assertions.assertEquals(SnapshotType.NODE_POOL, response.snapshotType()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsDeleteByResourceGroupWithResponseMockTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsDeleteByResourceGroupWithResponseMockTests.java new file mode 100644 index 000000000000..fd321c1bcb18 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsDeleteByResourceGroupWithResponseMockTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.containerservice.generated.ContainerServiceManager; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class SnapshotsDeleteByResourceGroupWithResponseMockTests { + @Test + public void testDeleteWithResponse() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ContainerServiceManager manager = ContainerServiceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.snapshots() + .deleteByResourceGroupWithResponse("ooclutnp", "memczjkmmyk", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsGetByResourceGroupWithResponseMockTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsGetByResourceGroupWithResponseMockTests.java new file mode 100644 index 000000000000..4bb795e417ad --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsGetByResourceGroupWithResponseMockTests.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.containerservice.generated.ContainerServiceManager; +import com.azure.resourcemanager.containerservice.generated.models.Snapshot; +import com.azure.resourcemanager.containerservice.generated.models.SnapshotType; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class SnapshotsGetByResourceGroupWithResponseMockTests { + @Test + public void testGetByResourceGroupWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"creationData\":{\"sourceResourceId\":\"ydsx\"},\"snapshotType\":\"NodePool\",\"kubernetesVersion\":\"hecbvopwndyq\",\"nodeImageVersion\":\"allklmtkhlowk\",\"osType\":\"Windows\",\"osSku\":\"Ubuntu\",\"vmSize\":\"dfjmzsyzfhotlh\",\"enableFIPS\":true},\"location\":\"ychunsjlpjrtwszh\",\"tags\":{\"bfdpyflubhv\":\"icphvtrrmhw\"},\"id\":\"glrocuy\",\"name\":\"lw\",\"type\":\"hmem\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ContainerServiceManager manager = ContainerServiceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + Snapshot response = manager.snapshots() + .getByResourceGroupWithResponse("xmycjimryvwgcw", "pbmz", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("ychunsjlpjrtwszh", response.location()); + Assertions.assertEquals("icphvtrrmhw", response.tags().get("bfdpyflubhv")); + Assertions.assertEquals("ydsx", response.creationData().sourceResourceId()); + Assertions.assertEquals(SnapshotType.NODE_POOL, response.snapshotType()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsListByResourceGroupMockTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsListByResourceGroupMockTests.java new file mode 100644 index 000000000000..7833bca0eeb9 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsListByResourceGroupMockTests.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.containerservice.generated.ContainerServiceManager; +import com.azure.resourcemanager.containerservice.generated.models.Snapshot; +import com.azure.resourcemanager.containerservice.generated.models.SnapshotType; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class SnapshotsListByResourceGroupMockTests { + @Test + public void testListByResourceGroup() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"creationData\":{\"sourceResourceId\":\"jylmbkzudnigr\"},\"snapshotType\":\"NodePool\",\"kubernetesVersion\":\"tjewlpxuzzj\",\"nodeImageVersion\":\"refqy\",\"osType\":\"Linux\",\"osSku\":\"CBLMariner\",\"vmSize\":\"hiqakydiwfbrk\",\"enableFIPS\":false},\"location\":\"qtvhcspodaqax\",\"tags\":{\"bmoichd\":\"ietgbebjfu\"},\"id\":\"pnfpubntnbat\",\"name\":\"viqsowsaaelcattc\",\"type\":\"uhplrvkmjcwmjv\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ContainerServiceManager manager = ContainerServiceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.snapshots().listByResourceGroup("ujxsglhsr", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("qtvhcspodaqax", response.iterator().next().location()); + Assertions.assertEquals("ietgbebjfu", response.iterator().next().tags().get("bmoichd")); + Assertions.assertEquals("jylmbkzudnigr", response.iterator().next().creationData().sourceResourceId()); + Assertions.assertEquals(SnapshotType.NODE_POOL, response.iterator().next().snapshotType()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsListMockTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsListMockTests.java new file mode 100644 index 000000000000..fdd909d8368c --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsListMockTests.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.containerservice.generated.ContainerServiceManager; +import com.azure.resourcemanager.containerservice.generated.models.Snapshot; +import com.azure.resourcemanager.containerservice.generated.models.SnapshotType; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class SnapshotsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"creationData\":{\"sourceResourceId\":\"gcvkyyli\"},\"snapshotType\":\"NodePool\",\"kubernetesVersion\":\"jpsfxsfu\",\"nodeImageVersion\":\"lvt\",\"osType\":\"Linux\",\"osSku\":\"AzureLinux3\",\"vmSize\":\"idqlvhu\",\"enableFIPS\":false},\"location\":\"ofizrvjfnmjmvlwy\",\"tags\":{\"uyjucejikzo\":\"blkujrllfojuidjp\",\"ikyju\":\"ovvtzejetjkln\"},\"id\":\"k\",\"name\":\"bqzolxr\",\"type\":\"vhqjwtrhtgvg\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ContainerServiceManager manager = ContainerServiceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.snapshots().list(com.azure.core.util.Context.NONE); + + Assertions.assertEquals("ofizrvjfnmjmvlwy", response.iterator().next().location()); + Assertions.assertEquals("blkujrllfojuidjp", response.iterator().next().tags().get("uyjucejikzo")); + Assertions.assertEquals("gcvkyyli", response.iterator().next().creationData().sourceResourceId()); + Assertions.assertEquals(SnapshotType.NODE_POOL, response.iterator().next().snapshotType()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/SysctlConfigTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/SysctlConfigTests.java new file mode 100644 index 000000000000..8fb434cb697c --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/SysctlConfigTests.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.SysctlConfig; +import org.junit.jupiter.api.Assertions; + +public final class SysctlConfigTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SysctlConfig model = BinaryData.fromString( + "{\"netCoreSomaxconn\":1373520670,\"netCoreNetdevMaxBacklog\":2004199815,\"netCoreRmemDefault\":348606393,\"netCoreRmemMax\":1755138995,\"netCoreWmemDefault\":296898162,\"netCoreWmemMax\":1771955734,\"netCoreOptmemMax\":1243443225,\"netIpv4TcpMaxSynBacklog\":1948326965,\"netIpv4TcpMaxTwBuckets\":1187742248,\"netIpv4TcpFinTimeout\":1804300161,\"netIpv4TcpKeepaliveTime\":1543997460,\"netIpv4TcpKeepaliveProbes\":1345546955,\"netIpv4TcpkeepaliveIntvl\":779621862,\"netIpv4TcpTwReuse\":false,\"netIpv4IpLocalPortRange\":\"wyahuxinpmqnja\",\"netIpv4NeighDefaultGcThresh1\":1876507017,\"netIpv4NeighDefaultGcThresh2\":1052966015,\"netIpv4NeighDefaultGcThresh3\":2020254457,\"netNetfilterNfConntrackMax\":1750576238,\"netNetfilterNfConntrackBuckets\":2136786806,\"fsInotifyMaxUserWatches\":750883620,\"fsFileMax\":2113722977,\"fsAioMaxNr\":827593581,\"fsNrOpen\":890104611,\"kernelThreadsMax\":944374464,\"vmMaxMapCount\":1651742779,\"vmSwappiness\":105374828,\"vmVfsCachePressure\":1030512533}") + .toObject(SysctlConfig.class); + Assertions.assertEquals(1373520670, model.netCoreSomaxconn()); + Assertions.assertEquals(2004199815, model.netCoreNetdevMaxBacklog()); + Assertions.assertEquals(348606393, model.netCoreRmemDefault()); + Assertions.assertEquals(1755138995, model.netCoreRmemMax()); + Assertions.assertEquals(296898162, model.netCoreWmemDefault()); + Assertions.assertEquals(1771955734, model.netCoreWmemMax()); + Assertions.assertEquals(1243443225, model.netCoreOptmemMax()); + Assertions.assertEquals(1948326965, model.netIpv4TcpMaxSynBacklog()); + Assertions.assertEquals(1187742248, model.netIpv4TcpMaxTwBuckets()); + Assertions.assertEquals(1804300161, model.netIpv4TcpFinTimeout()); + Assertions.assertEquals(1543997460, model.netIpv4TcpKeepaliveTime()); + Assertions.assertEquals(1345546955, model.netIpv4TcpKeepaliveProbes()); + Assertions.assertEquals(779621862, model.netIpv4TcpkeepaliveIntvl()); + Assertions.assertFalse(model.netIpv4TcpTwReuse()); + Assertions.assertEquals("wyahuxinpmqnja", model.netIpv4IpLocalPortRange()); + Assertions.assertEquals(1876507017, model.netIpv4NeighDefaultGcThresh1()); + Assertions.assertEquals(1052966015, model.netIpv4NeighDefaultGcThresh2()); + Assertions.assertEquals(2020254457, model.netIpv4NeighDefaultGcThresh3()); + Assertions.assertEquals(1750576238, model.netNetfilterNfConntrackMax()); + Assertions.assertEquals(2136786806, model.netNetfilterNfConntrackBuckets()); + Assertions.assertEquals(750883620, model.fsInotifyMaxUserWatches()); + Assertions.assertEquals(2113722977, model.fsFileMax()); + Assertions.assertEquals(827593581, model.fsAioMaxNr()); + Assertions.assertEquals(890104611, model.fsNrOpen()); + Assertions.assertEquals(944374464, model.kernelThreadsMax()); + Assertions.assertEquals(1651742779, model.vmMaxMapCount()); + Assertions.assertEquals(105374828, model.vmSwappiness()); + Assertions.assertEquals(1030512533, model.vmVfsCachePressure()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SysctlConfig model = new SysctlConfig().withNetCoreSomaxconn(1373520670) + .withNetCoreNetdevMaxBacklog(2004199815) + .withNetCoreRmemDefault(348606393) + .withNetCoreRmemMax(1755138995) + .withNetCoreWmemDefault(296898162) + .withNetCoreWmemMax(1771955734) + .withNetCoreOptmemMax(1243443225) + .withNetIpv4TcpMaxSynBacklog(1948326965) + .withNetIpv4TcpMaxTwBuckets(1187742248) + .withNetIpv4TcpFinTimeout(1804300161) + .withNetIpv4TcpKeepaliveTime(1543997460) + .withNetIpv4TcpKeepaliveProbes(1345546955) + .withNetIpv4TcpkeepaliveIntvl(779621862) + .withNetIpv4TcpTwReuse(false) + .withNetIpv4IpLocalPortRange("wyahuxinpmqnja") + .withNetIpv4NeighDefaultGcThresh1(1876507017) + .withNetIpv4NeighDefaultGcThresh2(1052966015) + .withNetIpv4NeighDefaultGcThresh3(2020254457) + .withNetNetfilterNfConntrackMax(1750576238) + .withNetNetfilterNfConntrackBuckets(2136786806) + .withFsInotifyMaxUserWatches(750883620) + .withFsFileMax(2113722977) + .withFsAioMaxNr(827593581) + .withFsNrOpen(890104611) + .withKernelThreadsMax(944374464) + .withVmMaxMapCount(1651742779) + .withVmSwappiness(105374828) + .withVmVfsCachePressure(1030512533); + model = BinaryData.fromObject(model).toObject(SysctlConfig.class); + Assertions.assertEquals(1373520670, model.netCoreSomaxconn()); + Assertions.assertEquals(2004199815, model.netCoreNetdevMaxBacklog()); + Assertions.assertEquals(348606393, model.netCoreRmemDefault()); + Assertions.assertEquals(1755138995, model.netCoreRmemMax()); + Assertions.assertEquals(296898162, model.netCoreWmemDefault()); + Assertions.assertEquals(1771955734, model.netCoreWmemMax()); + Assertions.assertEquals(1243443225, model.netCoreOptmemMax()); + Assertions.assertEquals(1948326965, model.netIpv4TcpMaxSynBacklog()); + Assertions.assertEquals(1187742248, model.netIpv4TcpMaxTwBuckets()); + Assertions.assertEquals(1804300161, model.netIpv4TcpFinTimeout()); + Assertions.assertEquals(1543997460, model.netIpv4TcpKeepaliveTime()); + Assertions.assertEquals(1345546955, model.netIpv4TcpKeepaliveProbes()); + Assertions.assertEquals(779621862, model.netIpv4TcpkeepaliveIntvl()); + Assertions.assertFalse(model.netIpv4TcpTwReuse()); + Assertions.assertEquals("wyahuxinpmqnja", model.netIpv4IpLocalPortRange()); + Assertions.assertEquals(1876507017, model.netIpv4NeighDefaultGcThresh1()); + Assertions.assertEquals(1052966015, model.netIpv4NeighDefaultGcThresh2()); + Assertions.assertEquals(2020254457, model.netIpv4NeighDefaultGcThresh3()); + Assertions.assertEquals(1750576238, model.netNetfilterNfConntrackMax()); + Assertions.assertEquals(2136786806, model.netNetfilterNfConntrackBuckets()); + Assertions.assertEquals(750883620, model.fsInotifyMaxUserWatches()); + Assertions.assertEquals(2113722977, model.fsFileMax()); + Assertions.assertEquals(827593581, model.fsAioMaxNr()); + Assertions.assertEquals(890104611, model.fsNrOpen()); + Assertions.assertEquals(944374464, model.kernelThreadsMax()); + Assertions.assertEquals(1651742779, model.vmMaxMapCount()); + Assertions.assertEquals(105374828, model.vmSwappiness()); + Assertions.assertEquals(1030512533, model.vmVfsCachePressure()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TagsObjectTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TagsObjectTests.java new file mode 100644 index 000000000000..8620c373c150 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TagsObjectTests.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.TagsObject; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class TagsObjectTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TagsObject model = BinaryData.fromString( + "{\"tags\":{\"tjrip\":\"fxobbcsws\",\"xzvlvqhjkbegib\":\"rbpbewtghfgblcg\",\"wrtz\":\"nmxiebwwaloayqc\",\"ngmtsavjcb\":\"uzgwyzmhtx\"}}") + .toObject(TagsObject.class); + Assertions.assertEquals("fxobbcsws", model.tags().get("tjrip")); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + TagsObject model = new TagsObject().withTags(mapOf("tjrip", "fxobbcsws", "xzvlvqhjkbegib", "rbpbewtghfgblcg", + "wrtz", "nmxiebwwaloayqc", "ngmtsavjcb", "uzgwyzmhtx")); + model = BinaryData.fromObject(model).toObject(TagsObject.class); + Assertions.assertEquals("fxobbcsws", model.tags().get("tjrip")); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TimeInWeekTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TimeInWeekTests.java new file mode 100644 index 000000000000..5c0902b10aaf --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TimeInWeekTests.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.TimeInWeek; +import com.azure.resourcemanager.containerservice.generated.models.WeekDay; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class TimeInWeekTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TimeInWeek model + = BinaryData.fromString("{\"day\":\"Tuesday\",\"hourSlots\":[478033620,2038816187,1679710100]}") + .toObject(TimeInWeek.class); + Assertions.assertEquals(WeekDay.TUESDAY, model.day()); + Assertions.assertEquals(478033620, model.hourSlots().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + TimeInWeek model + = new TimeInWeek().withDay(WeekDay.TUESDAY).withHourSlots(Arrays.asList(478033620, 2038816187, 1679710100)); + model = BinaryData.fromObject(model).toObject(TimeInWeek.class); + Assertions.assertEquals(WeekDay.TUESDAY, model.day()); + Assertions.assertEquals(478033620, model.hourSlots().get(0)); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TimeSpanTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TimeSpanTests.java new file mode 100644 index 000000000000..812a591922a9 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TimeSpanTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.TimeSpan; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class TimeSpanTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TimeSpan model = BinaryData.fromString("{\"start\":\"2021-06-26T13:54:37Z\",\"end\":\"2021-05-21T22:03:01Z\"}") + .toObject(TimeSpan.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-26T13:54:37Z"), model.start()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-21T22:03:01Z"), model.end()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + TimeSpan model = new TimeSpan().withStart(OffsetDateTime.parse("2021-06-26T13:54:37Z")) + .withEnd(OffsetDateTime.parse("2021-05-21T22:03:01Z")); + model = BinaryData.fromObject(model).toObject(TimeSpan.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-26T13:54:37Z"), model.start()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-21T22:03:01Z"), model.end()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleBindingInnerTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleBindingInnerTests.java new file mode 100644 index 000000000000..f0b1a9baa01d --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleBindingInnerTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.fluent.models.TrustedAccessRoleBindingInner; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class TrustedAccessRoleBindingInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TrustedAccessRoleBindingInner model = BinaryData.fromString( + "{\"properties\":{\"provisioningState\":\"Succeeded\",\"sourceResourceId\":\"xnkomtkubo\",\"roles\":[\"pnvdxz\",\"hihfrbbcevqagtlt\"]},\"id\":\"lfkqojpy\",\"name\":\"vgtrdcnifmzzs\",\"type\":\"ymbrnysuxmpraf\"}") + .toObject(TrustedAccessRoleBindingInner.class); + Assertions.assertEquals("xnkomtkubo", model.sourceResourceId()); + Assertions.assertEquals("pnvdxz", model.roles().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + TrustedAccessRoleBindingInner model = new TrustedAccessRoleBindingInner().withSourceResourceId("xnkomtkubo") + .withRoles(Arrays.asList("pnvdxz", "hihfrbbcevqagtlt")); + model = BinaryData.fromObject(model).toObject(TrustedAccessRoleBindingInner.class); + Assertions.assertEquals("xnkomtkubo", model.sourceResourceId()); + Assertions.assertEquals("pnvdxz", model.roles().get(0)); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleBindingListResultTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleBindingListResultTests.java new file mode 100644 index 000000000000..8cac8ea2fe7a --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleBindingListResultTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.implementation.models.TrustedAccessRoleBindingListResult; +import org.junit.jupiter.api.Assertions; + +public final class TrustedAccessRoleBindingListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TrustedAccessRoleBindingListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"provisioningState\":\"Updating\",\"sourceResourceId\":\"oz\",\"roles\":[\"hcxgkmoyx\",\"dyuib\",\"mfdn\"]},\"id\":\"ydvfvfcjnae\",\"name\":\"isrvhm\",\"type\":\"orffukiscv\"}],\"nextLink\":\"zhwplefaxvxilc\"}") + .toObject(TrustedAccessRoleBindingListResult.class); + Assertions.assertEquals("oz", model.value().get(0).sourceResourceId()); + Assertions.assertEquals("hcxgkmoyx", model.value().get(0).roles().get(0)); + Assertions.assertEquals("zhwplefaxvxilc", model.nextLink()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleBindingPropertiesTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleBindingPropertiesTests.java new file mode 100644 index 000000000000..55456234da61 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleBindingPropertiesTests.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.fluent.models.TrustedAccessRoleBindingProperties; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class TrustedAccessRoleBindingPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TrustedAccessRoleBindingProperties model = BinaryData.fromString( + "{\"provisioningState\":\"Deleting\",\"sourceResourceId\":\"khocxvdfffwaf\",\"roles\":[\"oudaspavehhrvk\"]}") + .toObject(TrustedAccessRoleBindingProperties.class); + Assertions.assertEquals("khocxvdfffwaf", model.sourceResourceId()); + Assertions.assertEquals("oudaspavehhrvk", model.roles().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + TrustedAccessRoleBindingProperties model + = new TrustedAccessRoleBindingProperties().withSourceResourceId("khocxvdfffwaf") + .withRoles(Arrays.asList("oudaspavehhrvk")); + model = BinaryData.fromObject(model).toObject(TrustedAccessRoleBindingProperties.class); + Assertions.assertEquals("khocxvdfffwaf", model.sourceResourceId()); + Assertions.assertEquals("oudaspavehhrvk", model.roles().get(0)); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleBindingsCreateOrUpdateMockTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleBindingsCreateOrUpdateMockTests.java new file mode 100644 index 000000000000..706b368b6556 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleBindingsCreateOrUpdateMockTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.containerservice.generated.ContainerServiceManager; +import com.azure.resourcemanager.containerservice.generated.models.TrustedAccessRoleBinding; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class TrustedAccessRoleBindingsCreateOrUpdateMockTests { + @Test + public void testCreateOrUpdate() throws Exception { + String responseStr + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"sourceResourceId\":\"th\",\"roles\":[\"n\"]},\"id\":\"aoyankcoeqswa\",\"name\":\"kltytmhdroz\",\"type\":\"nhd\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ContainerServiceManager manager = ContainerServiceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + TrustedAccessRoleBinding response = manager.trustedAccessRoleBindings() + .define("gkkumuikjcj") + .withExistingManagedCluster("gddeimaw", "o") + .withSourceResourceId("tbw") + .withRoles(Arrays.asList("sqowxwc")) + .create(); + + Assertions.assertEquals("th", response.sourceResourceId()); + Assertions.assertEquals("n", response.roles().get(0)); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleBindingsGetWithResponseMockTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleBindingsGetWithResponseMockTests.java new file mode 100644 index 000000000000..fec0496ba0e5 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleBindingsGetWithResponseMockTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.containerservice.generated.ContainerServiceManager; +import com.azure.resourcemanager.containerservice.generated.models.TrustedAccessRoleBinding; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class TrustedAccessRoleBindingsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"provisioningState\":\"Updating\",\"sourceResourceId\":\"srhmpqvww\",\"roles\":[\"ondcbrw\",\"muvqejosovyr\"]},\"id\":\"eaesin\",\"name\":\"qtljqobbpihehc\",\"type\":\"cy\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ContainerServiceManager manager = ContainerServiceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + TrustedAccessRoleBinding response = manager.trustedAccessRoleBindings() + .getWithResponse("skw", "qjjyslurl", "shhkvpedw", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("srhmpqvww", response.sourceResourceId()); + Assertions.assertEquals("ondcbrw", response.roles().get(0)); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleBindingsListMockTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleBindingsListMockTests.java new file mode 100644 index 000000000000..1940fa15bf4f --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleBindingsListMockTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.containerservice.generated.ContainerServiceManager; +import com.azure.resourcemanager.containerservice.generated.models.TrustedAccessRoleBinding; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class TrustedAccessRoleBindingsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Updating\",\"sourceResourceId\":\"dgzhxogj\",\"roles\":[\"svoujkxi\"]},\"id\":\"afhrkmdyomk\",\"name\":\"fbvfbhdy\",\"type\":\"rhpw\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ContainerServiceManager manager = ContainerServiceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.trustedAccessRoleBindings() + .list("mrqbrjbbmpxdlv", "kfrexcrseqwjks", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("dgzhxogj", response.iterator().next().sourceResourceId()); + Assertions.assertEquals("svoujkxi", response.iterator().next().roles().get(0)); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleInnerTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleInnerTests.java new file mode 100644 index 000000000000..a32d9c25f82e --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleInnerTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.fluent.models.TrustedAccessRoleInner; + +public final class TrustedAccessRoleInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TrustedAccessRoleInner model = BinaryData.fromString( + "{\"sourceResourceType\":\"wpgclrcivt\",\"name\":\"xfrk\",\"rules\":[{\"verbs\":[\"yyefrpmpdnqqs\"],\"apiGroups\":[\"ao\",\"vmm\"],\"resources\":[\"qfr\",\"qlkzme\",\"nitgvkxlz\"],\"resourceNames\":[\"rfe\"],\"nonResourceURLs\":[\"alzxwhcan\",\"ymo\",\"qhlwigdivbkbxgo\",\"fajuwas\"]},{\"verbs\":[\"aeyyg\",\"xakjsqzhzb\"],\"apiGroups\":[\"gims\",\"dxasicddyvv\",\"skgfmocwahpq\"],\"resources\":[\"jeaahhvjhh\",\"akz\",\"bbjjidjksyxk\"],\"resourceNames\":[\"xevbl\",\"jednlj\"],\"nonResourceURLs\":[\"euaulxu\",\"smjbnkppxyn\"]},{\"verbs\":[\"svxeizzgwklnsr\",\"ffeycx\"],\"apiGroups\":[\"piymerteea\",\"mx\",\"iekkkzddrtkgdojb\"],\"resources\":[\"a\",\"refdee\",\"vecuijpx\"],\"resourceNames\":[\"uwprtujwsawd\"],\"nonResourceURLs\":[\"babxvitit\",\"tzeexav\",\"xtfglecdmdqb\",\"pypqtgsfj\"]},{\"verbs\":[\"slhhxudbxv\"],\"apiGroups\":[\"tnsi\",\"ud\"],\"resources\":[\"mes\"],\"resourceNames\":[\"lpagzrcx\",\"a\",\"lc\",\"xwmdboxd\"],\"nonResourceURLs\":[\"ft\",\"fqob\",\"jln\",\"cgcckknhxkizvyt\"]}]}") + .toObject(TrustedAccessRoleInner.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleListResultTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleListResultTests.java new file mode 100644 index 000000000000..3225b4e24896 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleListResultTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.implementation.models.TrustedAccessRoleListResult; +import org.junit.jupiter.api.Assertions; + +public final class TrustedAccessRoleListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TrustedAccessRoleListResult model = BinaryData.fromString( + "{\"value\":[{\"sourceResourceType\":\"l\",\"name\":\"gncxykxhdj\",\"rules\":[{\"verbs\":[\"bcxf\",\"bcporxvxcjzhqizx\",\"pxtgqscjav\"],\"apiGroups\":[\"uhdqazk\",\"tgguwpijrajcivmm\",\"hfcf\",\"wrxgkneuvy\"],\"resources\":[\"qodfvp\",\"shoxgsgb\",\"fgzdjtxvz\"],\"resourceNames\":[\"q\",\"gaqvlgafcqusrd\"],\"nonResourceURLs\":[\"nwsdtutnwlduyc\"]},{\"verbs\":[\"hyrmewipmvekdx\",\"kuqgsjjxundxgket\",\"zhhzjhfjmhvvmu\"],\"apiGroups\":[\"mun\",\"qsxvmhf\"],\"resources\":[\"jyihsasbhudypo\"],\"resourceNames\":[\"emslynsqyrp\",\"oobrlttyms\"],\"nonResourceURLs\":[\"gqdnfwqzd\",\"gtilax\",\"nfhqlyvijouwivk\"]}]}],\"nextLink\":\"yzunbixxrtikv\"}") + .toObject(TrustedAccessRoleListResult.class); + Assertions.assertEquals("yzunbixxrtikv", model.nextLink()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleRuleTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleRuleTests.java new file mode 100644 index 000000000000..ec6ae5875058 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRoleRuleTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.TrustedAccessRoleRule; + +public final class TrustedAccessRoleRuleTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TrustedAccessRoleRule model = BinaryData.fromString( + "{\"verbs\":[\"vuljraaeranokqg\",\"kkjqnvbroylaxxu\"],\"apiGroups\":[\"isdos\",\"jbjsvgjrwh\",\"yvycytdclxgcckn\",\"nwm\"],\"resources\":[\"vpdvjdhttzae\",\"edxihchrphkmcrj\",\"qnsdfzpbgtgky\",\"kdghrjeuutlwx\"],\"resourceNames\":[\"zhokvbwnhh\"],\"nonResourceURLs\":[\"gehgppi\",\"ifhpf\"]}") + .toObject(TrustedAccessRoleRule.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRolesListMockTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRolesListMockTests.java new file mode 100644 index 000000000000..860122538f80 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/TrustedAccessRolesListMockTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.containerservice.generated.ContainerServiceManager; +import com.azure.resourcemanager.containerservice.generated.models.TrustedAccessRole; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class TrustedAccessRolesListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"sourceResourceType\":\"xhnpo\",\"name\":\"qwcabvnui\",\"rules\":[{\"verbs\":[\"swlpaugmrmfj\",\"rxwtoaukhfkvc\"],\"apiGroups\":[\"zmoaeds\",\"jwuive\"],\"resources\":[\"gyeewxeiq\",\"psmgo\"],\"resourceNames\":[\"amljdlrgmsplzgau\"],\"nonResourceURLs\":[\"hhvnewgnxkymp\",\"anxrj\",\"ixt\"]}]}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ContainerServiceManager manager = ContainerServiceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.trustedAccessRoles().list("i", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/UpgradeOverrideSettingsTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/UpgradeOverrideSettingsTests.java new file mode 100644 index 000000000000..b0c2fb608fc6 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/UpgradeOverrideSettingsTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.UpgradeOverrideSettings; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class UpgradeOverrideSettingsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UpgradeOverrideSettings model + = BinaryData.fromString("{\"forceUpgrade\":true,\"until\":\"2021-05-04T07:17:38Z\"}") + .toObject(UpgradeOverrideSettings.class); + Assertions.assertTrue(model.forceUpgrade()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-04T07:17:38Z"), model.until()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + UpgradeOverrideSettings model = new UpgradeOverrideSettings().withForceUpgrade(true) + .withUntil(OffsetDateTime.parse("2021-05-04T07:17:38Z")); + model = BinaryData.fromObject(model).toObject(UpgradeOverrideSettings.class); + Assertions.assertTrue(model.forceUpgrade()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-04T07:17:38Z"), model.until()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/UserAssignedIdentityTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/UserAssignedIdentityTests.java new file mode 100644 index 000000000000..05124077eb1c --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/UserAssignedIdentityTests.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.UserAssignedIdentity; +import org.junit.jupiter.api.Assertions; + +public final class UserAssignedIdentityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UserAssignedIdentity model = BinaryData + .fromString("{\"resourceId\":\"uhrzayvvt\",\"clientId\":\"vdfgiotk\",\"objectId\":\"utqxlngx\"}") + .toObject(UserAssignedIdentity.class); + Assertions.assertEquals("uhrzayvvt", model.resourceId()); + Assertions.assertEquals("vdfgiotk", model.clientId()); + Assertions.assertEquals("utqxlngx", model.objectId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + UserAssignedIdentity model + = new UserAssignedIdentity().withResourceId("uhrzayvvt").withClientId("vdfgiotk").withObjectId("utqxlngx"); + model = BinaryData.fromObject(model).toObject(UserAssignedIdentity.class); + Assertions.assertEquals("uhrzayvvt", model.resourceId()); + Assertions.assertEquals("vdfgiotk", model.clientId()); + Assertions.assertEquals("utqxlngx", model.objectId()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/VirtualMachineNodesTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/VirtualMachineNodesTests.java new file mode 100644 index 000000000000..4d3d06447e9d --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/VirtualMachineNodesTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.VirtualMachineNodes; +import org.junit.jupiter.api.Assertions; + +public final class VirtualMachineNodesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + VirtualMachineNodes model + = BinaryData.fromString("{\"size\":\"zrnf\",\"count\":1847576577}").toObject(VirtualMachineNodes.class); + Assertions.assertEquals("zrnf", model.size()); + Assertions.assertEquals(1847576577, model.count()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + VirtualMachineNodes model = new VirtualMachineNodes().withSize("zrnf").withCount(1847576577); + model = BinaryData.fromObject(model).toObject(VirtualMachineNodes.class); + Assertions.assertEquals("zrnf", model.size()); + Assertions.assertEquals(1847576577, model.count()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/VirtualMachinesProfileTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/VirtualMachinesProfileTests.java new file mode 100644 index 000000000000..bd42a392dd07 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/VirtualMachinesProfileTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.ManualScaleProfile; +import com.azure.resourcemanager.containerservice.generated.models.ScaleProfile; +import com.azure.resourcemanager.containerservice.generated.models.VirtualMachinesProfile; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class VirtualMachinesProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + VirtualMachinesProfile model = BinaryData.fromString( + "{\"scale\":{\"manual\":[{\"size\":\"epoo\",\"count\":895630833},{\"size\":\"vamih\",\"count\":774982264},{\"size\":\"arxzxtheot\",\"count\":1852537816}]}}") + .toObject(VirtualMachinesProfile.class); + Assertions.assertEquals("epoo", model.scale().manual().get(0).size()); + Assertions.assertEquals(895630833, model.scale().manual().get(0).count()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + VirtualMachinesProfile model = new VirtualMachinesProfile().withScale( + new ScaleProfile().withManual(Arrays.asList(new ManualScaleProfile().withSize("epoo").withCount(895630833), + new ManualScaleProfile().withSize("vamih").withCount(774982264), + new ManualScaleProfile().withSize("arxzxtheot").withCount(1852537816)))); + model = BinaryData.fromObject(model).toObject(VirtualMachinesProfile.class); + Assertions.assertEquals("epoo", model.scale().manual().get(0).size()); + Assertions.assertEquals(895630833, model.scale().manual().get(0).count()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/WeeklyScheduleTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/WeeklyScheduleTests.java new file mode 100644 index 000000000000..19665ab087f7 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/WeeklyScheduleTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.WeekDay; +import com.azure.resourcemanager.containerservice.generated.models.WeeklySchedule; +import org.junit.jupiter.api.Assertions; + +public final class WeeklyScheduleTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + WeeklySchedule model = BinaryData.fromString("{\"intervalWeeks\":1068836861,\"dayOfWeek\":\"Monday\"}") + .toObject(WeeklySchedule.class); + Assertions.assertEquals(1068836861, model.intervalWeeks()); + Assertions.assertEquals(WeekDay.MONDAY, model.dayOfWeek()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + WeeklySchedule model = new WeeklySchedule().withIntervalWeeks(1068836861).withDayOfWeek(WeekDay.MONDAY); + model = BinaryData.fromObject(model).toObject(WeeklySchedule.class); + Assertions.assertEquals(1068836861, model.intervalWeeks()); + Assertions.assertEquals(WeekDay.MONDAY, model.dayOfWeek()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/WindowsGmsaProfileTests.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/WindowsGmsaProfileTests.java new file mode 100644 index 000000000000..f3882824c383 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/test/java/com/azure/resourcemanager/containerservice/generated/generated/WindowsGmsaProfileTests.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.containerservice.generated.models.WindowsGmsaProfile; +import org.junit.jupiter.api.Assertions; + +public final class WindowsGmsaProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + WindowsGmsaProfile model = BinaryData + .fromString("{\"enabled\":false,\"dnsServer\":\"kexxppof\",\"rootDomainName\":\"axcfjpgddtocjjx\"}") + .toObject(WindowsGmsaProfile.class); + Assertions.assertFalse(model.enabled()); + Assertions.assertEquals("kexxppof", model.dnsServer()); + Assertions.assertEquals("axcfjpgddtocjjx", model.rootDomainName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + WindowsGmsaProfile model = new WindowsGmsaProfile().withEnabled(false) + .withDnsServer("kexxppof") + .withRootDomainName("axcfjpgddtocjjx"); + model = BinaryData.fromObject(model).toObject(WindowsGmsaProfile.class); + Assertions.assertFalse(model.enabled()); + Assertions.assertEquals("kexxppof", model.dnsServer()); + Assertions.assertEquals("axcfjpgddtocjjx", model.rootDomainName()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/tsp-location.yaml b/sdk/containerservice/azure-resourcemanager-containerservice-generated/tsp-location.yaml new file mode 100644 index 000000000000..db2c3902512d --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/containerservice/resource-manager/Microsoft.ContainerService/aks +commit: 63cb8f987d0d5fb94e781d000c7f7fc7a4a69842 +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/containerservice/ci.yml b/sdk/containerservice/ci.yml index f3a1d6f479c9..cc38fc690a5b 100644 --- a/sdk/containerservice/ci.yml +++ b/sdk/containerservice/ci.yml @@ -26,10 +26,14 @@ pr: - sdk/containerservice/pom.xml parameters: -- name: release_azureresourcemanagercontainerservice - displayName: 'azure-resourcemanager-containerservice' - type: boolean - default: false + - name: release_azureresourcemanagercontainerservice + displayName: azure-resourcemanager-containerservice + type: boolean + default: false + - name: release_azureresourcemanagercontainerservicegenerated + displayName: azure-resourcemanager-containerservice-generated + type: boolean + default: false extends: template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml @@ -40,3 +44,7 @@ extends: groupId: com.azure.resourcemanager safeName: azureresourcemanagercontainerservice releaseInBatch: ${{ parameters.release_azureresourcemanagercontainerservice }} + - name: azure-resourcemanager-containerservice-generated + groupId: com.azure.resourcemanager + safeName: azureresourcemanagercontainerservicegenerated + releaseInBatch: ${{ parameters.release_azureresourcemanagercontainerservicegenerated }} diff --git a/sdk/containerservice/pom.xml b/sdk/containerservice/pom.xml index 08ccb7890864..b80940427cad 100644 --- a/sdk/containerservice/pom.xml +++ b/sdk/containerservice/pom.xml @@ -10,5 +10,6 @@ 1.0.0 azure-resourcemanager-containerservice + azure-resourcemanager-containerservice-generated